:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --border-color: rgba(148, 163, 184, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
    flex: 1;
}

header {
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: var(--glass-border);
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.9);
}

.topbar__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-word {
    display: none;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.logo-img {
    height: clamp(38px, 9vw, 56px);
    width: auto;
    max-width: min(70vw, 260px);
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
    transition: transform 0.25s ease;
}

.logo-img:hover {
    transform: translateY(-1px);
}

.topbar__action {
    position: absolute;
    right: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.topbar__action:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-top: var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 0.65rem 0.5rem;
    z-index: 20;
}

nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    gap: 0.25rem;
}

nav a.active {
    color: var(--accent-color);
}

nav a svg {
    width: 22px;
    height: 22px;
}

nav a.nav-admin {
    font-size: 0.85rem;
}

/* Hide logout in mobile nav (it's in header) */
nav a.logout-link {
    display: none;
}

/* Components */
.card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

input,
select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: var(--glass-border);
    color: white;
    font-size: 1rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Dashboard Specifics */
.status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--success-color);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success-color);
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: var(--glass-border);
}

.list-item:last-child {
    border-bottom: none;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.icon-btn:hover {
    color: white;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    padding: 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Utilities */
.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-secondary);
}

/* Nav logo - hidden on mobile, shown on desktop */
/* Requirements: 6.1, 6.2, 6.3, 6.4 - Responsive sidebar logo */
.nav-logo {
    display: none;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.nav-logo img {
    /* Requirement 6.1: Logo width 100% of sidebar container */
    width: 100%;
    /* Requirement 6.4: Maintain aspect ratio during scaling */
    height: auto;
    max-height: 80px;
    object-fit: contain;
    /* Smooth transitions for responsive changes */
    transition: all 0.3s ease;
}

/* Desktop/tablet adjustments */
@media (min-width: 600px) {
    nav {
        position: sticky;
        top: 0;
        width: 200px;
        min-width: 200px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        border-top: none;
        border-right: var(--glass-border);
        padding-top: 0;
    }

    body {
        flex-direction: row;
    }

    header {
        display: none;
        /* Hide header on desktop - logo is in sidebar */
    }

    nav a {
        flex-direction: row;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    /* Show logout in desktop sidebar */
    nav a.logout-link {
        display: flex;
        border-top: var(--glass-border);
        margin-top: auto;
        color: var(--danger-color);
    }
    
    /* Show logo in sidebar on desktop */
    /* Requirement 6.2: Responsive scaling with viewport changes */
    .nav-logo {
        display: block;
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-bottom: var(--glass-border);
    }
    
    .nav-logo img {
        /* Requirement 6.1: Logo width 100% of sidebar container */
        width: 100%;
        /* Requirement 6.4: Maintain aspect ratio */
        height: auto;
        max-height: 140px;
        object-fit: contain;
        margin-top: 0.35rem;
    }
}

/* Requirement 6.3: Handle sidebar collapse on mobile */
@media (max-width: 599px) {
    /* On mobile, logo is shown in header instead of sidebar */
    .nav-logo {
        display: none;
    }
    
    /* Header logo for mobile */
    header .logo-img {
        display: none;
    }
    
    header .logo-word {
        display: inline-flex;
    }

    header {
        padding: 0.75rem 1rem;
        justify-content: space-between;
    }
}

/* Larger screens - allow logo to scale up slightly */
@media (min-width: 900px) {
    nav {
        width: 220px;
        min-width: 220px;
    }
    
    .nav-logo img {
        max-height: 160px;
    }
}

/* Extra large screens */
@media (min-width: 1200px) {
    nav {
        width: 240px;
        min-width: 240px;
    }
    
    .nav-logo img {
        max-height: 180px;
    }
}
