/* Global CSS Variables & Theme Definitions */
:root {
    /* Default: Light Theme variables */
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;

    /* Theme-specific text variables used in templates */
    --text-primary-light: #1e293b;
    --text-secondary-light: #475569;
    --text-muted-light: #64748b;

    /* Dark constant variables */
    --bg-dark: #0b0f19;
    --bg-card-dark: #111827;
    --border-dark: rgba(255, 255, 255, 0.08);

    /* Premium Yellow & Gold Palette */
    --primary: #fcd116;
    --primary-hover: #d97706;
    --primary-glow: rgba(252, 209, 22, 0.25);
    
    /* Accent Tones */
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --info: #06b6d4;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Dark Theme overrides */
html.dark-theme {
    --bg-base: #0b0f19;
    --bg-card: #111827;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.08);

    /* Theme-specific text variables used in templates */
    --text-primary-light: #f3f4f6;
    --text-secondary-light: #9ca3af;
    --text-muted-light: #9ca3af;
}

/* Reset and Core Layouts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Utility Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}

/* UI Elements & Controls */
input, select, textarea {
    font-family: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #0b0f19;
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: rgba(156, 163, 175, 0.25);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-warning {
    background: var(--warning);
    color: #ffffff;
}
.btn-warning:hover {
    background: var(--warning-hover);
}

.btn-icon {
    padding: 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Global Theme Toggle Switch Button styling */
.btn-theme-toggle {
    background: rgba(156, 163, 175, 0.15);
    border: none;
    border-radius: 7px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.btn-theme-toggle:hover {
    background: rgba(156, 163, 175, 0.25);
    color: var(--primary);
}

/* Form Styles */
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

/* Badge Indicators */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--info); }

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    font-weight: 700;
}

.table td {
    padding: 12px 16px;
    font-size: 0.875rem;
}

/* Modals System (Clean Glassmorphism Drawer) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Flash Messages */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--warning); }

/* Global Confirmation Modal styling */
.system-confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.system-confirm-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.system-confirm-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    overflow: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.system-confirm-modal-overlay.active .system-confirm-modal-content {
    transform: scale(1);
}
.system-confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.system-confirm-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.system-confirm-modal-header .modal-icon {
    font-size: 1.5rem;
}
.system-confirm-modal-header .modal-icon.danger-icon {
    color: var(--danger);
}
.system-confirm-modal-header .modal-icon.primary-icon {
    color: var(--primary);
}
.system-confirm-modal-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.system-confirm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

/* Autocomplete Dropdown list styling */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: none;
    margin-top: 4px;
}
.autocomplete-results.active {
    display: block;
}
.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover {
    background: rgba(22, 163, 74, 0.08);
}
.autocomplete-item strong {
    color: var(--text-primary);
}
.autocomplete-item span.meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Barcode Printing & Sticker Layout Styles (Phase 12)
   ========================================================================== */
.barcode-print-body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.barcode-print-header {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode-grid-30 {
    display: grid;
    grid-template-columns: repeat(3, 70mm);
    grid-auto-rows: 29.7mm;
    width: 210mm;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.barcode-grid-24 {
    display: grid;
    grid-template-columns: repeat(3, 70mm);
    grid-auto-rows: 37mm;
    width: 210mm;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.barcode-grid-single {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50mm;
    margin: 0 auto;
}

.barcode-item-sticker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cccccc;
    padding: 4px;
    box-sizing: border-box;
    text-align: center;
    background: #ffffff;
    color: #000000;
    overflow: hidden;
}

.sticker-store {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.sticker-name {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    max-height: 20px;
    overflow: hidden;
    margin-bottom: 2px;
}

.sticker-barcode {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 1px 0;
}

.sticker-barcode svg {
    max-width: 100%;
    height: auto;
}

.sticker-price {
    font-size: 11px;
    font-weight: 700;
    margin-top: 1px;
}

@media print {
    .no-print {
        display: none !important;
    }
    .barcode-item-sticker {
        border: none !important;
    }
    .barcode-grid-single .barcode-item-sticker {
        width: 50mm;
        height: 30mm;
        page-break-after: always;
        page-break-inside: avoid;
    }
    @page {
        margin: 0;
    }
}


/* ==========================================================================
   Clock-In / Attendance Status Styles (Phase 14)
   ========================================================================== */
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.pulse-dot {
  animation: pulse 1.8s infinite ease-in-out;
  display: inline-block;
  border-radius: 50%;
}



