:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Light Theme Tokens */
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --topbar-bg: #ffffff;
    --modal-bg: #ffffff;
    --subtle-bg: #f8fafc;
    --hover-bg: #f1f5f9;

    --card-border: #e2e8f0;
    --topbar-border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --input-border: #cbd5e1;

    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #475569;
    --sidebar-text-hover: #0f172a;
    --sidebar-hover: #f1f5f9;
    --sidebar-active-bg: #eff6ff;
    --sidebar-active-text: #2563eb;

    --input-bg: #ffffff;
    --input-text: #1e293b;
    --input-focus-border: #3b82f6;

    --table-th-bg: #f8fafc;
    --table-th-text: #475569;
    --table-td-text: #334155;
    --table-border: #e2e8f0;
    --table-row-hover: #fafbfd;

    --btn-sec-bg: #f1f5f9;
    --btn-sec-text: #334155;
    --btn-sec-border: #cbd5e1;
    --btn-sec-hover: #e2e8f0;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;

    /* Dark Theme Tokens - Sleek Slate/Charcoal SaaS aesthetic */
    --body-bg: #090d16;
    --card-bg: #111827;
    --topbar-bg: #111827;
    --modal-bg: #111827;
    --subtle-bg: #162032;
    --hover-bg: #1e293b;

    --card-border: #1e293b;
    --topbar-border: #1e293b;
    --border-subtle: #1e293b;
    --input-border: #334155;

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --sidebar-bg: #111827;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-hover: #1e293b;
    --sidebar-active-bg: #1e3a8a40;
    --sidebar-active-text: #60a5fa;

    --input-bg: #162032;
    --input-text: #f8fafc;
    --input-focus-border: #60a5fa;

    --table-th-bg: #162032;
    --table-th-text: #94a3b8;
    --table-td-text: #cbd5e1;
    --table-border: #1e293b;
    --table-row-hover: #182236;

    --btn-sec-bg: #1e293b;
    --btn-sec-text: #e2e8f0;
    --btn-sec-border: #334155;
    --btn-sec-hover: #293548;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    min-height: 100vh;
}

/* Smooth Theme Transitions */
body, .sidebar, .top-navbar, .card, .kpi-card, .data-table th, .data-table td, 
.form-control, .modal-card, .btn-secondary, .btn-theme-toggle, .btn-quick-switch {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* App Shell (Admin) */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (Theme-Aware: White in Light Mode, Slate in Dark Mode) */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--sidebar-border);
    min-height: 100vh;
    transition: margin-left 0.25s ease-in-out, background-color 0.2s ease, border-color 0.2s ease;
    z-index: 100;
}

/* Desktop Collapsed Sidebar State */
body.sidebar-collapsed .sidebar,
html.sidebar-collapsed body .sidebar {
    margin-left: -260px;
}

.sidebar-brand {
    padding: 18px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    color: #fff;
    text-decoration: none;
}

.brand-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand-pill {
    font-size: 9.5px;
    font-weight: 700;
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border: 1px solid var(--sidebar-border);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.user-profile-widget {
    padding: 12px 14px;
    margin: 14px 12px 6px;
    border-radius: 10px;
    background: var(--subtle-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--sidebar-active-bg);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--sidebar-active-text);
    flex-shrink: 0;
}

.user-info {
    flex-grow: 1;
    margin-left: 10px;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.user-role-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    text-transform: uppercase;
}

.badge-super { background: #fee2e2; color: #991b1b; }
.badge-exhib { background: #e0e7ff; color: #3730a3; }
.badge-sec { background: #fce7f3; color: #9d174d; }
.badge-stall { background: #d1fae5; color: #065f46; }

.nav-menu {
    list-style: none;
    padding: 10px 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-category {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 14px 18px 6px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 2px 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-hover);
}

.nav-link:hover .nav-icon {
    color: var(--primary);
}

.nav-link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    font-weight: 600;
    box-shadow: none;
}

.nav-link.active .nav-icon {
    color: var(--sidebar-active-text);
}

.nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

/* Sidebar Submenu */
.nav-submenu {
    list-style: none;
    padding: 4px 0 6px 14px;
    margin: 2px 10px 4px 28px;
    display: none;
    flex-direction: column;
    gap: 2px;
    border-left: 2px solid var(--border-color, #e2e8f0);
}

.nav-item.open > .nav-submenu {
    display: flex;
}

.nav-link-parent {
    position: relative;
    cursor: pointer;
}

.nav-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: var(--sidebar-text, #64748b);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.nav-sublink:hover {
    color: var(--primary, #2563eb);
    background: var(--sidebar-hover, #f1f5f9);
}

.nav-sublink.active {
    color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.08);
    font-weight: 600;
}

.nav-sublink .sublink-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.nav-sublink.active .sublink-dot {
    opacity: 1;
    background: var(--primary, #2563eb);
}

.submenu-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.25s ease;
    color: var(--text-muted, #94a3b8);
}

.nav-item.open .submenu-arrow {
    transform: rotate(180deg);
}

/* Main Workspace Content */
.workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--body-bg);
}

.top-navbar {
    min-height: 65px;
    height: auto;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    flex-shrink: 0;
    gap: 12px;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-theme-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-main);
    border-color: var(--input-border);
}

.theme-icon-sun {
    display: none;
    color: #f59e0b;
}

.theme-icon-moon {
    display: inline-block;
    color: #64748b;
}

[data-theme="dark"] .theme-icon-sun {
    display: inline-block;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

.btn-quick-switch {
    background: var(--subtle-bg);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-quick-switch:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.btn-logout {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: #fecaca;
}

/* Views Container */
.view-content {
    padding: 30px;
    flex-grow: 1;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.kpi-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.kpi-sub {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    margin-top: 8px;
}

/* Section Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--table-th-bg);
    color: var(--table-th-text);
    font-weight: 700;
    border-bottom: 1px solid var(--table-border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--table-td-text);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--table-row-hover);
}

/* Badges & Status */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-visitor { background: #dbeafe; color: #1e40af; }
.badge-delegate { background: #fef3c7; color: #92400e; }
.badge-vip { background: #fce7f3; color: #9d174d; }
.badge-printed { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fee2e2; color: #991b1b; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: none;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}
.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--btn-sec-bg);
    color: var(--btn-sec-text);
    border: 1px solid var(--btn-sec-border);
}
.btn-secondary:hover {
    background: var(--btn-sec-hover);
    color: var(--text-main);
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}
.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--input-text);
    background: var(--input-bg);
    transition: border-color 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Form Builder Elements */
.fb-question-item {
    background: var(--subtle-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.fb-handle {
    font-size: 18px;
    color: var(--text-muted);
    cursor: move;
    margin-top: 6px;
}

.fb-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 60px;
    gap: 14px;
    flex-grow: 1;
    align-items: center;
}

.fb-options-container {
    grid-column: 1 / -1;
    margin-top: 10px;
    background: var(--card-bg);
    padding: 12px;
    border-radius: 6px;
    border: 1px dashed var(--input-border);
}

.btn-delete-q {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modals */
.modal-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    padding: 20px;
}

.modal-dialog-card {
    background: var(--modal-bg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-dialog-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 14px 14px 0 0;
}

.modal-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.btn-modal-close:hover { color: var(--text-main); }

.modal-dialog-body {
    padding: 22px 24px;
}

.modal-dialog-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--subtle-bg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 14px 14px;
}

/* Modal Card Structure (Flex pinned header/footer) */
.modal-card {
    background: var(--modal-bg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    animation: modalFadeIn 0.2s ease-out;
}

.modal-card > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.modal-close:hover { 
    color: var(--text-main); 
    background: var(--hover-bg);
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-subtle);
    background: var(--subtle-bg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 14px 14px;
    flex-shrink: 0;
}

/* Badge Preview Card */
.badge-preview-card {
    width: 320px;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.badge-type-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

/* Scanner Layout */
.scanner-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .scanner-layout {
        grid-template-columns: 1fr;
    }
}

.scanner-camera-box {
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

#qrReaderVideo {
    width: 100% !important;
    border-radius: 12px;
}

.status-alert-box {
    border-radius: 14px;
    padding: 25px;
    text-align: center;
    border: 2px solid transparent;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.status-valid {
    background: #f0fdf4;
    border-color: #10b981;
    color: #166534;
}

.status-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.status-neutral {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.status-big-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
}

.status-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* Mobile Layout Styles */
.mobile-app-wrapper {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
}

.mobile-header {
    background: #0f172a;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-content {
    flex-grow: 1;
    padding: 18px;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 18px;
    border-radius: 8px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.25s ease-out;
    max-width: 380px;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-info { background: #3b82f6; }

/* Impersonation Sticky Banner */
.impersonation-bar {
    background: linear-gradient(90deg, #d97706, #b45309);
    color: #ffffff;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(180, 83, 9, 0.3);
}

.impersonation-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-return-admin {
    background: #ffffff;
    color: #b45309;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-return-admin:hover {
    background: #fef3c7;
    color: #92400e;
    transform: translateY(-1px);
}

/* =========================================================
   SIDEBAR TOGGLE & RESPONSIVE DRAWER (Digiliance Pattern)
   ========================================================= */

/* Toggle Button (Visible on Desktop & Mobile) */
.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 15px;
    cursor: pointer;
    margin-right: 14px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar-toggle-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Desktop defaults */
.btn-sidebar-close {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

/* Tablet & Mobile Screens */
@media (max-width: 992px) {
    .app-wrapper {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    /* Off-canvas mobile sidebar drawer */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 1050 !important;
        background-color: #ffffff !important;
        transform: translateX(-100%) !important;
        margin-left: 0 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        border-right: 1px solid #e2e8f0 !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    }

    .sidebar-brand {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 16px 18px !important;
    }

    .btn-sidebar-close {
        display: flex !important;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        color: #64748b;
        font-size: 14px;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        line-height: 1;
        transition: all 0.15s ease;
    }
    .btn-sidebar-close:hover {
        color: #0f172a;
        background: #e2e8f0;
    }

    /* Mobile Backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.show {
        display: block !important;
        opacity: 1 !important;
    }

    /* Workspace */
    .workspace {
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .top-navbar {
        padding: 10px 14px !important;
        min-height: 54px !important;
        height: auto !important;
    }

    .page-title {
        font-size: 15px !important;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .top-actions {
        gap: 6px !important;
    }

    .top-actions .btn-logout {
        padding: 5px 9px !important;
        font-size: 11.5px !important;
    }

    /* Impersonation Banner on Mobile */
    .impersonation-bar {
        padding: 8px 12px !important;
        font-size: 11.5px !important;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Content Area */
    .view-content {
        padding: 14px 12px !important;
    }

    /* Dashboard Header */
    .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }
    .dashboard-header > div:last-child {
        display: flex;
        width: 100%;
    }
    .dashboard-header .btn {
        flex: 1;
        justify-content: center;
    }

    /* KPI Grid on Mobile */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }

    .kpi-card {
        padding: 12px 14px !important;
        border-radius: 10px !important;
    }

    .kpi-title {
        font-size: 11px !important;
    }

    .kpi-val {
        font-size: 20px !important;
    }

    .kpi-sub {
        font-size: 10px !important;
    }

    /* Filter Toolbars */
    .card-body .form-control {
        min-width: 100% !important;
    }

    /* Tables */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 650px !important;
    }

    .data-table th, .data-table td {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    /* Modals on Mobile */
    .modal-dialog-overlay {
        padding: 10px !important;
    }

    .modal-card {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 96vh !important;
        border-radius: 12px !important;
    }

    .modal-header {
        padding: 12px 16px !important;
    }

    .modal-body {
        padding: 14px !important;
    }

    .modal-footer {
        padding: 12px 16px !important;
    }

    .modal-body [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

@media (max-width: 540px) {
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .page-title {
        max-width: 130px !important;
        font-size: 14px !important;
    }
}

/* =========================================================
   DARK THEME PRECISION OVERRIDES & UTILITIES
   ========================================================= */

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-main) !important;
}

[data-theme="dark"] [style*="color: #0f172a"] {
    color: var(--text-main) !important;
}

[data-theme="dark"] [style*="color: #1e293b"] {
    color: var(--text-main) !important;
}

[data-theme="dark"] [style*="color: #334155"] {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="color: #475569"] {
    color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="color: #64748b"] {
    color: var(--text-muted) !important;
}

/* Vibrancy adaptations for dark mode */
[data-theme="dark"] [style*="color: #059669"] {
    color: #34d399 !important;
}
[data-theme="dark"] [style*="border-color: #a7f3d0"] {
    border-color: #065f46 !important;
}
[data-theme="dark"] [style*="color: #0284c7"] {
    color: #38bdf8 !important;
}
[data-theme="dark"] [style*="color: #7c3aed"] {
    color: #a78bfa !important;
}
[data-theme="dark"] [style*="color: #d97706"] {
    color: #fbbf24 !important;
}
[data-theme="dark"] [style*="color: #db2777"] {
    color: #f472b6 !important;
}
[data-theme="dark"] [style*="color: #4f46e5"] {
    color: #818cf8 !important;
}

/* Background containers */
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background-color: #ffffff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background-color: #fff"] {
    background: var(--card-bg) !important;
}

[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background-color: #f8fafc"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background-color: #f1f5f9"] {
    background: var(--subtle-bg) !important;
    border-color: var(--card-border) !important;
}

[data-theme="dark"] [style*="background: #edf2f7"],
[data-theme="dark"] [style*="background-color: #edf2f7"] {
    background: #182236 !important;
    color: var(--text-muted) !important;
    border-color: var(--card-border) !important;
}

/* Session Flash Alerts */
[data-theme="dark"] [style*="background: #d1fae5"] {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] [style*="background: #fee2e2"] {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border-color: #ef4444 !important;
}

/* Borders */
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-color: #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #cbd5e1"],
[data-theme="dark"] [style*="border-color: #cbd5e1"],
[data-theme="dark"] [style*="border-top: 1px dashed #e2e8f0"],
[data-theme="dark"] [style*="border-top: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-bottom: 1px solid #e2e8f0"] {
    border-color: var(--card-border) !important;
}

/* Code tags */
[data-theme="dark"] code {
    background: #182236 !important;
    color: #93c5fd !important;
    border: 1px solid #23314d;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Progress bar background tracks in dashboard breakdown */
[data-theme="dark"] [style*="background: #e0f2fe"] {
    background: #162032 !important;
}
[data-theme="dark"] [style*="background: #ede9fe"] {
    background: #162032 !important;
}

/* User avatar initials in users table */
[data-theme="dark"] [style*="background: #0f172a"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Inputs, Textareas, Placeholders */
[data-theme="dark"] input[readonly] {
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #64748b !important;
}

/* Dropdown option styling */
[data-theme="dark"] select.form-control option {
    background-color: #111827;
    color: #f8fafc;
}

/* Form Builder Items */
[data-theme="dark"] .btn-delete-q {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] .btn-delete-q:hover {
    background: rgba(239, 68, 68, 0.35) !important;
}

/* Badges in Dark Mode */
[data-theme="dark"] .badge-super { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
[data-theme="dark"] .badge-exhib { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
[data-theme="dark"] .badge-sec { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
[data-theme="dark"] .badge-stall { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
[data-theme="dark"] .badge-active { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
[data-theme="dark"] .badge-inactive { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
[data-theme="dark"] .badge-visitor { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
[data-theme="dark"] .badge-delegate { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
[data-theme="dark"] .badge-vip { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }

/* Impersonation Banner */
[data-theme="dark"] .impersonation-bar {
    background: #451a03;
    border-bottom: 1px solid #78350f;
    color: #fde68a;
}
[data-theme="dark"] .btn-return-admin {
    background: #78350f;
    color: #fef3c7;
}
[data-theme="dark"] .btn-return-admin:hover {
    background: #92400e;
    color: #ffffff;
}

/* Logout Button */
[data-theme="dark"] .btn-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
[data-theme="dark"] .btn-logout:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* Multi-Exhibition Guard Checkbox List */
[data-theme="dark"] #exhibitionsCheckboxList label {
    background: var(--card-bg) !important;
    border-color: var(--card-border) !important;
}
[data-theme="dark"] #exhibitionsCheckboxList label:hover {
    background: var(--hover-bg) !important;
}

/* Scrollbars in Dark Mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #090d16;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* =========================================================
   TOGGLE SWITCH COMPONENT
   ========================================================= */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.4;
    cursor: not-allowed;
}

[data-theme="dark"] .toggle-slider {
    background-color: #334155;
}

[data-theme="dark"] .toggle-switch input:checked + .toggle-slider {
    background-color: #059669;
}

/* ==========================================================================
   Table Pagination & Size Controls (DataTables Standard)
   ========================================================================== */
.table-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.table-pagination-info {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.table-pagination-info strong {
    color: var(--text-main);
    font-weight: 700;
}

.table-pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-page {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

.btn-page:hover:not(.disabled):not(.active) {
    background: var(--hover-bg);
    color: var(--text-main);
    border-color: var(--input-border);
}

.btn-page.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    cursor: default;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
}

.btn-page.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}


.page-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 12px;
    user-select: none;
}

/* ==========================================================================
   Table Sorting Indicators (DataTables Standard)
   ========================================================================== */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.data-table th.sortable:hover {
    background-color: var(--hover-bg, rgba(0, 0, 0, 0.04));
    color: var(--primary, #2563eb);
}

.data-table th.sortable .sort-icon-wrapper {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    vertical-align: middle;
}

.data-table th.sortable .sort-icon {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    opacity: 0.35;
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.data-table th.sortable:hover .sort-icon {
    opacity: 0.8;
}

.data-table th.sortable.sort-asc,
.data-table th.sortable.sort-desc {
    color: var(--primary, #2563eb) !important;
}

.data-table th.sortable.sort-asc .sort-icon,
.data-table th.sortable.sort-desc .sort-icon {
    opacity: 1 !important;
    color: var(--primary, #2563eb) !important;
}

[data-theme="dark"] .data-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .data-table th.sortable.sort-asc,
[data-theme="dark"] .data-table th.sortable.sort-desc {
    color: #60a5fa !important;
}

[data-theme="dark"] .data-table th.sortable.sort-asc .sort-icon,
[data-theme="dark"] .data-table th.sortable.sort-desc .sort-icon {
    color: #60a5fa !important;
}

/* ==========================================================================
   EventFlow Multi-Select Component Styling
   ========================================================================== */
.ef-multiselect-wrapper {
    position: relative;
    width: 100%;
}

.ef-multiselect-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 12px;
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--input-border, #cbd5e1);
    border-radius: 6px;
    font-size: 13px;
    color: var(--input-text, #1e293b);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ef-multiselect-btn:hover {
    border-color: var(--primary, #2563eb);
}

.ef-multiselect-btn:focus,
.ef-multiselect-btn[aria-expanded="true"] {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ef-multiselect-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

.ef-multiselect-label.has-value {
    color: var(--text-main, #0f172a);
    font-weight: 600;
}

.ef-multiselect-trailing {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
}

.ef-multiselect-badge {
    background: var(--primary, #2563eb);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    line-height: 1;
}

.ef-multiselect-arrow {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    transition: transform 0.2s ease;
}

.ef-multiselect-arrow.open {
    transform: rotate(180deg);
}

.ef-multiselect-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    padding: 8px;
}

.ef-multiselect-search-box {
    position: relative;
    margin-bottom: 6px;
}

.ef-multiselect-search-box .ef-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-muted, #64748b);
}

.ef-multiselect-search-input {
    width: 100%;
    height: 32px;
    padding-left: 28px;
    padding-right: 10px;
    background: var(--subtle-bg, #f8fafc);
    border: 1px solid var(--input-border, #cbd5e1);
    border-radius: 5px;
    font-size: 12px;
    color: var(--input-text, #1e293b);
}

.ef-multiselect-search-input:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    background: var(--input-bg, #ffffff);
}

.ef-multiselect-actions {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px 8px 6px;
    border-bottom: 1px solid var(--border-subtle, #f1f5f9);
    margin-bottom: 6px;
}

.ef-action-btn {
    background: none;
    border: none;
    color: var(--primary, #2563eb);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.ef-action-btn:hover {
    text-decoration: underline;
}

.ef-multiselect-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ef-multiselect-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease;
    margin: 0;
}

.ef-multiselect-item:hover {
    background-color: var(--hover-bg, #f1f5f9);
}

.ef-multiselect-item.selected {
    background-color: var(--sidebar-active-bg, #eff6ff);
}

.ef-multiselect-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--primary, #2563eb);
}

.ef-item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ef-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ef-item-subtext {
    font-size: 10.5px;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ef-multiselect-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
}

/* ==========================================================================
   Print Styles — Badge Printer
   Only the #printableBadgeBox badge card is printed.
   Everything else (sidebar, navbar, tables, modal chrome) is hidden.
   ========================================================================== */
@media print {
    /* Hide the entire app shell */
    .sidebar,
    .sidebar-backdrop,
    .top-navbar,
    .read-only-banner,
    .impersonation-bar,
    .view-content > .card,
    #toast-container,
    .nav-menu,
    .sidebar-brand,
    .user-profile-widget {
        display: none !important;
    }

    /* Hide modal overlay/chrome but keep the badge card visible */
    .modal-dialog-overlay {
        position: static !important;
        background: none !important;
        display: block !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .modal-dialog-card {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .modal-dialog-header,
    .modal-dialog-footer {
        display: none !important;
    }

    .modal-dialog-body {
        padding: 0 !important;
    }

    /* Only show the badge print modal, hide all other modals */
    .modal-dialog-overlay:not(#badgePrintModal) {
        display: none !important;
    }

    /* The badge card itself — centered on page */
    #printableBadgeBox {
        display: block !important;
        width: 85mm;
        min-height: 120mm;
        margin: 0 auto;
        padding: 20px;
        border: 2px solid #1e293b !important;
        border-radius: 12px;
        background: #ffffff !important;
        page-break-inside: avoid;
        text-align: center;
    }

    /* Ensure QR code prints clearly */
    #printableBadgeBox img {
        max-width: 170px;
        height: auto;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Ensure tier tag colors print */
    .badge-type-tag,
    #badgeTierTag {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Reset workspace layout so badge isn't clipped */
    .app-wrapper,
    .workspace {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    body {
        margin: 0;
        padding: 0;
        background: #fff !important;
    }

    /* Force single page */
    @page {
        size: auto;
        margin: 10mm;
    }
}
