/* --- ⚡️ POUCHCARE DAMN DARK THEME --- */
:root {
    --bg-dark: #050505;
    --bg-card: #0B1120;
    --accent: #FFD700;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #1E293B;
    --success: #10B981;
    --danger: #EF4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-dark); color: var(--text-main); min-height: 100vh; }

/* UTILITIES */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }

/* --- APP TYPOGRAPHY ENFORCEMENT --- */
h1, h2, h3, h4, h5, h6 {
    margin: 0; 
    font-weight: 700; 
    letter-spacing: -0.02em;
}

/* Card Titles */
.card-title {
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    color: var(--text-muted); 
    margin-bottom: 15px;
}

/* Data Values */
.metric-value {
    font-size: 1.8rem; 
    font-weight: 800; 
    color: #fff;
}

/* --- DEFAULT DESKTOP LAYOUT --- */

/* Hide mobile elements on desktop */
.mobile-header { display: none; }
.mobile-menu { display: none; }
.mobile-header-container { display: none; }

/* Desktop Header */
.desktop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.desktop-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    min-width: 300px;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .material-icons-round {
    color: var(--text-muted);
    font-size: 20px;
}

.desktop-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-icon-btn .material-icons-round {
    color: var(--text-muted);
    font-size: 20px;
}

.header-icon-btn:hover {
    border-color: var(--accent);
}

.header-icon-btn:hover .material-icons-round {
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.header-user:hover {
    border-color: var(--accent);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-user-avatar .material-icons-round {
    color: var(--accent);
    font-size: 18px;
}

.header-user-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-img-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.header-user-info {
    display: flex;
    flex-direction: column;
}

.header-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.header-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Profile Dropdown */
.header-user-wrapper {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255,215,0,0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.profile-avatar-large {
    width: 50px;
    height: 50px;
    background: var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
}

.profile-avatar-large .material-icons-round {
    color: var(--accent);
    font-size: 28px;
}

.profile-info .profile-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.profile-info .profile-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-dropdown-body {
    padding: 15px 20px;
}

.profile-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.profile-detail:last-child {
    border-bottom: none;
}

.profile-detail .material-icons-round {
    color: var(--accent);
    font-size: 20px;
}

.profile-detail .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-detail .value {
    display: block;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 500;
}

.profile-dropdown-footer {
    display: flex;
    border-top: 1px solid var(--border);
}

.profile-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.profile-action:hover {
    background: rgba(255,215,0,0.1);
    color: var(--accent);
}

.profile-action.logout {
    border-left: 1px solid var(--border);
    color: var(--danger);
}

.profile-action.logout:hover {
    background: rgba(239,68,68,0.1);
}

.profile-action .material-icons-round {
    font-size: 18px;
}

/* Notifications Dropdown */
.notifications-wrapper {
    position: relative;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notifications-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.notif-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mark-all-read:hover {
    background: rgba(255,215,0,0.1);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,215,0,0.03);
}

.notif-item:hover {
    background: rgba(255,215,0,0.08);
}

.notif-item.read {
    background: transparent;
    opacity: 0.7;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--border);
}

.notif-icon .material-icons-round {
    font-size: 20px;
    color: var(--text-muted);
}

.notif-icon.success {
    background: rgba(34,197,94,0.15);
}
.notif-icon.success .material-icons-round {
    color: var(--success);
}

.notif-icon.warning {
    background: rgba(251,191,36,0.15);
}
.notif-icon.warning .material-icons-round {
    color: #fbbf24;
}

.notif-icon.info {
    background: rgba(59,130,246,0.15);
}
.notif-icon.info .material-icons-round {
    color: #3b82f6;
}

.notif-icon.ai {
    background: rgba(168,85,247,0.15);
}
.notif-icon.ai .material-icons-round {
    color: #a855f7;
}

.notif-icon.motivation {
    background: rgba(255,215,0,0.15);
}
.notif-icon.motivation .material-icons-round {
    color: var(--accent);
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.notif-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.notif-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.motivation-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, rgba(255,165,0,0.15) 100%);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.motivation-btn:hover {
    background: rgba(255,215,0,0.25);
    border-color: var(--accent);
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    gap: 10px;
}

.notif-empty .material-icons-round {
    font-size: 48px;
    opacity: 0.3;
}

.notif-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted);
}

.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Main Wrapper */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Desktop Grid Layout */
.dashboard-layout { 
    display: grid; 
    grid-template-columns: 260px 1fr;
    min-height: 100vh; 
}

/* Sidebar Base Style */
.sidebar { 
    background: var(--bg-card); 
    border-right: 1px solid var(--border); 
    height: 100vh; 
    position: sticky; 
    top: 0; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    z-index: 500;
}

.sidebar-header { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 1.2rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.close-btn { display: none; }

/* Menu Button */
.menu-btn { 
    background: var(--bg-dark); 
    border: 1px solid var(--border); 
    color: var(--accent); 
    cursor: pointer; 
    padding: 10px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.2s;
}
.menu-btn:hover { background: var(--border); }
.menu-btn:active { transform: scale(0.95); }

/* Navigation Items */
.sidebar-nav { flex-grow: 1; }
.nav-item { 
    display: flex; align-items: center; gap: 12px; 
    padding: 12px 15px; margin-bottom: 5px; border-radius: 8px;
    color: var(--text-muted); text-decoration: none; font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover, .nav-item.active { background: rgba(255, 215, 0, 0.1); color: var(--accent); }
.nav-item.logout { margin-top: auto; color: #EF4444; }
.nav-item.logout:hover { background: rgba(239, 68, 68, 0.1); color: #EF4444; }

/* Footer Profile */
.sidebar-footer {
    border-top: 1px solid var(--border); padding-top: 15px; margin-top: 20px;
    display: flex; align-items: center; gap: 10px;
}
.user-avatar { width: 36px; height: 36px; background: #1e293b; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.user-name { font-size: 0.9rem; font-weight: 600; color: #fff; }
.user-role { font-size: 0.75rem; }

/* --- MOBILE LAYOUT (< 768px) --- */
@media (max-width: 768px) {
    /* Stack layout */
    .dashboard-layout { display: block; }
    
    /* Hide desktop sidebar and desktop header */
    .sidebar { display: none !important; }
    .desktop-header { display: none !important; }

    /* Mobile Header Container */
    .mobile-header-container {
        display: block !important;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    /* Show Mobile Header */
    .mobile-header { 
        display: flex !important;
        align-items: center; 
        justify-content: space-between;
        background: var(--bg-card); 
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        position: relative;
    }
    
    /* Header Logo */
    .header-logo {
        height: 32px;
        width: auto;
        border-radius: 6px;
    }

    /* Mobile Dropdown Menu - Overlay below header */
    .mobile-menu {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border-bottom: 2px solid var(--accent);
    }
    
    /* Menu visible when active */
    .mobile-menu.active {
        max-height: 400px;
    }
    
    /* Mobile nav items */
    .mobile-nav-item {
        display: flex; 
        align-items: center; 
        gap: 14px;
        padding: 16px 20px;
        color: var(--text-muted); 
        text-decoration: none; 
        font-weight: 500;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border);
        transition: all 0.2s;
    }
    .mobile-nav-item:hover, 
    .mobile-nav-item:active {
        background: rgba(255, 215, 0, 0.15); 
        color: var(--accent);
    }
    .mobile-nav-item.logout { color: var(--danger); }
    .mobile-nav-item.logout:hover { background: rgba(239, 68, 68, 0.15); }
    
    .mobile-nav-item .material-icons-round {
        font-size: 22px;
    }
    
    /* Mobile Notification Button */
    .notif-btn-mobile {
        position: relative;
    }
    
    .notif-badge-mobile {
        position: absolute;
        top: -2px;
        right: -2px;
        background: var(--danger);
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile Notifications Panel */
    .mobile-notifications {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border-bottom: 2px solid var(--accent);
    }
    
    .mobile-notifications.active {
        max-height: 450px;
    }
    
    .mobile-notif-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-notif-header h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: #fff;
    }
    
    .mark-read-btn {
        background: none;
        border: none;
        color: var(--accent);
        font-size: 0.8rem;
        cursor: pointer;
    }
    
    .mobile-notif-list {
        flex: 1;
        overflow-y: auto;
        max-height: 380px;
    }
    
    .mobile-notif-item {
        display: flex;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(255,215,0,0.03);
    }
    
    .mobile-notif-item.read {
        background: transparent;
        opacity: 0.6;
    }
    
    .mobile-notif-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: var(--border);
    }
    
    .mobile-notif-icon .material-icons-round {
        font-size: 18px;
        color: var(--text-muted);
    }
    
    .mobile-notif-icon.success { background: rgba(34,197,94,0.15); }
    .mobile-notif-icon.success .material-icons-round { color: var(--success); }
    .mobile-notif-icon.warning { background: rgba(251,191,36,0.15); }
    .mobile-notif-icon.warning .material-icons-round { color: #fbbf24; }
    .mobile-notif-icon.info { background: rgba(59,130,246,0.15); }
    .mobile-notif-icon.info .material-icons-round { color: #3b82f6; }
    .mobile-notif-icon.motivation { background: rgba(255,215,0,0.15); }
    .mobile-notif-icon.motivation .material-icons-round { color: var(--accent); }
    
    .mobile-notif-content {
        flex: 1;
        min-width: 0;
    }
    
    .mobile-notif-title {
        font-size: 0.85rem;
        font-weight: 600;
        color: #fff;
        margin-bottom: 2px;
    }
    
    .mobile-notif-msg {
        font-size: 0.8rem;
        color: var(--text-muted);
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .mobile-notif-time {
        font-size: 0.7rem;
        color: var(--text-muted);
        margin-top: 4px;
    }
    
    .mobile-notif-empty {
        text-align: center;
        padding: 40px 20px;
        color: var(--text-muted);
    }
    
    /* --- MOBILE PROFILE DROPDOWN --- */
    .mobile-profile-wrapper {
        position: relative;
        cursor: pointer;
    }
    
    .mobile-profile-img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--accent);
    }
    
    .mobile-profile-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--accent);
        color: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.9rem;
    }
    
    .mobile-notif-dot {
        position: absolute;
        top: -2px;
        right: -2px;
        width: 10px;
        height: 10px;
        background: var(--danger);
        border-radius: 50%;
        border: 2px solid var(--bg-card);
        display: none;
    }
    
    .mobile-profile-dropdown {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border-bottom: 2px solid var(--accent);
        z-index: 1100;
    }
    
    .mobile-profile-dropdown.active {
        max-height: 600px;
    }
    
    .mobile-profile-header {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 18px 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(255,215,0,0.05);
    }
    
    .mobile-profile-header-img {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--accent);
    }
    
    .mobile-profile-header-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--accent);
        color: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.2rem;
    }
    
    .mobile-profile-info {
        flex: 1;
    }
    
    .mobile-profile-name {
        font-size: 1rem;
        font-weight: 700;
        color: #fff;
    }
    
    .mobile-profile-role {
        font-size: 0.8rem;
        color: var(--accent);
        font-weight: 600;
    }
    
    .mobile-profile-notif-section {
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-profile-notif-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 16px;
        cursor: pointer;
        transition: background 0.2s;
    }
    
    .mobile-profile-notif-header:hover {
        background: rgba(255,255,255,0.03);
    }
    
    .mobile-profile-notif-header .material-icons-round {
        font-size: 20px;
        color: var(--text-muted);
    }
    
    .mobile-profile-notif-header span:nth-child(2) {
        flex: 1;
        font-size: 0.9rem;
        color: var(--text-main);
    }
    
    .mobile-notif-badge {
        background: var(--danger);
        color: #fff;
        font-size: 0.7rem;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .expand-icon {
        transition: transform 0.2s;
    }
    
    .mobile-profile-notif-list {
        max-height: 0;
        overflow-y: auto;
        transition: max-height 0.3s ease, padding 0.3s ease;
        background: rgba(0,0,0,0.2);
    }
    
    .mobile-profile-actions {
        padding: 8px 0;
    }
    
    .mobile-profile-action {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
        transition: all 0.2s;
    }
    
    .mobile-profile-action:hover {
        background: rgba(255,215,0,0.1);
        color: var(--accent);
    }
    
    .mobile-profile-action.logout {
        color: var(--danger);
    }
    
    .mobile-profile-action.logout:hover {
        background: rgba(239,68,68,0.1);
    }
    
    .mobile-profile-action .material-icons-round {
        font-size: 20px;
    }
    
    /* Adjust main content padding for mobile */
    .main-content { padding: 20px 16px; }
}

/* --- BUTTONS --- */
.btn-yellow {
    background: var(--accent); color: #000; font-weight: 800;
    padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer;
    width: 100%; transition: transform 0.2s;
}
.btn-yellow:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2); }

/* --- LOGIN PAGE --- */
.login-wrapper {
    display: flex; height: 100vh; align-items: center; justify-content: center;
    background: radial-gradient(circle at top right, #1e293b 0%, #050505 40%);
}
.login-card {
    background: var(--bg-card); width: 100%; max-width: 400px;
    padding: 40px; border-radius: 16px; border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 1.8rem; margin-bottom: 5px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-muted); }
.form-input {
    width: 100%; background: #050505; border: 1px solid var(--border);
    padding: 12px; border-radius: 8px; color: #fff; outline: none;
}
.form-input:focus { border-color: var(--accent); }

/* --- MAIN CONTENT --- */
.main-content { padding: 30px; overflow-y: auto; }

/* --- CEO CARDS --- */
.ceo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.ceo-card { background: var(--bg-card); padding: 25px; border-radius: 12px; border: 1px solid var(--border); }
.ceo-card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; }
.ceo-card .value { font-size: 2rem; font-weight: 800; color: #fff; }

/* --- DOMAIN CARD STYLES --- */
.domain-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px; margin-bottom: 15px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
}
.domain-id-badge {
    background: var(--accent); color: #000; font-weight: 800;
    padding: 5px 10px; border-radius: 6px; font-size: 0.8rem; margin-right: 10px;
}
.expiry-tag { font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.expiry-tag.safe { background: rgba(16, 185, 129, 0.1); color: #10B981; }

/* --- TABLES --- */
table { width: 100%; text-align: left; border-collapse: collapse; color: var(--text-muted); }
table thead tr { border-bottom: 1px solid var(--border); }
table th { padding: 10px; font-weight: 600; }
table td { padding: 15px 10px; }
table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* --- AI CHAT WIDGET --- */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #FFA500 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.5);
}

.chat-toggle .material-icons-round {
    color: #000;
    font-size: 28px;
}

.chat-box {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chat-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info .material-icons-round {
    font-size: 32px;
    color: var(--accent);
}

.chat-title {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-close,
.chat-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover,
.chat-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chat-clear .material-icons-round {
    font-size: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 90%;
}

.chat-message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message.bot .message-avatar {
    background: rgba(255, 215, 0, 0.2);
}

.chat-message.bot .message-avatar .material-icons-round {
    color: var(--accent);
    font-size: 18px;
}

.chat-message.user .message-avatar {
    background: var(--accent);
}

.chat-message.user .message-avatar .material-icons-round {
    color: #000;
    font-size: 18px;
}

.message-content {
    background: var(--bg-dark);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.chat-message.user .message-content {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
}

.message-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.message-content li {
    margin: 4px 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.chat-input-area input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--accent);
}

.chat-input-area input::placeholder {
    color: var(--text-muted);
}

.chat-send {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send:hover {
    background: #FFE44D;
    transform: scale(1.05);
}

.chat-send .material-icons-round {
    color: #000;
    font-size: 20px;
}

/* Mobile table scroll */
@media (max-width: 768px) {
    .table-wrapper { overflow-x: auto; }
    .ceo-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .ceo-card { padding: 18px; }
    .ceo-card .value { font-size: 1.5rem; }
    
    /* Hide chat widget on mobile - use full page instead */
    .chat-widget { display: none; }
}

/* --- SETTINGS PAGE --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.settings-card.full-width {
    grid-column: 1 / -1;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: rgba(255, 215, 0, 0.05);
    border-bottom: 1px solid var(--border);
}

.settings-card-header .material-icons-round {
    font-size: 24px;
    color: var(--accent);
}

.settings-card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

.admin-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent);
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
}

.settings-form {
    padding: 20px;
}

.profile-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    margin-bottom: 20px;
}

.profile-preview-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.profile-preview-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
}

.profile-preview-info {
    flex: 1;
}

.profile-preview-id {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.profile-preview-role {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.code-textarea {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.settings-form .btn-yellow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    padding: 12px 24px;
    margin-top: 10px;
}

.settings-form .btn-yellow .material-icons-round {
    font-size: 18px;
}

/* Settings Options (Toggles) */
.settings-options {
    padding: 10px 0;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.settings-option:last-child {
    border-bottom: none;
}

.option-info {
    flex: 1;
}

.option-label {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* App Info Footer */
.app-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 30px 0;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.app-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.app-info-item .material-icons-round {
    font-size: 18px;
}

/* Settings Responsive */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .settings-form {
        padding: 16px;
    }
    
    .profile-preview {
        padding: 12px;
    }
    
    .profile-preview-img,
    .profile-preview-avatar {
        width: 50px;
        height: 50px;
    }
    
    .app-info {
        flex-direction: column;
        gap: 12px;
    }
}
