:root {
    --primary-color: #27ae60;
    --primary-hover: #219150;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #c0392b;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --sidebar-bg: #1e4d3b;
    --sidebar-width: 260px;
    --border-radius: 8px;
    --header-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.5;
}

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

/* Utilities */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s, transform 0.1s;
    text-align: center;
}

.btn:active {
    transform: translateY(1px);
}

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

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

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

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

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Layout Classes */
.admin-layout {
    display: flex;
    gap: 20px;
}

.admin-list-section {
    flex: 2;
}

.admin-form-section {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    height: fit-content;
}

/* Sidebar & Admin Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100%;
    padding: 20px 0;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
    letter-spacing: 1px;
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 25px;
    margin-bottom: 2px;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--success-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 25px;
    transition: margin-left 0.3s ease-in-out;
}

/* Toggle Button (Mobile) */
/* Toggle Button (Mobile) - Styles moved to media query */
.menu-toggle {
    display: none;
}

/* Overlay for mobile sidebar */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

/* Kiosk Specifics (Keep existing) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.employee-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    user-select: none;
    border: 2px solid transparent;
}

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

.employee-card.working {
    border-color: var(--success-color);
    background-color: #f0fdf4;
}

.employee-card img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #eee;
}

.employee-card.working img {
    border-color: var(--success-color);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

#webcam-container {
    margin: 20px auto;
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

video {
    width: 100%;
    height: auto;
    display: block;
}

/* Toast */
.toast {
    visibility: hidden;
    min-width: 280px;
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 2100;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {
        bottom: 10px;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 10px;
        opacity: 0;
    }
}

/* Mobile Header */
.mobile-header {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .mobile-header {
        display: flex;
        align-items: center;
        background: var(--primary-color);
        color: white;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        z-index: 1100;
        padding: 0 15px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .mobile-title {
        font-size: 1.2rem;
        font-weight: bold;
    }

    .menu-toggle {
        display: block;
        position: static;
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        padding: 0;
        margin-right: 15px;
        box-shadow: none;
        cursor: pointer;
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1200;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px;
        /* Reset padding */
        margin-top: 50px;
        /* Push down using margin */
        width: 100%;
        min-height: calc(100vh - 80px);
    }

    .overlay.active {
        display: block;
        z-index: 1150;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-form-section {
        margin-bottom: 20px;
    }

    .employee-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .employee-card img {
        width: 80px;
        height: 80px;
    }
}