:root {
    --bg-body: #F4F6F9;
    --bg-header: #343A40;
    --bg-card: #FFFFFF;

    --text-primary: #333333;
    --text-secondary: #6C757D;
    --text-light: #FFFFFF;

    --accent-color: #3B8ED0;
    --accent-color-hover: #2A6FA1;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;

    --border-color: #E9ECEF;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

    --header-height: 70px;

    --bg-input: #FFFFFF;
    --bg-hover: #F8F9FA;
    --bg-secondary: #F8F9FA;
}

body.dark-mode {
    --bg-body: #121212;
    --bg-header: #1a1a1a;
    --bg-card: #141414;
    --bg-input: #252525;
    --bg-hover: #2a2a2a;
    --bg-secondary: #1a1a1a;

    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-light: #ffffff;

    --border-color: #333333;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    background-color: var(--bg-header);
    height: var(--header-height);
    color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo {
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav {
    display: flex;
    height: 100%;
    gap: 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    color: #ADB5BD;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-top: 3px solid transparent;
    /* Placeholder for alignment */
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--accent-color);
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.username {
    font-weight: 600;
    font-size: 0.95rem;
}

.logout-btn {
    color: #ADB5BD;
    transition: color 0.2s;
    font-size: 1.1rem;
    padding: 0;
    height: auto;
    background: transparent !important;
    border: none !important;
}

.logout-btn:hover {
    color: var(--danger-color);
}

.clock {
    font-family: monospace;
    font-size: 0.9rem;
    color: #ADB5BD;
}


/* Main Wrapper */
.main-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.welcome-banner {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--accent-color);
}

.welcome-text h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.welcome-text h1 strong {
    font-weight: 700;
}

.welcome-actions .btn-info {
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.welcome-actions .btn-info:hover {
    transform: translateY(-2px);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(59, 142, 208, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-info {
    text-align: right;
}

.stats-card h3 {
    margin: 0 0 5px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.stats-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Progress-style line at bottom of card */
.stats-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color) 0%, #b2ebf2 100%);
    opacity: 0.6;
}


/* Common Headings */
h1,
h2,
h3 {
    color: var(--text-primary);
    margin-top: 0;
}

h2 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    display: inline-block;
}


/* Tables */
.table-container {
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

th {
    background-color: var(--bg-hover);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

tr:hover td {
    background-color: var(--bg-hover);
}

/* Accordion */
.user-row {
    cursor: pointer;
}

.user-cell {
    font-weight: 600;
    color: var(--accent-color);
}

.accordion-content {
    background-color: var(--bg-secondary);
}

.accordion-inner-container {
    padding: 1.5rem;
}


/* Buttons & Utils */
/* Buttons & Utils */
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-color-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background-color: #bd2130;
}

.text-green {
    color: var(--success-color);
}

.text-red {
    color: var(--danger-color);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1rem;
}

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

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 142, 208, 0.1);
}

/* Modals */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(2px);
}

.card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

/* Dropdowns */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    z-index: 100;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: var(--card-shadow);
}

.suggestion-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.suggestion-item:hover {
    background: var(--bg-hover);
}

/* Accordion */
.accordion-inner-container {
    padding: 1.5rem;
    border: 2px solid var(--accent-color);
    border-left: 4px solid var(--accent-color);
    background-color: var(--bg-secondary);
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Add a subtle gradient overlay */
.accordion-inner-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color) 0%, transparent 100%);
    border-radius: 8px 8px 0 0;
}

.inner-table {
    width: 100%;
    font-size: 0.9rem;
}

.inner-table th {
    background-color: transparent;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 0.5rem;
}

.inner-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.font-mono {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 500;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile menu toggle button - hidden on desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {

    /* Show hamburger button on mobile */
    .mobile-menu-toggle {
        display: block;
        order: 2;
    }

    /* Header adjustments */
    .app-header {
        height: auto;
        min-height: 60px;
    }

    .header-container {
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
        position: relative;
    }

    .logo-area {
        order: 1;
    }

    .logo {
        font-size: 1rem;
    }

    /* Hide main nav by default on mobile */
    .main-nav {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        background-color: var(--bg-header);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
        height: auto;
    }

    /* Show nav when mobile-open class is added */
    .main-nav.mobile-open {
        display: flex;
    }

    .nav-item {
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-top: none;
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        height: auto;
    }

    .nav-item.active {
        border-bottom-color: rgba(255, 255, 255, 0.1);
        border-left: 4px solid var(--accent-color);
    }

    .nav-icon {
        font-size: 1.2rem;
        margin-bottom: 0;
    }

    .nav-label {
        display: inline;
        font-size: 1rem;
    }

    .user-area {
        order: 3;
        gap: 10px;
    }

    .username {
        display: none;
    }

    .clock {
        font-size: 0.75rem;
    }

    /* Hide disk space icon on mobile (welcome-actions) */
    .welcome-actions {
        display: none !important;
    }

    /* Main content */
    .main-wrapper {
        margin: 20px auto;
        padding: 0 10px;
    }

    /* Welcome banner */
    .welcome-banner {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        text-align: center;
    }

    .welcome-text h1 {
        font-size: 1.2rem;
    }

    .welcome-actions {
        display: flex;
        gap: 10px;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stats-card {
        padding: 1rem;
    }

    .stats-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .stats-card .value {
        font-size: 1.5rem;
    }

    /* Tables */
    .table-container {
        padding: 0.5rem;
        overflow-x: auto;
    }

    table {
        font-size: 0.75rem;
    }

    th,
    td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    th {
        font-size: 0.7rem;
    }

    /* Hide less important columns on mobile */
    table th:nth-child(4),
    table td:nth-child(4),
    table th:nth-child(9),
    table td:nth-child(9) {
        display: none;
    }

    /* Accordion */
    .accordion-inner-container {
        padding: 1rem;
        margin: 0.5rem 0;
        border-width: 1px;
        border-left-width: 3px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .accordion-inner-container h4 {
        font-size: 1rem;
        word-wrap: break-word;
    }

    /* Inner tables */
    .inner-table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        max-width: 100%;
    }

    .inner-table thead,
    .inner-table tbody,
    .inner-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    .inner-table th,
    .inner-table td {
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ensure accordion content doesn't overflow */
    .accordion-content td {
        padding: 0 !important;
    }

    .accordion-content>td {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Time-based stats grid */
    .accordion-inner-container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Buttons */
    .btn-primary,
    .btn-danger {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Cards */
    .card {
        padding: 1rem;
    }

    /* Modals */
    .reg-modal-content {
        width: 95%;
        margin: 2vh auto;
        padding: 1rem;
    }

    /* Forms */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {

    /* Extra small devices */
    .logo {
        font-size: 0.9rem;
    }

    .nav-item {
        padding: 0 5px;
        font-size: 0.65rem;
    }

    .stats-card h3 {
        font-size: 0.7rem;
    }

    .stats-card .value {
        font-size: 1.3rem;
    }

    table {
        font-size: 0.7rem;
    }

    /* Hide even more columns on very small screens */
    table th:nth-child(3),
    table td:nth-child(3),
    table th:nth-child(7),
    table td:nth-child(7),
    table th:nth-child(8),
    table td:nth-child(8) {
        display: none;
    }
}