:root {
    --bg-dark: #070B14;
    --sidebar-bg: #0C111C;
    --card-bg: #121A2B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --gold: #D4AF37;
    --gold-hover: #F1C40F;
    --cyan: #00E5FF;
    --cyan-dim: rgba(0, 229, 255, 0.15);
    --green: #10B981;
    --red: #EF4444;
    --blue: #3B82F6;
    --warning: #F59E0B;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: -50px;
    left: 0;
    width: 100%;
    background: var(--red);
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    z-index: 9999;
    transition: var(--transition);
}

.offline-banner.visible {
    top: 0;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    padding-top: 42px;
    position: relative;
    z-index: 2;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px;
}

.sidebar-header h2 {
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.gold-text {
    color: var(--gold);
}

.sidebar-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item i {
    width: 25px;
    font-size: 1.2rem;
    margin-right: 15px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    border-left-color: var(--gold);
    color: var(--gold);
}

.nav-item.return-hub {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 20px;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item.return-hub:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}


.sidebar-footer {
    padding: 20px;
}

.ai-status-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.ai-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.pulsing-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pulsing-dot.green {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
    animation: pulse 2s infinite;
}

.pulsing-dot.red {
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.ai-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.ai-btn.primary {
    background: linear-gradient(135deg, var(--gold), #B8860B);
    color: #000;
}

.ai-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.ai-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid var(--red);
    margin-top: 20px;
    width: auto;
    padding: 10px 30px;
}

.ai-btn.danger:hover {
    background: var(--red);
    color: white;
}

.lang-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.lang-switch span {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.lang-switch span.active {
    background: var(--gold);
    color: #000;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 50px;
    width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.header-search i {
    color: var(--text-muted);
    margin-right: 15px;
}

.header-search input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-time {
    color: var(--text-muted);
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #B8860B);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Views */
.content-views {
    padding: 40px;
    flex: 1;
    position: relative;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 175, 55, 0.3);
}

.metric-card i {
    font-size: 2.5rem;
}

.icon-gold {
    color: var(--gold);
}

.icon-blue {
    color: var(--blue);
}

.icon-cyan {
    color: var(--cyan);
}

.metric-info h3 {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 700;
}

.metric-value .total {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.trend {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.trend.positive {
    color: var(--green);
}

/* Activity Log */
.dashboard-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.split-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.card-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-list {
    list-style: none;
}

.activity-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.act-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.act-details p {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.act-details span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.act-time {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Floor Map / Buttons */
.floor-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.floor-btn {
    padding: 12px 25px;
    background: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.floor-btn.active,
.floor-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    border-color: var(--gold);
}

/* Room Grid */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.room-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 5px solid transparent;
}

.room-card.clean {
    border-left-color: var(--green);
}

.room-card.dirty {
    border-left-color: var(--warning);
}

.room-card.occupied {
    border-left-color: var(--red);
}

.r-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.r-num {
    font-size: 1.5rem;
    font-weight: 700;
}

.r-status-badge {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clean .r-status-badge {
    color: var(--green);
}

.dirty .r-status-badge {
    color: var(--warning);
}

.occupied .r-status-badge {
    color: var(--red);
}

.r-desc {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.r-alert {
    color: var(--warning);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Parking Grid */
.parking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
}

.park-spot {
    height: 120px;
    border: 2px solid #334155;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: bold;
    font-size: 1.2rem;
}

.park-spot::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    width: 60%;
    height: 4px;
    background: #334155;
}

.park-spot.free {
    border-color: rgba(16, 185, 129, 0.5);
    color: var(--green);
}

.park-spot.occupied {
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--text-muted);
}

.park-spot.occupied i {
    font-size: 2.5rem;
    color: var(--red);
}

.park-spot.ev.free {
    border-color: var(--cyan);
    color: var(--cyan);
}

.park-spot.ev::before {
    content: '⚡';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
}


/* Voice Visuals */
.voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 11, 20, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.voice-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.voice-wave-container {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100px;
    margin-bottom: 30px;
}

.wave-bar {
    width: 15px;
    height: 20px;
    background: linear-gradient(180deg, var(--gold), #B8860B);
    border-radius: 50px;
    animation: wave 1s infinite ease-in-out;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {

    0%,
    100% {
        height: 20px;
    }

    50% {
        height: 100px;
    }
}

#ai-speaking-text {
    font-size: 2rem;
    font-weight: 300;
    color: white;
    margin-bottom: 20px;
}

/* ===== MOBILE HAMBURGER BUTTON ===== */
.mobile-hamburger {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10001;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: var(--sidebar-bg, #0C111C);
    color: var(--gold, #D4AF37);
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* ===== MOBILE RESPONSIVE (max 1024px) ===== */
@media (max-width: 1024px) {
    .mobile-hamburger {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .app-container {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
    }

    .top-header {
        padding: 0 20px;
        padding-left: 70px;
        height: 65px;
    }

    .header-search {
        width: 100%;
        max-width: 300px;
    }

    .content-views {
        padding: 20px;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
        margin-bottom: 25px;
    }

    .metric-card {
        padding: 18px;
        border-radius: 15px;
    }

    .metric-card i {
        font-size: 2rem;
    }

    .metric-value {
        font-size: 1.8rem;
    }

    .floor-selector {
        flex-wrap: wrap;
        gap: 10px;
    }

    .floor-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .room-grid {
        grid-template-columns: 1fr;
    }

    .parking-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .park-spot {
        height: 80px;
        font-size: 0.9rem;
    }

    .split-card {
        padding: 20px;
    }

    /* Make tables horizontally scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .chat-widget {
        width: calc(100% - 30px);
        right: 15px;
        bottom: 15px;
    }

    .whatsapp-btn {
        bottom: 80px;
        right: 15px;
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .voice-modal h3 {
        font-size: 1.5rem;
        padding: 0 20px;
        text-align: center;
    }

    .date-time {
        display: none;
    }
}

/* ===== SMALL PHONES (max 480px) ===== */
@media (max-width: 480px) {
    .top-header {
        padding: 0 15px;
        padding-left: 65px;
    }

    .header-search {
        max-width: 200px;
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .content-views {
        padding: 15px;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        padding: 14px;
        flex-direction: column;
        gap: 10px;
    }

    .metric-card i {
        font-size: 1.6rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-info h3 {
        font-size: 0.85rem;
    }

    .activity-list li {
        flex-direction: column;
        gap: 8px;
    }

    .act-time {
        margin-left: 0;
        font-size: 0.8rem;
    }

    .floor-map-container {
        height: 350px;
    }

    .table-obj {
        width: 55px;
        height: 55px;
        font-size: 0.75rem;
    }

    .ai-btn.primary {
        font-size: 0.85rem;
        padding: 10px;
    }

    .voice-wave-container {
        gap: 6px;
    }

    .wave-bar {
        width: 10px;
    }
}