/* =============================================
   ABSENSI KARYAWAN — Design System
   Dark Mode + Glassmorphism + Modern UI
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.1);
    --border-glass-hover: rgba(255, 255, 255, 0.2);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #06b6d4;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --accent-gradient-2: linear-gradient(135deg, #8b5cf6, #ec4899);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.3);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

/* ── Layout ── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.nav-item.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-primary);
    border-color: rgba(6, 182, 212, 0.2);
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-glass);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    position: relative;
    z-index: 1;
    min-width: 0;
    width: calc(100vw - 260px);
}

/* ── Top Bar ── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.top-bar-left h1 {
    font-size: 28px;
    font-weight: 800;
}

.top-bar-left p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-clock {
    font-size: 32px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.live-date {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
}

/* ── Cards ── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-glass-hover);
}

.glass-card-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.cyan::before { background: var(--accent-gradient); }
.stat-card.purple::before { background: var(--accent-gradient-2); }
.stat-card.green::before { background: linear-gradient(135deg, #10b981, #06b6d4); }
.stat-card.orange::before { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card.cyan .stat-card-icon { background: rgba(6, 182, 212, 0.15); }
.stat-card.purple .stat-card-icon { background: rgba(139, 92, 246, 0.15); }
.stat-card.green .stat-card-icon { background: rgba(16, 185, 129, 0.15); }
.stat-card.orange .stat-card-icon { background: rgba(245, 158, 11, 0.15); }

.stat-card-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Table ── */
.table-wrapper {
    overflow-x: auto;
}

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

.data-table thead th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-glass);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    color: white;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control option {
    color: #111111;
    background-color: #ffffff;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

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

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
}

/* ── Scanner Page ── */
.scan-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.scan-header {
    text-align: center;
    margin-bottom: 32px;
}

.scan-header h1 {
    font-size: 32px;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.scan-container {
    display: flex;
    gap: 32px;
    width: 100%;
    max-width: 1100px;
    align-items: flex-start;
}

.scanner-wrapper {
    flex: 1;
    max-width: 520px;
}

.scanner-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.scanner-box.scanning {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.15);
}

.scanner-box.success {
    border-color: var(--success);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.2);
    animation: scanPulse 0.5s ease;
}

.scanner-box.error {
    border-color: var(--danger);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.2);
    animation: scanShake 0.4s ease;
}

@keyframes scanPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

@keyframes scanShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.scanner-video-area {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
    background: #000;
}

.scanner-video-area #reader {
    width: 100%;
    height: 100%;
}

.scanner-video-area #reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#reader {
    width: 100%;
    border: none !important;
}

#reader__scan_region {
    min-height: 300px;
}

#reader__scan_region video {
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

#reader__dashboard {
    padding: 12px !important;
}

#reader__dashboard_section_swaplink {
    display: none !important;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
    animation: scanLine 2.5s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes scanLine {
    0%, 100% { top: 10%; }
    50% { top: 85%; }
}

.scanner-status {
    padding: 16px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scanner-status .pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: pulse 1.5s ease infinite;
}

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

/* ── Scan Result Panel ── */
.scan-result-panel {
    flex: 1;
    max-width: 480px;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    transition: all var(--transition-normal);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-card.waiting {
    opacity: 0.6;
}

.result-card.show {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
}

.result-avatar.masuk {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.result-avatar.keluar {
    background: var(--info-bg);
    color: var(--info);
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.result-avatar.sudah {
    background: var(--warning-bg);
    color: var(--warning);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.result-avatar.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.result-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.result-code {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.result-status {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.result-time {
    font-size: 40px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-time-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.waiting-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.waiting-text {
    font-size: 16px;
    color: var(--text-muted);
}

/* ── Recent Scans ── */
.recent-scans {
    margin-top: 24px;
}

.recent-scans h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-scan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    animation: slideUp 0.3s ease;
}

.recent-scan-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--accent-gradient);
    color: white;
}

.recent-scan-info {
    flex: 1;
}

.recent-scan-name {
    font-size: 14px;
    font-weight: 600;
}

.recent-scan-time {
    font-size: 12px;
    color: var(--text-muted);
}

.recent-scan-badge {
    font-size: 11px;
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header-icon {
    width: 72px;
    height: 72px;
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.3);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 800;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

/* ── Barcode Print ── */
.barcode-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    color: #111;
    width: 300px;
}

.barcode-card .barcode-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111;
}

.barcode-card .barcode-dept {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.barcode-card .barcode-image {
    margin: 0 auto;
}

.barcode-card .barcode-code {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    font-family: monospace;
    color: #333;
}

/* ── Toasts / Notifications ── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    backdrop-filter: blur(20px);
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

.toast-icon {
    font-size: 22px;
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .scan-container {
        flex-direction: column;
        align-items: center;
    }
    .scanner-wrapper, .scan-result-panel {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }

    .hamburger {
        display: flex !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Hamburger ── */
.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Barcode print styles ── */
@media print {
    body * {
        visibility: hidden;
    }
    .barcode-print-area, .barcode-print-area * {
        visibility: visible;
    }
    .barcode-print-area {
        position: absolute;
        left: 0;
        top: 0;
    }
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar .form-control {
    width: auto;
    min-width: 180px;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-glass);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 6px;
}
