:root {
    --primary: #032a56;
    --primary-light: #0a468d;
    --accent: #00d2ff;
    --bg: #f4f7fa;
    --card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --danger: #ff7675;
    --success: #55efc4;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Auth Pages */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #001a33 100%);
}

.auth-card {
    background: var(--card);
    padding: 3rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #edf2f7;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(3, 42, 86, 0.1);
}

.btn {
    cursor: pointer;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(3, 42, 86, 0.2);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--primary);
    color: white;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.sidebar .logo img#logo-img {
    width: 100%;
    filter: brightness(0) invert(1);
}

.sidebar .logo .logo-text {
    display: block;
    margin-top: 0.5rem;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.sidebar .logo span {
    color: var(--accent);
}

/* User info bar in top bar (mobile) - hidden on desktop */
.user-info-bar {
    display: none;
}

/* Hamburger button - hidden on desktop */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.nav-item {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255,255,255,0.1);
    color: var(--accent);
}

.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    text-transform: uppercase;
}

/* Cards & Sections */
.card {
    background: var(--card);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--primary);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Tables */
.data-table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    border-bottom: 2px solid var(--bg);
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--bg);
}

tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: #e6fffa; color: #38b2ac; }
.badge-danger { background: #fff5f5; color: #f56565; }
.badge-warning { background: #fefcbf; color: #b7791f; }

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    width: 100%;
    max-width: 700px;
    border-radius: 20px;
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: var(--primary);
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* =====================================================
   MOBILE / HAMBURGER MENU (max-width: 768px)
   ===================================================== */
@media (max-width: 768px) {
    /* Stack layout vertically */
    .dashboard { flex-direction: column; }

    /* Sidebar becomes a compact WHITE top bar like Kioskos */
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 0.5rem 1rem;
        align-items: center;
        flex-shrink: 0;
        position: relative;
        justify-content: space-between;
        overflow: visible;
        background-color: white !important;
        border-bottom: 1px solid #edf2f7;
    }

    /* Logo smaller and NOT inverted */
    .sidebar .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0 !important;
        padding-bottom: 0;
        border-bottom: none;
        width: auto;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.1rem;
    }
    
    .sidebar .logo img#logo-img {
        filter: brightness(0) !important;
        height: 25px;
        width: auto;
    }

    .sidebar .logo .logo-text {
        display: inline;
        color: var(--primary);
        font-size: 1.2rem;
        font-weight: 700;
        margin-top: 0;
    }

    /* Avatar + hamburger placement */
    .user-info-bar {
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        margin-left: 0;
    }

    /* Hamburger visible on the LEFT */
    #menu-toggle {
        display: block !important;
        color: var(--primary) !important; /* Dark blue hamburger */
        font-size: 1.8rem;
    }

    /* Show mobile avatar on the RIGHT */
    #user-avatar-mobile {
        display: block !important;
        border: 2px solid var(--primary);
    }

    /* Nav dropdown hidden by default */
    .nav-container {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary);
        flex-direction: column !important;
        padding: 0.5rem 1rem 1rem;
        box-shadow: 0 6px 20px rgba(0,0,0,0.3);
        z-index: 1000;
    }

    /* Open state */
    .nav-container.open {
        display: flex !important;
    }

    .nav-item {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        white-space: nowrap;
        margin-bottom: 0;
        color: white !important; /* Ensure text is white in dropdown */
    }
    .nav-item:last-child { margin-top: 0 !important; }

    /* Content */
    .main-content {
        padding: 1rem;
    }

    /* Hide the top bar inside main content on mobile to avoid duplication and overlap */
    .top-bar {
        display: none !important;
    }

    /* Typography */
    h2 { font-size: 1.4rem; }
    h1#section-title { font-size: 1.6rem; margin-bottom: 0.2rem; }
    #section-subtitle { font-size: 0.85rem; }
    .card { padding: 1.2rem; }
    table td, table th { white-space: nowrap; padding: 0.75rem; }

    /* Hide old header and user text */
    header { display: none; }
    .user-details-mobile-hide { display: none !important; }
}
