:root {
    --primary-blue: #0f3460;
    --dark-blue: #0a213b;
    --sidebar-bg: #1a3c6b;
    --active-nav: #0a213b;
    --accent-color: #ffffff;
    --text-color: #333333;
    --input-bg: #e6e6e6;
    --button-bg: #111111;
    --white: #ffffff;

    /* Dashboard colors */
    --stat-cyan: #0097a7;
    --stat-orange: #ffb74d;
    --stat-blue: #0d47a1;
    --card-dark: #0a1930;
}

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

/* Base Body (Login Page) */
body {
    height: 100vh;
    width: 100%;
}

/* Login Page Specifics - Only apply centering if on login page (no sidebar) */
body:not(.dashboard-body) {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-blue);
    overflow: hidden;
    position: relative;
}

/* Dashboard Body */
.dashboard-body {
    display: flex;
    background-color: #fff;
    /* Dashboard main bg is white */
    overflow-x: hidden;
}

/* Animated Background (Only for Login) */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #0f3460 0%, #0a213b 100%);
    overflow: hidden;
}

/* Floating Cubes Animation */
.cube {
    position: absolute;
    top: 80vh;
    left: 45vw;
    width: 10px;
    height: 10px;
    border: solid 1px rgba(255, 255, 255, 0.1);
    transform-origin: top left;
    transform: scale(0) rotate(0deg) translate(-50%, -50%);
    animation: cube 12s ease-in forwards infinite;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.cube:nth-child(1) {
    animation-delay: 2s;
    left: 25vw;
    top: 40vh;
    border-color: rgba(255, 255, 255, 0.2);
}

.cube:nth-child(2) {
    animation-delay: 4s;
    left: 75vw;
    top: 50vh;
    width: 20px;
    height: 20px;
}

.cube:nth-child(3) {
    animation-delay: 6s;
    left: 90vw;
    top: 10vh;
    border-color: rgba(255, 255, 255, 0.3);
}

.cube:nth-child(4) {
    animation-delay: 8s;
    left: 10vw;
    top: 85vh;
}

.cube:nth-child(5) {
    animation-delay: 10s;
    left: 50vw;
    top: 10vh;
    border-color: rgba(255, 255, 255, 0.15);
}

.background-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(30deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(150deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    transform: rotate(0deg);
    animation: gridMove 60s linear infinite;
    pointer-events: none;
}

@keyframes cube {
    from {
        transform: scale(0) rotate(0deg) translate(-50%, -50%);
        opacity: 1;
    }

    to {
        transform: scale(20) rotate(960deg) translate(-50%, -50%);
        opacity: 0;
    }
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-80px, 80px);
    }
}

/* Login Container */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    z-index: 2;
    padding: 20px;
}

.main-title {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

.login-card {
    background-color: var(--white);
    padding: 3rem 2.5rem;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 4px;
    animation: fadeInUp 1s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 2.5rem;
}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    color: #333;
    font-style: italic;
}

.input-group input::placeholder {
    font-style: italic;
    color: #888;
}

.input-group input:not(:placeholder-shown) {
    font-style: normal;
}

.input-group input:focus {
    border-color: var(--primary-blue);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
    font-size: 1rem;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #333;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-style: italic;
    user-select: none;
}

.remember-me input {
    accent-color: #333;
    cursor: pointer;
}

.forgot-password {
    text-decoration: none;
    color: #888;
    font-style: italic;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.login-btn {
    background-color: var(--button-bg);
    color: var(--white);
    border: none;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 140px;
    align-self: center;
    transition: all 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    background-color: #222;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

@media (max-width: 500px) {
    .main-title {
        font-size: 2rem;
    }

    .login-card {
        padding: 2rem;
        width: 100%;
    }
}

/* =========================================
   DASHBOARD STYLES
   ========================================= */

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    background: linear-gradient(180deg, #1a3c6b 0%, #0f3460 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100vh;
    position: fixed;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.2;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.nav-item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--active-nav);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active {
    background-color: #111;
    /* Dark background for active item */
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    padding: 40px;
    width: calc(100% - 250px);
    min-height: 100vh;
    background-color: #fff;
}

.welcome-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #000;
}

/* Stats Row */
.stats-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    /* Centered as per image reference though usually space-between */
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.stat-card {
    width: 200px;
    height: 140px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.cyan {
    background-color: var(--stat-cyan);
}

.stat-card.orange {
    background-color: var(--stat-orange);
}

.stat-card.blue {
    background-color: var(--stat-blue);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    position: absolute;
    bottom: -30px;
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

/* Action Cards Row */
.action-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.action-card {
    background-color: var(--card-dark);
    height: 180px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(10, 25, 48, 0.4);
    transition: all 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(10, 25, 48, 0.5);
    background-color: #0e2444;
}

/* Responsive Dashboard */
@media (max-width: 900px) {
    .sidebar {
        width: 70px;
        padding: 10px;
    }

    .sidebar-header h2,
    .sidebar-footer span,
    .nav-item span {
        display: none;
    }

    /* Hide text */
    .nav-item {
        justify-content: center;
        padding: 15px;
    }

    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 20px;
    }

    .stats-container {
        gap: 20px;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .stats-container {
        flex-direction: column;
        align-items: center;
        margin-bottom: 50px;
    }

    .stat-card {
        width: 100%;
        max-width: 300px;
        margin-bottom: 30px;
    }

    .action-cards-container {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   TABLE & MODAL STYLES (Locker List)
   ========================================= */

.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

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

.add-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.add-btn:hover {
    background-color: var(--dark-blue);
}

.table-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    padding: 20px;
}

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

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    color: #666;
}

th a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

tbody tr:hover {
    background-color: #f9f9f9;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.locked {
    background-color: #ffebee;
    color: #c62828;
}

.status-badge.unlocked {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.offline {
    background-color: #eceff1;
    color: #546e7a;
}

.action-cell {
    display: flex;
    gap: 10px;
}

.icon-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.icon-btn.edit {
    color: #1976d2;
}

.icon-btn.delete {
    color: #d32f2f;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow: hidden;
    /* Prevent background scroll */
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    max-height: 70vh;
    /* Reduced height to ensure fit */
    overflow-y: scroll;
    /* Always show scrollbar */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: fadeInDown 0.3s;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content .input-group {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-content select {
    width: 100%;
    padding: 12px;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 2px;
    outline: none;
}

.submit-btn {
    width: 100%;
    background-color: var(--button-bg);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #000;
}