/* Industrial Theme - Old Gold, Black, Gray, and White */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important; /* Force hide cursor everywhere for kiosk mode */
}

html, body {
    height: 100%;
    overflow: hidden; /* No scrolling - full kiosk style */
    cursor: none !important; /* Hide cursor for touchscreen kiosk */
    /* Anti-flickering optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #ffffff;
    cursor: none !important; /* Hide cursor for touchscreen kiosk */
    /* Hardware acceleration to prevent flickering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    /* Anti-flickering for container */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Top Bar - White Background with Dark Gray Text */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a; /* Dark theme */
    padding: 20px 40px;
    border-bottom: 4px solid #B8860B; /* Old Gold border */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    /* Anti-flickering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.company-logo {
    height: 60px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.refresh-button {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 3px solid #4a4a4a;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    outline: none; /* No outline on focus */
    -webkit-tap-highlight-color: transparent;
}

.refresh-button i {
    font-size: 2rem;
    color: #ffffff !important;
    background: transparent !important;
}

.refresh-button:hover {
    transform: rotate(180deg) scale(1.1);
    border-color: #FFD700;
    box-shadow: 0 6px 15px rgba(184, 134, 11, 0.6);
}

.refresh-button:active {
    transform: rotate(180deg) scale(0.95);
}

.refresh-button:focus {
    outline: none;
    border: 3px solid #4a4a4a; /* Keep same border */
}

/* Power Buttons (Reboot & Shutdown) */
.power-button {
    border: 2px solid #4a4a4a;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.power-button i {
    font-size: 1.5rem;
    color: #ffffff !important;
    background: transparent !important;
}

/* Reboot Button - Orange/Amber */
.power-button-reboot {
    background: linear-gradient(135deg, #ff8c00 0%, #d97706 100%);
}

.power-button-reboot:hover {
    transform: rotate(180deg) scale(1.1);
    border-color: #ffa500;
    box-shadow: 0 5px 12px rgba(255, 140, 0, 0.6);
}

.power-button-reboot:active {
    transform: rotate(180deg) scale(0.95);
}

/* Shutdown Button - Red */
.power-button-shutdown {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.power-button-shutdown:hover {
    transform: scale(1.1);
    border-color: #ef4444;
    box-shadow: 0 5px 12px rgba(220, 38, 38, 0.6);
}

.power-button-shutdown:active {
    transform: scale(0.95);
}

.power-button:focus {
    outline: none;
    border: 2px solid #4a4a4a;
}

.timestamp {
    font-size: 1rem;
    color: #B8860B; /* Old Gold for dark theme */
    font-weight: bold;
    text-align: left;
    margin-left: 5px;
}

/* Printer Status Indicators */
.printer-status {
    display: flex;
    gap: 15px;
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2a2a2a; /* Dark theme */
    border-radius: 20px;
    border: 2px solid #3a3a3a;
    transition: all 0.3s ease;
}

.status-item i {
    font-size: 1.8rem;
    color: #cccccc; /* Light color for dark theme */
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #999;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.status-dot.connected {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background: #f44336;
    box-shadow: 0 0 5px rgba(244, 67, 54, 0.5);
}

/* Printer icon clickable style */
.printer-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.printer-clickable:hover {
    background: #fff;
    border-color: #B8860B;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
    transform: scale(1.05);
}

.printer-clickable:active {
    transform: scale(0.98);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    }
    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 1);
    }
}

/* Main Content - Centered Grid */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    /* Anti-flickering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Menu View Container */
.menu-view {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Button Grid - 2 Columns */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    padding: 0 40px;
}

/* Button Grid - 3 Columns */
.button-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1400px;
    gap: 25px;
}

/* Menu Button Styles - Dark Brown Theme */
.menu-button {
    background: linear-gradient(135deg, #6B4423 0%, #4A2F17 100%); /* Dark brown gradient */
    border: 5px solid #B8860B; /* Gold border */
    border-radius: 20px;
    padding: clamp(30px, 5vh, 60px) clamp(20px, 3vw, 40px);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(15px, 2.5vh, 25px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    min-height: clamp(200px, 35vh, 280px);
    width: 100%;
    max-width: 100%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    /* Fix flickering with hardware acceleration */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.menu-button:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 50px rgba(107, 68, 35, 0.8); /* Dark brown shadow */
    border-color: #FFD700; /* Lighter gold on hover */
}

.menu-button:active {
    transform: translateY(-5px) scale(1.02);
}

.menu-button:focus {
    outline: none; /* Remove focus outline */
    border: 5px solid #B8860B; /* Keep gold border */
}

/* Large Button for Main Menu */
.menu-button-large {
    min-height: clamp(250px, 40vh, 350px);
}

.menu-button-large .menu-icon {
    font-size: clamp(6rem, 12vh, 10rem);
}

.menu-button-large .menu-text {
    font-size: clamp(2rem, 4vh, 3.5rem);
    line-height: 1.3;
}

.menu-icon {
    font-size: clamp(4rem, 8vh, 7rem);
    color: #ffffff !important;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
    background: transparent !important;
    /* Prevent flickering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.menu-button .bi {
    color: #ffffff !important;
    background: transparent !important;
}

.menu-text {
    font-size: clamp(1.5rem, 3vh, 2.5rem);
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1.5px;
    /* Prevent flickering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Back Button */
.back-button {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 4px solid #B8860B;
    border-radius: 15px;
    padding: 20px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.back-button:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 10px 30px rgba(184, 134, 11, 0.6);
}

.back-button:active {
    transform: translateY(-2px);
}

.menu-icon-small {
    font-size: 2rem;
    color: #ffffff !important;
    background: transparent !important;
}

.menu-text-small {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}

/* Content Area for Print Label Page */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 3vh; /* Use viewport height for responsive spacing */
    overflow: hidden;
    min-height: 0; /* Allow flex item to shrink */
}

.info-box {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    padding: 4vh 5vw; /* Responsive padding based on viewport */
    border-radius: 20px;
    border: 4px solid #B8860B; /* Old Gold border */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 90%;
    flex-shrink: 1; /* Allow shrinking if needed */
}

.info-box p {
    font-size: clamp(1.5rem, 3vh, 2.5rem); /* Responsive font size */
    text-align: center;
    color: #FFD700; /* Lighter gold for text */
}

/* Back Button */
.back-button {
    max-width: 500px;
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%); /* Gray gradient */
    border-color: #B8860B;
    padding: 4vh 6vw; /* Responsive padding */
    flex-shrink: 0; /* Don't shrink back button */
}

.back-button .menu-icon {
    font-size: clamp(3rem, 5vh, 5rem); /* Responsive icon size */
}

.back-button .menu-text {
    font-size: clamp(1.5rem, 2.5vh, 2.2rem); /* Responsive text size */
}

.back-button:hover {
    border-color: #FFD700;
    box-shadow: 0 20px 50px rgba(184, 134, 11, 0.6);
}

/* Responsive Design for Touch Screens */
@media (max-width: 1024px) {
    .top-bar {
        padding: 15px 30px;
    }

    .company-logo {
        height: 50px;
    }

    .button-grid {
        gap: 25px;
        padding: 0 30px;
    }

    .button-grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .menu-button {
        min-height: clamp(180px, 32vh, 240px);
        padding: clamp(25px, 4.5vh, 50px) clamp(18px, 2.5vw, 35px);
    }

    .menu-button-large {
        min-height: clamp(220px, 38vh, 320px);
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 10px 20px;
    }

    .company-logo {
        height: 40px;
    }

    .button-grid {
        grid-template-columns: 1fr; /* Stack vertically on small screens */
        gap: 20px;
        padding: 0 20px;
    }

    .button-grid-3 {
        grid-template-columns: 1fr; /* Stack all 3 vertically */
        gap: 15px;
    }

    .menu-button {
        min-height: clamp(120px, 20vh, 180px);
        padding: clamp(15px, 3vh, 35px) clamp(15px, 2vw, 30px);
    }

    .menu-button-large {
        min-height: clamp(140px, 22vh, 200px);
    }

    .menu-icon {
        font-size: clamp(3rem, 6vh, 5rem);
    }

    .menu-text {
        font-size: clamp(1.2rem, 2.5vh, 2rem);
    }
}

/* Ensure touch-friendly sizing on touchscreen devices */
@media (hover: none) and (pointer: coarse) {
    .menu-button {
        min-height: clamp(200px, 35vh, 260px);
    }
}

/* Print Button */
.print-button {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: none;
    flex-shrink: 0;
}

.print-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Message Overlay */
.status-message-overlay {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4vh 5vw;
    border-radius: 20px;
    font-size: clamp(1.8rem, 3vh, 2.5rem);
    text-align: center;
    font-weight: bold;
    max-width: 800px;
    width: 80%;
    z-index: 1000;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

/* QR Scan Mode Overlay - Optimized for Performance */
.qr-scan-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2500;
    justify-content: center;
    align-items: center;
    /* Hardware acceleration */
    will-change: opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.qr-scan-card {
    background: #2a2a2a; /* Solid color instead of gradient for better performance */
    border: 6px solid #B8860B; /* Old Gold color */
    border-radius: 20px;
    padding: clamp(20px, 3vh, 35px) clamp(25px, 3vw, 40px); /* Further reduced padding */
    max-width: 750px; /* Slightly wider for better data display */
    width: 85%; /* Slightly wider */
    max-height: 85vh; /* Limit height to viewport */
    overflow-y: auto; /* Enable scrolling */
    overflow-x: hidden; /* No horizontal scroll */
    text-align: center;
    box-shadow: 0 0 30px rgba(184, 134, 11, 0.5), 0 10px 40px rgba(0, 0, 0, 0.8);
    /* Hardware acceleration - no animation on appear for smooth performance */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Scrollbar styling for QR scan card */
.qr-scan-card::-webkit-scrollbar {
    width: 8px;
}

.qr-scan-card::-webkit-scrollbar-track {
    background: rgba(184, 134, 11, 0.1);
    border-radius: 4px;
}

.qr-scan-card::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 4px;
}

.qr-scan-card::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

.qr-scan-icon {
    font-size: clamp(4rem, 8vh, 6rem); /* Further reduced icon size */
    color: #B8860B; /* Old Gold color */
    margin-bottom: clamp(10px, 1.5vh, 18px); /* Reduced margin */
    /* Simplified pulse - GPU accelerated */
    animation: qrPulse 2s ease-in-out infinite;
    will-change: opacity;
}

@keyframes qrPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.qr-scan-title {
    font-size: clamp(1.6rem, 3.2vh, 2.5rem); /* Reduced title size */
    color: #FFD700; /* Lighter gold for title */
    font-weight: bold;
    margin-bottom: clamp(8px, 1.2vh, 15px); /* Reduced margin */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1.5px;
}

.qr-scan-subtitle {
    font-size: clamp(1rem, 1.8vh, 1.4rem); /* Reduced subtitle size */
    color: #ffffff;
    margin-bottom: clamp(12px, 1.8vh, 20px); /* Reduced margin */
    font-weight: normal;
}

.qr-scan-info {
    background: rgba(184, 134, 11, 0.15); /* Old Gold tint */
    border: 2px solid #B8860B; /* Old Gold border */
    border-radius: 12px;
    padding: clamp(10px, 1.5vh, 16px); /* Reduced padding */
    margin-bottom: clamp(8px, 1.2vh, 12px); /* Reduced margin */
}

.qr-scan-staff {
    font-size: clamp(1.2rem, 2vh, 1.6rem); /* Reduced staff name size */
    color: #FFD700; /* Lighter gold */
    font-weight: bold;
    margin-bottom: 6px;
}

.qr-scan-dept {
    font-size: clamp(0.9rem, 1.4vh, 1.2rem); /* Reduced department size */
    color: #B8860B; /* Old Gold */
    font-weight: normal;
}

.qr-scan-spinner {
    display: inline-block;
    width: clamp(30px, 4vh, 40px); /* Reduced spinner size */
    height: clamp(30px, 4vh, 40px);
    border: 3px solid rgba(184, 134, 11, 0.2); /* Old Gold faded */
    border-top: 3px solid #B8860B; /* Old Gold */
    border-radius: 50%;
    animation: qrSpin 1s linear infinite;
    margin: clamp(8px, 1.2vh, 12px) auto; /* Reduced margin */
    /* Hardware acceleration */
    will-change: transform;
    transform: translateZ(0);
}

@keyframes qrSpin {
    0% { transform: rotate(0deg) translateZ(0); }
    100% { transform: rotate(360deg) translateZ(0); }
}

/* ===== QR Results Display (Interactive Printing) ===== */
.qr-results-header {
    text-align: center;
    margin-bottom: clamp(10px, 1.5vh, 15px);
    padding-bottom: clamp(8px, 1.2vh, 12px);
    border-bottom: 2px solid #B8860B;
}

.qr-results-icon {
    font-size: clamp(3rem, 6vh, 4.5rem);
    color: #4CAF50;
    margin-bottom: clamp(6px, 1vh, 10px);
}

.qr-results-title {
    font-size: clamp(1.4rem, 2.8vh, 2rem);
    color: #FFD700;
    font-weight: bold;
    letter-spacing: 1px;
}

.qr-results-info {
    background: rgba(184, 134, 11, 0.1);
    border: 2px solid #B8860B;
    border-radius: 10px;
    padding: clamp(10px, 1.5vh, 15px);
    margin-bottom: clamp(12px, 2vh, 18px);
    text-align: left;
}

.qr-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(5px, 0.8vh, 8px) 0;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
    gap: 10px;
}

.qr-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.qr-info-label {
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    color: #B8860B;
    font-weight: bold;
    flex-shrink: 0;
    min-width: 100px;
}

.qr-info-value {
    font-size: clamp(0.95rem, 1.6vh, 1.2rem);
    color: #FFD700;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    text-align: right;
    word-break: break-word;
    flex: 1;
}

.qr-results-labels {
    margin-bottom: clamp(10px, 1.5vh, 15px);
}

.qr-labels-title {
    font-size: clamp(1.1rem, 2vh, 1.5rem);
    color: #FFD700;
    font-weight: bold;
    margin-bottom: clamp(8px, 1.5vh, 12px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-labels-title i {
    color: #B8860B;
}

.labels-list {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vh, 12px);
    /* Removed max-height and overflow - let it expand to full height */
    /* Outer .qr-scan-card handles all scrolling */
}

.label-item {
    background: rgba(184, 134, 11, 0.15);
    border: 2px solid #B8860B;
    border-radius: 8px;
    padding: clamp(8px, 1.2vh, 12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(8px, 1.2vw, 12px);
    transition: all 0.3s ease;
}

.label-item:hover {
    border-color: #FFD700;
    transform: translateX(2px);
}

.label-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.label-name {
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.label-name i {
    color: #B8860B;
    font-size: clamp(0.95rem, 1.6vh, 1.2rem);
    flex-shrink: 0;
}

.label-code {
    font-size: clamp(0.8rem, 1.3vh, 0.95rem);
    color: #B8860B;
    font-family: 'Courier New', monospace;
}

.label-print-btn {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 3px solid #FFD700;
    border-radius: 10px;
    padding: clamp(14px, 2.2vh, 20px) clamp(24px, 3.5vw, 36px);
    font-size: clamp(1.1rem, 2vh, 1.4rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.label-print-btn i {
    font-size: clamp(1.2rem, 2.2vh, 1.5rem);
    color: #ffffff;
}

.label-print-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.6);
}

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

.label-print-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.label-printed {
    background: linear-gradient(135deg, #2d5016 0%, #1f3a10 100%);
    border-color: #4CAF50;
    cursor: pointer; /* CHANGED: Keep pointer cursor to show it's clickable for reprint */
}

.label-printed:hover {
    /* CHANGED: Keep hover effect active so user knows it's clickable for reprint */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #3a6620 0%, #2d5016 100%);
}

.label-printed i {
    color: #90EE90;
}

.qr-close-button {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 2px solid #ffffff;
    border-radius: 10px;
    padding: clamp(10px, 1.5vh, 14px) clamp(18px, 2.5vw, 28px);
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    margin-top: clamp(8px, 1.2vh, 12px);
}

.qr-close-button i {
    font-size: clamp(1.1rem, 2vh, 1.5rem);
    color: #ffffff;
}

.qr-close-button:hover {
    transform: scale(1.05);
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.6);
}

.qr-close-button:active {
    transform: scale(0.98);
}

/* Cancel Button for Scan Overlays */
.qr-cancel-button {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 2px solid #888888;
    border-radius: 10px;
    padding: clamp(10px, 1.5vh, 14px) clamp(18px, 2.5vw, 28px);
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    margin-top: clamp(15px, 2vh, 25px);
}

.qr-cancel-button i {
    font-size: clamp(1.1rem, 2vh, 1.5rem);
    color: #ffffff;
}

.qr-cancel-button:hover {
    transform: scale(1.05);
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #5a5a5a 0%, #4a4a4a 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.qr-cancel-button:active {
    transform: scale(0.98);
}

.no-labels {
    text-align: center;
    padding: clamp(15px, 2.5vh, 25px);
    color: #999;
}

.no-labels i {
    font-size: clamp(2rem, 4vh, 3rem);
    color: #666;
    display: block;
    margin-bottom: 8px;
}

.no-labels p {
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    color: #999;
}

/* ===== QR Error Display ===== */
.qr-error-header {
    text-align: center;
    margin-bottom: clamp(12px, 2vh, 20px);
    padding-bottom: clamp(10px, 1.5vh, 15px);
    border-bottom: 2px solid #dc3545;
}

.qr-error-icon {
    font-size: clamp(3.5rem, 7vh, 5rem);
    color: #dc3545;
    margin-bottom: clamp(8px, 1.2vh, 12px);
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.qr-error-title {
    font-size: clamp(1.5rem, 3vh, 2.2rem);
    color: #dc3545;
    font-weight: bold;
    letter-spacing: 1px;
}

.qr-error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    border-radius: 10px;
    padding: clamp(12px, 2vh, 18px);
    margin-bottom: clamp(12px, 2vh, 18px);
    text-align: center;
}

.qr-error-message p {
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    color: #ffffff;
    font-weight: bold;
    margin: 0;
    line-height: 1.4;
}

.qr-error-details {
    background: rgba(220, 53, 69, 0.05);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: clamp(10px, 1.5vh, 15px);
    margin-bottom: clamp(12px, 2vh, 18px);
}

.qr-error-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(6px, 1vh, 10px) 0;
    border-bottom: 1px solid rgba(220, 53, 69, 0.15);
    gap: 10px;
}

.qr-error-detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.qr-error-label {
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    color: #dc3545;
    font-weight: bold;
    flex-shrink: 0;
}

.qr-error-value {
    font-size: clamp(0.95rem, 1.6vh, 1.2rem);
    color: #ff6b7a;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: right;
    word-break: break-word;
    flex: 1;
}

.qr-error-close-button {
    border-color: #dc3545;
}

.qr-error-close-button:hover {
    border-color: #ff6b7a;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* ===== History Overlay ===== */
.history-card {
    max-width: 800px;
    width: 85%;
    max-height: 85vh;
    overflow-y: auto;
}

.history-card::-webkit-scrollbar {
    width: 8px;
}

.history-card::-webkit-scrollbar-track {
    background: rgba(184, 134, 11, 0.1);
    border-radius: 4px;
}

.history-card::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 4px;
}

.history-card::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(15px, 2vh, 25px);
    padding-bottom: clamp(12px, 1.5vh, 20px);
    border-bottom: 3px solid #B8860B;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-title i {
    font-size: clamp(2rem, 4vh, 3rem);
    color: #B8860B;
}

.history-title h2 {
    font-size: clamp(1.8rem, 3.5vh, 2.5rem);
    color: #FFD700;
    font-weight: bold;
    letter-spacing: 1px;
}

.history-close-btn {
    background: transparent;
    border: 2px solid #B8860B;
    border-radius: 50%;
    width: clamp(35px, 5vh, 45px);
    height: clamp(35px, 5vh, 45px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.history-close-btn i {
    font-size: clamp(1.2rem, 2.2vh, 1.6rem);
    color: #B8860B;
}

.history-close-btn:hover {
    background: rgba(184, 134, 11, 0.2);
    border-color: #FFD700;
    transform: scale(1.1);
}

.history-close-btn:hover i {
    color: #FFD700;
}

.history-close-btn:active {
    transform: scale(0.95);
}

.history-staff-info {
    background: rgba(184, 134, 11, 0.15);
    border: 2px solid #B8860B;
    border-radius: 12px;
    padding: clamp(12px, 2vh, 18px);
    margin-bottom: clamp(15px, 2.5vh, 25px);
    text-align: center;
}

.history-staff-name {
    font-size: clamp(1.4rem, 2.5vh, 1.8rem);
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 5px;
}

.history-staff-dept {
    font-size: clamp(1rem, 1.6vh, 1.3rem);
    color: #B8860B;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 18px);
}

.history-empty {
    text-align: center;
    padding: clamp(30px, 5vh, 50px);
    color: #999;
}

.history-empty i {
    font-size: clamp(3rem, 6vh, 5rem);
    color: #666;
    display: block;
    margin-bottom: 15px;
}

.history-empty p {
    font-size: clamp(1.1rem, 2vh, 1.5rem);
    color: #999;
}

.history-item {
    background: rgba(184, 134, 11, 0.1);
    border: 2px solid #B8860B;
    border-radius: 12px;
    padding: clamp(12px, 2vh, 18px);
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #FFD700;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(10px, 1.5vh, 15px);
    padding-bottom: clamp(8px, 1.2vh, 12px);
    border-bottom: 1px solid rgba(184, 134, 11, 0.3);
}

.history-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(1.2rem, 2.2vh, 1.6rem);
    color: #FFD700;
}

.history-item-title i {
    color: #B8860B;
}

.ticket-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: clamp(0.7rem, 1.2vh, 0.85rem);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.ticket-status-badge i {
    font-size: clamp(0.65rem, 1.1vh, 0.8rem);
}

.ticket-complete {
    background: #28a745;
    color: #ffffff;
}

.ticket-complete i {
    color: #ffffff;
}

.ticket-pending {
    background: #ffc107;
    color: #000000;
}

.ticket-pending i {
    color: #000000;
}

.history-item-date {
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    color: #B8860B;
    font-family: 'Courier New', monospace;
}

.history-item-info {
    margin-bottom: clamp(10px, 1.5vh, 15px);
}

.history-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(6px, 1vh, 8px) 0;
}

.history-info-label {
    font-size: clamp(0.95rem, 1.6vh, 1.2rem);
    color: #B8860B;
    font-weight: bold;
}

.history-info-value {
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    color: #FFD700;
    font-weight: bold;
    text-align: right;
}

.history-item-labels {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 8px;
    padding: clamp(10px, 1.5vh, 12px);
}

.history-labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-labels-header span {
    font-size: clamp(1rem, 1.8vh, 1.3rem);
    color: #FFD700;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-labels-header span i {
    color: #B8860B;
}

.history-toggle-btn {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: clamp(6px, 1vh, 10px) clamp(10px, 1.5vw, 15px);
    font-size: clamp(0.85rem, 1.4vh, 1rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.history-toggle-btn i {
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
}

.history-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(184, 134, 11, 0.5);
}

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

.history-labels-list {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vh, 12px);
    margin-top: 10px;
}

.label-print-info {
    font-size: clamp(0.85rem, 1.4vh, 1rem);
    color: #4CAF50;
    margin-top: 4px;
    font-style: italic;
    text-align: left;
}

/* ===== History Header Actions ===== */
.history-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: 3px solid #ff6b7a;
    border-radius: 8px;
    padding: clamp(8px, 1.3vh, 12px) clamp(12px, 1.8vw, 16px);
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.history-delete-btn i {
    font-size: clamp(0.95rem, 1.6vh, 1.15rem);
    color: #ffffff;
}

.history-delete-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.7);
    border-color: #FFD700;
    background: linear-gradient(135deg, #e74c5b 0%, #d43545 100%);
}

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

.history-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== History Pagination ===== */
.history-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: clamp(15px, 2.5vh, 25px);
    padding-top: clamp(12px, 2vh, 20px);
    border-top: 2px solid #B8860B;
}

.pagination-btn {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: clamp(8px, 1.3vh, 12px) clamp(14px, 2vw, 18px);
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-width: clamp(130px, 15vw, 160px);
    justify-content: center;
}

.pagination-btn i {
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    color: #ffffff;
}

.pagination-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.6);
    border-color: #FFD700;
}

.pagination-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666 0%, #555 100%);
    border-color: #888;
}

.pagination-info {
    font-size: clamp(1.1rem, 2vh, 1.4rem);
    color: #FFD700;
    font-weight: bold;
    background: rgba(184, 134, 11, 0.15);
    border: 2px solid #B8860B;
    border-radius: 8px;
    padding: clamp(8px, 1.3vh, 12px) clamp(12px, 2vw, 16px);
    white-space: nowrap;
}

.pagination-info span {
    color: #FFD700;
}

/* ===== Label Print Count Badge ===== */
.label-print-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(0.75rem, 1.2vh, 0.9rem);
    color: #4CAF50;
    font-weight: bold;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid #4CAF50;
    border-radius: 12px;
    padding: 2px 8px;
    margin-left: 8px;
}

.label-print-count i {
    font-size: clamp(0.7rem, 1.1vh, 0.85rem);
    color: #4CAF50;
}

/* ===== Label Confirmation Badge ===== */
.label-confirm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(0.65rem, 1.1vh, 0.8rem);
    font-weight: bold;
    border-radius: 12px;
    padding: 3px 10px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-confirm-badge i {
    font-size: clamp(0.65rem, 1vh, 0.75rem);
}

/* Confirmed badge - green */
.label-confirmed {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
}

.label-confirmed i {
    color: #4CAF50;
}

/* Not confirmed badge - orange/warning */
.label-not-confirmed {
    color: #FF9800;
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #FF9800;
}

.label-not-confirmed i {
    color: #FF9800;
}

/* ===== Label Confirmation Info (similar to print info) ===== */
.label-confirm-info {
    font-size: clamp(0.7rem, 1.2vh, 0.85rem);
    color: #4CAF50;
    margin-top: 4px;
    font-style: italic;
}

/* ===== Delete Confirmation Modal ===== */
.delete-confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2600; /* Above history overlay (2500) */
    justify-content: center;
    align-items: center;
    /* Hardware acceleration */
    will-change: opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.delete-confirm-card {
    background: #2a2a2a;
    border: 6px solid #f44336; /* Red border for danger */
    border-radius: 20px;
    padding: clamp(30px, 4vh, 50px) clamp(35px, 4vw, 60px);
    max-width: 700px;
    width: 85%;
    text-align: center;
    box-shadow: 0 0 40px rgba(244, 67, 54, 0.6), 0 10px 50px rgba(0, 0, 0, 0.9);
    /* Hardware acceleration */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.delete-confirm-icon {
    font-size: clamp(5rem, 10vh, 8rem);
    color: #f44336; /* Red for danger */
    margin-bottom: clamp(15px, 2vh, 25px);
    animation: deleteIconPulse 2s ease-in-out infinite;
}

@keyframes deleteIconPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.delete-confirm-title {
    font-size: clamp(2rem, 4vh, 3rem);
    color: #ff6b7a; /* Light red */
    font-weight: bold;
    margin-bottom: clamp(10px, 1.5vh, 18px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 2px;
}

.delete-confirm-subtitle {
    font-size: clamp(1.3rem, 2.2vh, 1.8rem);
    color: #FFD700; /* Gold for emphasis */
    margin-bottom: clamp(15px, 2.5vh, 25px);
    font-weight: bold;
}

.delete-confirm-info {
    background: rgba(244, 67, 54, 0.15);
    border: 3px solid #f44336;
    border-radius: 15px;
    padding: clamp(15px, 2.5vh, 25px);
    margin-bottom: clamp(15px, 2.5vh, 25px);
}

.delete-staff-name {
    font-size: clamp(1.5rem, 2.8vh, 2rem);
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 15px;
}

.delete-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: clamp(1.1rem, 2vh, 1.5rem);
    color: #ffcccb; /* Light red */
    font-weight: bold;
}

.delete-warning i {
    font-size: clamp(1.3rem, 2.3vh, 1.7rem);
    color: #f44336;
}

.delete-confirm-spinner {
    display: inline-block;
    width: clamp(40px, 5vh, 50px);
    height: clamp(40px, 5vh, 50px);
    border: 4px solid rgba(244, 67, 54, 0.2);
    border-top: 4px solid #f44336;
    border-radius: 50%;
    animation: deleteSpinner 1s linear infinite;
    margin: clamp(10px, 1.5vh, 15px) auto;
    /* Hardware acceleration */
    will-change: transform;
    transform: translateZ(0);
}

@keyframes deleteSpinner {
    0% { transform: rotate(0deg) translateZ(0); }
    100% { transform: rotate(360deg) translateZ(0); }
}

.delete-cancel-btn {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 3px solid #B8860B;
    border-radius: 12px;
    padding: clamp(12px, 2vh, 18px) clamp(20px, 3vw, 35px);
    font-size: clamp(1.1rem, 2vh, 1.5rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    margin-top: clamp(10px, 1.5vh, 15px);
}

.delete-cancel-btn i {
    font-size: clamp(1.2rem, 2.2vh, 1.6rem);
    color: #ffffff;
}

.delete-cancel-btn:hover {
    transform: scale(1.05);
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.6);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.status-success {
    background: linear-gradient(135deg, #2d5016 0%, #1f3a10 100%);
    border: 4px solid #4CAF50;
    color: #90EE90;
}

.status-error {
    background: linear-gradient(135deg, #5a1616 0%, #3a0f0f 100%);
    border: 4px solid #f44336;
    color: #ffcccb;
}

/* Footer */
.footer {
    padding: 8px 20px;
    text-align: center;
    background: transparent;
}

.footer p {
    font-size: 0.7rem;
    color: #e0e0e0;
    font-weight: normal;
    font-family: Arial, sans-serif;
}

/* RFID/QR Popup */
.rfid-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    /* Hardware acceleration */
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.rfid-popup[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.rfid-popup-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 4px solid #B8860B;
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 85%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
    /* Hardware acceleration */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.rfid-popup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #B8860B;
}

.rfid-popup-header i {
    font-size: 2.5rem;
    color: #B8860B;
}

.rfid-popup-header h2 {
    font-size: 1.5rem;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.rfid-popup-body {
    margin-bottom: 20px;
}

.rfid-data-display {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.rfid-data-label {
    font-size: 0.9rem;
    color: #B8860B;
    margin-bottom: 8px;
    font-weight: bold;
}

.rfid-data-value {
    font-size: 2rem;
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.rfid-timestamp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #999;
}

.rfid-timestamp i {
    font-size: 1.1rem;
    color: #B8860B;
}

.rfid-close-button {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 2px solid #ffffff;
    border-radius: 10px;
    padding: 15px 30px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    /* Hardware acceleration */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.rfid-close-button:hover {
    transform: scale(1.05);
    border-color: #FFD700;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.6);
}

.rfid-close-button:active {
    transform: scale(0.98);
}

.rfid-close-button i {
    font-size: 1.5rem;
    color: #ffffff;
}

/* Responsive RFID Popup */
@media (max-width: 768px) {
    .rfid-popup-content {
        padding: 20px;
        max-width: 400px;
    }

    .rfid-popup-header h2 {
        font-size: 1.3rem;
    }

    .rfid-popup-header i {
        font-size: 2rem;
    }

    .rfid-data-value {
        font-size: 1.5rem;
    }

    .rfid-close-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* ===== RFID HID Test Panel ===== */
.rfid-test-panel {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 4px solid #B8860B;
    border-radius: 15px;
    margin: 20px 40px 0 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.rfid-test-header {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border-bottom: 3px solid #FFD700;
}

.rfid-test-header i {
    font-size: 1.8rem;
    color: #ffffff;
}

.rfid-test-header span {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
    flex: 1;
}

.test-panel-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.test-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.test-panel-toggle i {
    font-size: 1.2rem;
    color: #ffffff;
}

.rfid-test-body {
    padding: 25px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.test-instruction {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(184, 134, 11, 0.15);
    border: 2px solid #B8860B;
    border-radius: 10px;
    margin-bottom: 20px;
}

.test-instruction i {
    font-size: 1.5rem;
    color: #FFD700;
}

.test-instruction span {
    font-size: 1rem;
    color: #FFD700;
    font-weight: bold;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(184, 134, 11, 0.2);
    border-left: 4px solid #FFD700;
    border-radius: 5px;
}

.input-label i {
    font-size: 1.3rem;
    color: #FFD700;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.input-label span {
    font-size: 1.1rem;
    color: #FFD700;
    font-weight: bold;
}

.rfid-test-input {
    width: 100%;
    padding: 25px;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background: #ffffff;
    border: 5px solid #B8860B;
    border-radius: 15px;
    color: #000000;
    margin-bottom: 20px;
    outline: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: text; /* Show text cursor for input */
}

.rfid-test-input:focus {
    border-color: #FFD700;
    border-width: 6px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 2px 5px rgba(0, 0, 0, 0.1);
    background: #fffef0;
}

.rfid-test-input::placeholder {
    color: #999;
    font-style: italic;
    font-size: 1.3rem;
}

.test-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #B8860B;
}

.test-log-header span {
    font-size: 1.2rem;
    font-weight: bold;
    color: #FFD700;
}

.clear-log-btn {
    background: linear-gradient(135deg, #5a1616 0%, #3a0f0f 100%);
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffcccb;
    transition: all 0.3s ease;
    outline: none;
}

.clear-log-btn:hover {
    background: linear-gradient(135deg, #6a1a1a 0%, #4a1212 100%);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.5);
}

.clear-log-btn i {
    font-size: 1rem;
}

.rfid-test-log {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #4a4a4a;
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.rfid-test-log::-webkit-scrollbar {
    width: 10px;
}

.rfid-test-log::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 5px;
}

.rfid-test-log::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 5px;
}

.rfid-test-log::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

.log-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
    font-size: 1rem;
}

.log-entry {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 2px solid #B8860B;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.log-entry:hover {
    border-color: #FFD700;
    box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4);
}

.log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #4a4a4a;
}

.log-count {
    font-size: 1.1rem;
    font-weight: bold;
    color: #FFD700;
    background: rgba(184, 134, 11, 0.2);
    padding: 5px 12px;
    border-radius: 5px;
}

.log-timestamp {
    font-size: 0.9rem;
    color: #999;
    font-family: 'Courier New', monospace;
}

.log-data {
    margin-bottom: 10px;
}

.log-data strong {
    color: #B8860B;
    font-size: 1rem;
}

.log-data-value {
    color: #FFD700;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    word-wrap: break-word;
    display: block;
    margin-top: 5px;
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 5px;
}

.log-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #999;
}

.log-meta strong {
    color: #B8860B;
}

@keyframes blinkEntry {
    0%, 100% {
        background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    }
    50% {
        background: linear-gradient(135deg, #4a4a2a 0%, #3a3a1a 100%);
    }
}

/* Responsive Test Panel */
@media (max-width: 768px) {
    .rfid-test-panel {
        margin: 15px 20px 0 20px;
    }

    .rfid-test-header {
        padding: 12px 20px;
    }

    .rfid-test-header span {
        font-size: 1.1rem;
    }

    .rfid-test-input {
        font-size: 1.5rem;
        padding: 20px;
        min-height: 70px;
    }

    .rfid-test-log {
        max-height: 300px;
    }

    .log-data-value {
        font-size: 1.2rem;
    }
}

/* ===== Settings Button ===== */
.settings-button {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 3px solid #B8860B;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.settings-button i {
    font-size: 2rem;
    color: #B8860B !important;
    background: transparent !important;
    transition: transform 0.3s ease;
}

.settings-button:hover {
    transform: scale(1.1);
    border-color: #FFD700;
    box-shadow: 0 6px 15px rgba(184, 134, 11, 0.6);
}

.settings-button:hover i {
    transform: rotate(90deg);
    color: #FFD700 !important;
}

.settings-button:active {
    transform: scale(0.95);
}

/* ===== Modal Overlay ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

/* ===== Modal Content ===== */
.modal-content {
    background: #ffffff;
    border: 5px solid #B8860B;
    border-radius: 20px;
    padding: clamp(20px, 3vh, 30px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    max-height: 90vh;
    overflow: visible; /* No scrollbar on modal itself */
    animation: modalFadeIn 0.3s ease;
}

.modal-small {
    max-width: 500px;
    width: 90%;
}

.modal-pin {
    max-width: 95vw;
    width: 95%;
    max-height: 90vh;
    height: auto;
}

.modal-large {
    max-width: 95vw;
    width: 95%;
    max-height: 90vh;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 5px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 5px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

/* ===== Modal Header ===== */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 1.5vh, 15px);
    margin-bottom: clamp(15px, 2.5vh, 25px);
    padding-bottom: clamp(12px, 2vh, 20px);
    border-bottom: 3px solid #B8860B;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.5vh, 15px);
}

.modal-header i {
    font-size: clamp(2rem, 4vh, 3rem);
    color: #B8860B;
}

.modal-header h2 {
    font-size: clamp(1.5rem, 3vh, 2rem);
    color: #000000;
    text-shadow: none;
    letter-spacing: 1px;
}

/* Modal Close Button (X) */
.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-close-btn i {
    font-size: 2rem;
    color: #666;
}

.modal-close-btn:hover {
    background: rgba(244, 67, 54, 0.1);
    transform: scale(1.1);
}

.modal-close-btn:hover i {
    color: #f44336;
}

.modal-close-btn:active {
    transform: scale(0.95);
}

/* ===== Modal Body ===== */
.modal-body {
    margin-bottom: 25px;
}

/* 2 Column Layout for PIN Modal */
.modal-body-2col {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(20px, 3vw, 40px);
    align-items: center;
    margin-bottom: 0;
    padding: clamp(10px, 2vh, 20px) 0;
}

.pin-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(10px, 2vh, 20px);
}

.numpad-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-subtitle {
    text-align: center;
    color: #666666;
    font-size: clamp(0.9rem, 1.5vh, 1.1rem);
    margin-bottom: clamp(10px, 2vh, 20px);
    font-weight: normal;
}

/* 2 Column Layout for Card Registration Modal */
.modal-body-card-reg {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: clamp(20px, 3vw, 30px);
    align-items: start;
    margin-bottom: 0;
    padding: 0;
}

.action-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.staff-column {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow shrinking */
    overflow: visible; /* Allow child scrollbar to be visible */
}

.staff-column .staff-list-container {
    flex: 1;
    min-height: 0;
    overflow: visible; /* Allow child scrollbar to be visible */
}

/* Adjust margins for elements inside columns */
.action-column .card-check-section,
.action-column .card-reg-status {
    margin-bottom: 0;
}

/* ===== PIN Input ===== */
.pin-input-container {
    display: flex;
    justify-content: center;
    margin: clamp(15px, 3vh, 30px) 0;
}

.pin-input {
    width: clamp(180px, 20vw, 220px);
    padding: clamp(15px, 2.5vh, 25px);
    font-size: clamp(2rem, 4vh, 3rem);
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: center;
    background: #ffffff;
    border: 4px solid #B8860B;
    border-radius: 12px;
    color: #000000;
    outline: none;
    letter-spacing: clamp(10px, 1.5vw, 15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    cursor: default; /* Default cursor for readonly PIN input */
}

.pin-input:focus {
    border-color: #FFD700;
    border-width: 6px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    background: #fffef0;
}

.pin-input::placeholder {
    color: #999;
    letter-spacing: 10px;
}

.pin-hint {
    text-align: center;
    color: #666;
    font-size: clamp(0.8rem, 1.3vh, 0.9rem);
    font-style: italic;
    margin-top: clamp(5px, 1vh, 10px);
    margin-bottom: clamp(10px, 1.5vh, 15px);
}

/* ===== Virtual Numpad ===== */
.virtual-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 1.2vh, 12px);
    max-width: clamp(280px, 35vw, 350px);
    margin: 0 auto;
    padding: clamp(12px, 2vh, 20px);
    background: #f5f5f5;
    border-radius: 15px;
    border: 3px solid #B8860B;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.numpad-btn {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: clamp(12px, 2vh, 20px);
    font-size: clamp(1.5rem, 3vh, 2rem);
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    min-height: clamp(55px, 8vh, 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.numpad-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(184, 134, 11, 0.6);
    border-color: #FFD700;
}

.numpad-btn:active {
    transform: scale(0.95);
}

.numpad-btn-clear {
    background: linear-gradient(135deg, #5a1616 0%, #3a0f0f 100%);
    border-color: #f44336;
}

.numpad-btn-clear:hover {
    box-shadow: 0 6px 15px rgba(244, 67, 54, 0.6);
    border-color: #f44336;
}

.numpad-btn-enter {
    background: linear-gradient(135deg, #2d5016 0%, #1f3a10 100%);
    border-color: #4CAF50;
}

.numpad-btn-enter:hover {
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.6);
    border-color: #4CAF50;
}

.numpad-btn i {
    font-size: clamp(1.5rem, 3vh, 2rem);
}

/* ===== Modal Footer ===== */
.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    min-width: 150px;
    justify-content: center;
}

.modal-button i {
    font-size: 1.4rem;
}

.modal-button-primary {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 3px solid #FFD700;
    color: #ffffff;
}

.modal-button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(184, 134, 11, 0.6);
    border-color: #FFD700;
}

.modal-button-secondary {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 3px solid #666;
    color: #ffffff;
}

.modal-button-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(100, 100, 100, 0.6);
    border-color: #888;
}

.modal-button:active {
    transform: translateY(-1px);
}

/* ===== Card Registration Status ===== */
.card-reg-status {
    background: #f5f5f5;
    border: 3px solid #B8860B;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 80px;
    transition: all 0.3s ease;
}

.card-reg-status i {
    font-size: 2.5rem;
    color: #B8860B;
}

.card-reg-status p {
    font-size: 1.3rem;
    color: #000000;
    text-align: center;
    margin: 0;
}

/* Card detected animation */
.card-reg-status.card-detected {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4CAF50;
    animation: cardDetectedPulse 0.6s ease-in-out;
}

.card-reg-status.card-detected i {
    color: #4CAF50;
}

.card-reg-status.card-detected p {
    color: #2d7a2f;
}

@keyframes cardDetectedPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 20px 10px rgba(76, 175, 80, 0);
    }
}

/* Card error animation */
.card-reg-status.card-error {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    animation: shake 0.5s ease-in-out;
}

.card-reg-status.card-error i {
    color: #f44336;
}

.card-reg-status.card-error p {
    color: #c62828;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===== Card Check Section ===== */
.card-check-section {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f2ff 100%);
    border: 3px solid #2196F3;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card-check-button {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border: 3px solid #64B5F6;
    border-radius: 12px;
    padding: 15px 40px;
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
    min-width: 250px;
    justify-content: center;
}

.card-check-button i {
    font-size: 1.8rem;
    color: #ffffff;
}

.card-check-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.6);
    border-color: #90CAF9;
}

.card-check-button:active {
    transform: translateY(-1px) scale(1.02);
}

.card-check-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.card-check-hint {
    font-size: 1rem;
    color: #1976D2;
    font-weight: bold;
    text-align: center;
    margin: 0;
}

/* ===== Staff List Container ===== */
.staff-list-container {
    background: #ffffff;
    border: 2px solid #d0d0d0;
    border-radius: 15px;
    padding: 20px;
}

.staff-search {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    border: 3px solid #B8860B;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.staff-search i {
    font-size: 1.8rem;
    color: #B8860B;
}

.staff-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000000;
    background: transparent;
    cursor: text; /* Show text cursor for input */
}

.staff-search input::placeholder {
    color: #999;
    font-weight: normal;
}

/* ===== Staff List ===== */
.staff-list {
    max-height: calc(90vh - 200px); /* Fit within modal, leave space for header and padding */
    overflow-y: auto; /* Scrollbar only on staff list */
    overflow-x: hidden; /* No horizontal scrollbar */
    padding-right: 10px; /* Space for scrollbar */
}

.loading-spinner, .error-message, .empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner i, .error-message i, .empty-message i {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    color: #B8860B;
}

.error-message {
    color: #f44336;
}

.error-message i {
    color: #f44336;
}

/* ===== Staff Item ===== */
.staff-item {
    background: #f9f9f9;
    border: 3px solid #B8860B;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.staff-item:hover {
    border-color: #FFD700;
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.4);
    transform: translateY(-2px);
}

.staff-item.has-card {
    border-color: #4CAF50;
    background: #f0f8f0;
}

.staff-info {
    flex: 1;
}

.staff-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000000;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-name i {
    font-size: 1.8rem;
    color: #B8860B;
}

.staff-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.staff-details span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    color: #666;
}

.staff-details span i {
    color: #B8860B;
    font-size: 1.1rem;
}

/* ===== Card Badges ===== */
.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    margin-top: 8px;
}

.card-registered {
    background: rgba(76, 175, 80, 0.15);
    border: 2px solid #4CAF50;
    color: #2d7a2f;
}

.card-registered i {
    color: #4CAF50;
    font-size: 1.1rem;
}

.card-pending {
    background: rgba(244, 67, 54, 0.15);
    border: 2px solid #f44336;
    color: #c62828;
}

.card-pending i {
    color: #f44336;
    font-size: 1.1rem;
}

/* ===== Staff Select Button ===== */
.staff-select-btn {
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
    min-width: 150px;
    justify-content: center;
}

.staff-select-btn i {
    font-size: 1.4rem;
}

.btn-register {
    background: linear-gradient(135deg, #B8860B 0%, #9a7209 100%);
    border: 3px solid #FFD700;
    color: #ffffff;
}

.btn-register:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.6);
}

.btn-update {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border: 3px solid #999;
    color: #ffffff;
}

.btn-update:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(100, 100, 100, 0.6);
    border-color: #B8860B;
}

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

/* ===== Responsive Modal & Staff List ===== */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-header i {
        font-size: 2.5rem;
    }

    .modal-button {
        padding: 12px 20px;
        font-size: 1rem;
        min-width: 120px;
    }

    /* Stack PIN modal to 1 column on mobile */
    .modal-body-2col {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pin-column {
        padding: 10px;
    }

    .pin-input {
        width: 180px;
        font-size: 2.5rem;
        padding: 20px;
    }

    .virtual-numpad {
        max-width: 300px;
        gap: 10px;
        padding: 15px;
    }

    .numpad-btn {
        padding: 15px;
        font-size: 1.5rem;
        min-height: 60px;
    }

    .numpad-btn i {
        font-size: 1.5rem;
    }

    .staff-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .staff-select-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1.1rem;
    }

    .staff-name {
        font-size: 1.3rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-button {
        width: 100%;
    }

    /* Stack card registration modal to 1 column on mobile */
    .modal-body-card-reg {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .action-column {
        gap: 15px;
    }
}

/* ===== Admin Cursor Override ===== */
/* Enable cursor for admin users accessing kiosk page */
body.admin-cursor,
body.admin-cursor *,
body.admin-cursor html,
body.admin-cursor body {
    cursor: auto !important;
}

/* Restore pointer cursor for clickable elements when admin */
body.admin-cursor button,
body.admin-cursor a,
body.admin-cursor .printer-clickable,
body.admin-cursor .status-item,
body.admin-cursor .menu-option,
body.admin-cursor .level2-option,
body.admin-cursor .label-item,
body.admin-cursor .history-item,
body.admin-cursor .close-button,
body.admin-cursor .modal-close,
body.admin-cursor .modal-button,
body.admin-cursor .reprint-btn,
body.admin-cursor .delete-history-btn {
    cursor: pointer !important;
}

/* Restore text cursor for input fields when admin */
body.admin-cursor input[type="text"],
body.admin-cursor input[type="password"],
body.admin-cursor input[type="number"],
body.admin-cursor textarea {
    cursor: text !important;
}

/* Restore not-allowed cursor for disabled elements when admin */
body.admin-cursor button:disabled,
body.admin-cursor .disabled {
    cursor: not-allowed !important;
}
