@import url('../fonts/vazirmatn/vazirmatn.css');

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-subtle: #eff6ff;
    --success: #059669;
    --success-light: #10b981;
    --success-subtle: #ecfdf5;
    --warning: #d97706;
    --warning-subtle: #fffbeb;
    --danger: #dc2626;
    --danger-subtle: #fef2f2;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: #3b82f6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, Tahoma, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: "ss01", "tnum";
}

/* Persian Digits Utility */
.persian-digits, .stat-value, .clock-display, table, .badge {
    font-feature-settings: "ss01", "tnum";
}

/* Floating Header Bar (Aligned with Cards Below) */
.header-outer-wrapper {
    max-width: 1440px;
    margin: 1.25rem auto 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 0.85rem 2.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    width: 100%;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.logo-icon img {
    height: 68px;
    width: auto;
    display: block;
}

.logo-title h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-title .sub-title {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* Live Header Center: Digital Clock & Date */
.header-clock-widget {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.clock-display {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffffff;
    font-family: 'Vazirmatn', monospace;
    min-width: 90px;
    text-align: center;
}

.date-display {
    font-size: 0.82rem;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.3;
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #a7f3d0;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

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

.header-user-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.95rem;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #ffffff;
    font-weight: 600;
}

.btn-header-logout {
    color: #fca5a5;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    transition: all 0.2s ease;
}

.btn-header-logout:hover {
    background: rgba(220, 38, 38, 0.3);
    color: #ffffff;
}

/* App Two-Column Layout with Floating Right Sidebar */
.app-container {
    display: flex;
    gap: 1.5rem;
    max-width: 1440px;
    margin: 1.5rem auto;
    padding: 0 1.5rem 2rem 1.5rem;
    width: 100%;
    align-items: flex-start;
}

.app-container.no-sidebar {
    max-width: 500px;
    margin: 2.5rem auto;
    justify-content: center;
}

/* Floating Right Sidebar */
.floating-sidebar {
    width: 250px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    padding: 1.25rem 1rem;
    position: sticky;
    top: 6.8rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100vh - 9rem);
    gap: 1.25rem;
}

/* Guard Profile Card in Sidebar */
.sidebar-guard-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.guard-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
}

.guard-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.22);
}

.guard-info {
    flex: 1;
    min-width: 0;
}

.guard-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guard-role {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.btn-sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    margin-top: 0.6rem;
    transition: all 0.15s ease;
}

.btn-sidebar-logout:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    transform: translateY(-1px);
}

.sidebar-section-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 0 0.5rem 0.25rem 0.5rem;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    background-color: #f8fafc;
    color: #1e293b;
    border-color: #e2e8f0;
    transform: translateX(-3px);
}

.sidebar-nav a.active {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 800;
    border-color: #bfdbfe;
    border-inline-start: 4px solid #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.06);
}

.sidebar-nav .nav-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: color 0.15s ease;
}

.sidebar-nav a:hover .nav-icon {
    color: #1e293b;
}

.sidebar-nav a.active .nav-icon {
    color: #2563eb;
}

.sidebar-divider {
    height: 1px;
    background-color: #f1f5f9;
    margin: 0.5rem 0;
}

/* Main Content in App Layout */
.app-main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0;
}

/* Main Layout (Fallback) */
main {
    flex: 1;
    width: 100%;
}

@media (max-width: 900px) {
    header {
        margin: 0.5rem;
        padding: 0.75rem 1rem;
        border-radius: 14px;
        flex-direction: column;
        gap: 0.75rem;
    }
    .app-container {
        flex-direction: column;
        padding: 0 0.5rem 2rem 0.5rem;
        gap: 1rem;
    }
    .floating-sidebar {
        width: 100%;
        position: static;
        padding: 0.75rem;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
    .sidebar-nav a {
        white-space: nowrap;
    }
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--primary-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

/* Modern Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) 280px;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-box.success {
    border-top-color: var(--success);
}

.stat-box.warning {
    border-top-color: #f59e0b !important;
    background: #fffdf5;
}

.stat-box.warning .stat-label {
    color: #b45309;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.4rem 0;
    line-height: 1;
}

.stat-box.success .stat-value {
    color: var(--success);
}

.stat-box.warning .stat-value {
    color: #d97706 !important;
}

.stat-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stat-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Form Styles & Firefox RTL Compatibility */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

input, select, textarea {
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background-color: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-feature-settings: "ss01", "tnum";
}

input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Firefox Option Padding Rule (from rtl-web-applications skill) */
select option {
    padding: 8px 14px;
    padding-inline-start: 14px;
}

/* Buttons */
.btn {
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

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

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

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

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

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

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

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Search Box */
.search-input-wrapper {
    position: relative;
    max-width: 320px;
}

.search-input-wrapper input {
    width: 100%;
    padding-inline-start: 2rem;
}

.search-icon {
    position: absolute;
    inset-inline-start: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.85rem 1.1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
    font-weight: 700;
    color: #475569;
    font-size: 0.82rem;
}

tr:hover {
    background-color: #f8fafc;
}

tr.overstay-row {
    background-color: #fffbeb !important;
}

tr.overstay-row:hover {
    background-color: #fef3c7 !important;
}

/* Visitor Table Avatar Thumbnail */
.visitor-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    display: block;
    background-color: #f1f5f9;
}

.visitor-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid #cbd5e1;
}

/* Modern Dashboard Design System (Matching Requested Mockup) */
.dashboard-main-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1.75rem;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.dashboard-title-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.pill-count {
    background: #ede9fe;
    color: #6366f1;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pill-live {
    background: transparent;
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: pulse 2s infinite;
}

.search-bar-modern {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.45rem 0.85rem;
    width: 280px;
    gap: 0.6rem;
    transition: all 0.2s;
}

.search-bar-modern:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}

.search-bar-modern input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 0.82rem;
    flex: 1;
    padding: 0 !important;
    color: #1e293b;
}

.search-shortcut-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.7rem;
    color: #94a3b8;
    font-family: monospace;
    line-height: 1;
}

.btn-refresh-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.95rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-refresh-modern:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern th {
    padding: 0.85rem 1rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.table-modern td {
    padding: 1.1rem 1rem;
    text-align: right;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}

.table-modern tr:hover td {
    background-color: #fafbfc;
}

.table-modern tr:last-child td {
    border-bottom: none;
}

.visitor-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.avatar-squircle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.avatar-squircle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.avatar-grad-1 {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.22);
}

.avatar-grad-2 {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.22);
}

.avatar-grad-3 {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.22);
}

.avatar-grad-4 {
    background: linear-gradient(135deg, #ec4899 0%, #e11d48 100%);
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.22);
}

.dept-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}

.dept-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #818cf8;
}

.status-present-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #ecfdf5;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #059669;
    border: 1px solid #d1fae5;
}

.status-overstay-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #fffbeb;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #d97706;
    border: 1px solid #fde68a;
}

.status-dot-inner {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.status-overstay-pill .status-dot-inner {
    background: #f59e0b;
}

.btn-exit-sleek {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #e11d48;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-exit-sleek:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

.btn-print-sleek {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-print-sleek:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.dashboard-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 0.5rem;
}

.dashboard-footer-meta {
    font-size: 0.78rem;
    color: #94a3b8;
}

.dashboard-footer-link {
    color: #6366f1;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.dashboard-footer-link:hover {
    color: #4f46e5;
}

/* Delicate Action Buttons */
.btn-delicate-exit {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-delicate-exit:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.btn-icon-print {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-icon-print:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

/* Badges */
.badge {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-success {
    background-color: var(--success-subtle);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.badge-warning {
    background-color: var(--warning-subtle);
    color: var(--warning);
    border: 1px solid #fde68a;
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Alerts */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background-color: var(--danger-subtle);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: var(--warning-subtle);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-success {
    background-color: var(--success-subtle);
    color: #065f46;
    border: 1px solid #86efac;
}

/* Camera Capture Box with Face Frame Overlay */
.camera-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    background: #f8fafc;
    position: relative;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Visual Face Target Guide */
.camera-face-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 75%;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
    display: none;
}

/* Thermal Receipt View */
.receipt-wrapper {
    max-width: 500px;
    margin: 1rem auto;
}

.thermal-receipt {
    max-width: 80mm;
    margin: 1rem auto;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
    color: #000000;
    box-shadow: var(--shadow-md);
}

@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }
    html, body {
        width: 80mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    body * {
        visibility: hidden !important;
    }
    .thermal-receipt, .thermal-receipt * {
        visibility: visible !important;
    }
    .thermal-receipt {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 72mm !important;
        max-width: 72mm !important;
        margin: 0 auto !important;
        padding: 2mm 2mm !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        font-size: 10pt;
        color: #000000 !important;
    }
    .thermal-receipt img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
    .no-print {
        display: none !important;
    }
}

/* ==========================================================================
   Universal Modal Dialogs (Pop-ups)
   ========================================================================== */
.checkout-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.checkout-modal-backdrop.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.checkout-modal-box {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-modal-backdrop.active .checkout-modal-box {
    transform: scale(1);
}

.checkout-modal-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.checkout-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkout-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.checkout-modal-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 3px;
}

.checkout-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}
