/* ============================================================
   BARCODE STUDIO — app.css
   Professional UI: modals, toasts, sidebar, cards, badges
   ============================================================ */

/* === Variables === */
:root {
    --bg: #071118;
    --panel: #0d1a24;
    --panel-soft: #122432;
    --panel-hover: #172d3f;
    --text: #e6edf3;
    --text-secondary: #b0bec8;
    --muted: #95a3b3;
    --accent: #29d391;
    --accent-2: #12a56f;
    --accent-dim: rgba(41, 211, 145, 0.12);
    --danger: #ea5c7a;
    --danger-dim: rgba(234, 92, 122, 0.12);
    --warning: #f59e0b;
    --info: #38bdf8;
    --border: #213444;
    --border-light: #2a3f52;
    --shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --transition: 0.18s ease;
    --sidebar-w: 260px;
    --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 12%, #1b3347 0%, rgba(27,51,71,0) 42%),
        radial-gradient(circle at 82% 6%, #153a3a 0%, rgba(21,58,58,0) 35%),
        linear-gradient(170deg, #050d14 10%, var(--bg) 60%);
    background-attachment: fixed;
    min-height: 100vh;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; line-height: 1.3; }
label { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 4px; }

/* === Form Elements === */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], select, textarea {
    font: inherit;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(8, 20, 29, 0.9);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(41, 211, 145, 0.12);
}
input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="color"] { width: 44px; height: 38px; padding: 3px; cursor: pointer; border-radius: 6px; }

.input-group { position: relative; }
.input-group input { padding-right: 42px; }
.input-group-btn {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--muted); cursor: pointer;
    padding: 5px 8px; border-radius: 6px; display: flex; align-items: center;
    transition: color var(--transition);
}
.input-group-btn:hover { color: var(--text); }

/* === Buttons === */
button, .btn { font: inherit; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: rgba(18, 34, 49, 0.8); color: var(--text); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all var(--transition); text-decoration: none;
    white-space: nowrap; position: relative; overflow: hidden;
}
.btn:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #042112; border-color: transparent; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(41,211,145,0.3); border-color: transparent; }
.btn-danger { background: var(--danger-dim); color: #ff9fb4; border-color: rgba(234,92,122,0.3); }
.btn-danger:hover { background: rgba(234,92,122,0.22); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--border); }
.btn-icon { padding: 7px; aspect-ratio: 1; }
.btn-icon.btn-sm { padding: 5px; }
.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading::after {
    content: ""; width: 13px; height: 13px; border: 2px solid currentColor;
    border-top-color: transparent; border-radius: 50%;
    animation: spin 0.6s linear infinite; margin-left: 4px; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Badges === */
.badge {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-green { background: rgba(41,211,145,0.12); color: var(--accent); border: 1px solid rgba(41,211,145,0.22); }
.badge-blue  { background: rgba(56,189,248,0.12); color: var(--info);   border: 1px solid rgba(56,189,248,0.22); }
.badge-muted { background: rgba(149,163,179,0.1); color: var(--muted);  border: 1px solid var(--border); }

/* === Alerts === */
.alert {
    border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px;
    display: flex; align-items: flex-start; gap: 10px; font-size: 13px;
}
.alert-body { flex: 1; }
.alert-close { background: none; border: none; color: inherit; cursor: pointer; padding: 0 2px; opacity: 0.6; font-size: 18px; line-height: 1; }
.alert-close:hover { opacity: 1; }
.alert-error   { background: #2b161c; border: 1px solid #4d2430; color: #ffb1be; }
.alert-success { background: #12291f; border: 1px solid #28563f; color: #9af2c8; }
.alert-info    { background: rgba(56,189,248,0.08); border: 1px solid rgba(56,189,248,0.2); color: var(--info); }

/* === Toast Notifications === */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px; padding: 13px 16px;
    border-radius: var(--radius); border: 1px solid; min-width: 280px; max-width: 420px;
    pointer-events: all; animation: toastIn 0.3s ease; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-success { background: #0e2419; border-color: #1d5737; color: #9af2c8; }
.toast-error   { background: #23111a; border-color: #4d2430; color: #ffb1be; }
.toast-info    { background: rgba(14,30,55,0.95); border-color: rgba(56,189,248,0.3); color: var(--info); }
.toast-msg     { flex: 1; }
.toast-close   { background: none; border: none; color: inherit; cursor: pointer; opacity: 0.6; padding: 0; font-size: 18px; line-height: 1; }
.toast-close:hover { opacity: 1; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(20px); } }

/* === Modal === */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(4,11,18,0.75);
    backdrop-filter: blur(5px); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
    background: linear-gradient(150deg, #121f2c, #0b1720);
    border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    box-shadow: 0 28px 72px rgba(0,0,0,0.65); width: 100%; max-width: 520px;
    transform: scale(0.96) translateY(12px); transition: transform 0.22s ease;
    overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 680px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
    background: none; border: none; color: var(--muted); cursor: pointer;
    padding: 5px; border-radius: 6px; display: flex; align-items: center;
    transition: color var(--transition), background var(--transition); font-size: 22px; line-height: 1;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }

/* === Layout Utilities === */
.muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.stack { display: grid; gap: 14px; }
.grid-two   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.full-row   { grid-column: 1 / -1; display: flex; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.row-end   { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.row-start { display: flex; align-items: center; gap: 10px; }
.divider   { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.form-group { display: grid; gap: 6px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-help  { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* === Guest Layout === */
.guest-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.guest-shell { width: 100%; max-width: 460px; }
.auth-card { background: linear-gradient(150deg, #101f2c, #0a151f); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-icon {
    width: 52px; height: 52px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px; color: #042112;
}
.auth-brand h1 { font-size: 22px; margin: 0 0 5px; }
.auth-brand p  { color: var(--muted); margin: 0; font-size: 13px; }
.auth-footer   { text-align: center; margin-top: 20px; color: var(--muted); font-size: 13px; }
.auth-footer a { color: var(--accent); font-weight: 500; }

/* === App Shell === */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
    background: linear-gradient(180deg, rgba(11,22,31,0.99), rgba(7,16,24,0.99));
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sidebar-brand .brand-icon { width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #042112; flex-shrink: 0; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 12px 10px 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: 10px; color: var(--text-secondary); font-size: 13px; font-weight: 500;
    transition: all var(--transition); border: 1px solid transparent; text-decoration: none;
}
.sidebar nav a:hover  { color: var(--text); background: rgba(255,255,255,0.05); border-color: var(--border); }
.sidebar nav a.active { color: var(--accent); background: var(--accent-dim); border-color: rgba(41,211,145,0.2); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.sidebar nav a.active .nav-icon { opacity: 1; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.03); margin-bottom: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1a3a4e, #0d2233); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; text-transform: uppercase; }
.user-info { min-width: 0; flex: 1; }
.user-info .name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .email { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-form { margin: 0; }
.logout-form .btn { width: 100%; justify-content: center; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 499; }
.sidebar-overlay.open { display: block; }
.hamburger { display: none; background: rgba(18,34,49,0.8); border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; color: var(--text); flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.hamburger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }

/* === Topbar === */
.content { padding: 20px; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 20px; padding: 11px 16px;
    background: rgba(10,23,33,0.6); border: 1px solid var(--border);
    border-radius: var(--radius); position: sticky; top: 12px; z-index: 100; backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1  { font-size: 18px; font-weight: 600; margin: 0; }
.user-chip  { border: 1px solid var(--border); background: rgba(13,29,43,0.8); padding: 6px 12px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 8px; }
.user-chip .name   { font-size: 13px; font-weight: 500; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 7px; background: var(--accent-dim); border: 1px solid rgba(41,211,145,0.2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* === Cards === */
.card {
    background: linear-gradient(165deg, var(--panel-soft), var(--panel));
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 16px;
    position: relative; overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, rgba(255,255,255,.03), rgba(255,255,255,0)); }
.card-hover:hover { border-color: var(--border-light); box-shadow: var(--shadow); }

/* === Stats === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: linear-gradient(165deg, var(--panel-soft), var(--panel)); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-dim); color: var(--accent); margin-bottom: 4px; }
.stat-card .stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .stat-value { font-size: 30px; font-weight: 700; line-height: 1; }
.metric { font-size: 36px; font-weight: 700; margin: 0; }

/* === Table === */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

/* === Template Cards Grid === */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.template-card {
    background: linear-gradient(165deg, var(--panel-soft), var(--panel));
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 18px; display: flex; flex-direction: column; gap: 12px;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.template-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0; transition: opacity var(--transition); }
.template-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); transform: translateY(-2px); }
.template-card:hover::before { opacity: 1; }
.template-card-header  { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.template-card-title   { font-size: 15px; font-weight: 600; margin: 0 0 3px; }
.template-card-business{ font-size: 12px; color: var(--muted); margin: 0; }
.template-card-badges  { display: flex; gap: 6px; flex-wrap: wrap; }
.template-card-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 2px; }

/* === Empty State === */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 18px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state p  { color: var(--muted); margin: 0 0 20px; font-size: 13px; }

/* === Designer === */
.designer-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.designer-panel { height: fit-content; position: sticky; top: 80px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.field-btn { font-size: 11px; padding: 7px 8px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.designer-main .canvas-holder {
    border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px;
    overflow: auto; background: #e8edf0; min-height: 300px;
}
#designer-canvas {
    width: auto; height: auto; position: relative;
    border: 1px solid #bbb; border-radius: 6px; background: #ffffff;
    margin: 0 auto; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.design-el {
    position: absolute; border: 1px dashed rgba(0,0,0,0.25); padding: 2px 4px;
    cursor: move; overflow: hidden; max-width: 100%; max-height: 100%;
    color: #111; border-radius: 2px; transition: border-color 0.1s ease;
}
.design-el:hover  { border-color: rgba(41,211,145,0.5); }
.design-el.selected { border: 2px solid var(--accent); background: rgba(41,211,145,0.06); z-index: 10; }
.design-el.barcode { background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px); color: #111; font-size: 11px; display: flex; align-items: center; justify-content: center; font-family: monospace; }
.zoom-tools { display: inline-flex; align-items: center; gap: 8px; }

/* === Print Layout === */
.print-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}
.print-form-panel {
    position: sticky;
    top: 76px;                       /* clear the floating topbar */
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.print-preview-panel { min-width: 0; } /* prevent grid blowout on long barcodes */

/* Empty state shown before first preview */
.print-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--muted);
    gap: 14px;
    padding: 40px 24px;
    text-align: center;
}
.print-empty-state svg { opacity: .35; }

/* Preview header bar (Print Now button row) */
.print-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

/* === Print Pages === */
.print-preview { display: grid; gap: 12px; }
.print-page { background: #f0f0f0; color: #111; border-radius: var(--radius-sm); padding: 10px; }
.print-page-inner { display: flex; flex-direction: column; align-items: center; width: 100%; }
.print-page-inner.layout-two { flex-direction: row; align-items: flex-start; justify-content: flex-start; flex-wrap: nowrap; }
.print-label { position: relative; background: #fff; border: 1px solid #ddd; overflow: hidden; }
.print-el { position: absolute; white-space: nowrap; overflow: hidden; max-width: 100%; max-height: 100%; }

/* === Misc === */
.no-print {}

/* === Responsive === */
@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 500; transform: translateX(-100%); transition: transform var(--transition); width: var(--sidebar-w); height: 100vh; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .hamburger { display: flex; }
    .grid-two, .stats-grid, .designer-wrap { grid-template-columns: 1fr; }
    .print-layout { grid-template-columns: 1fr; }
    .print-form-panel { position: static; max-height: none; }
    .field-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: 1fr; }
    .content { padding: 12px; }
    .topbar { top: 8px; }
}

@media print {
    @page {
        margin: 0;
    }
    body, .content {
        background: #fff !important;
        color: #111 !important;
    }
    .sidebar, .topbar, .alert, form, .btn, .row-between > h2, .no-print {
        display: none !important;
    }
    /* Collapse the two-column print layout to a single column */
    .print-layout {
        display: block !important;
    }
    .print-form-panel {
        display: none !important;
    }
    .print-preview-panel {
        width: 100% !important;
    }
    .print-preview-header {
        display: none !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .print-preview { gap: 0 !important; }
    .print-page-inner.layout-two {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }
    .print-page {
        page-break-after: always;
        break-after: page;
        width: 100%;
        min-height: auto;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .print-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
    .print-only {
        margin: 0 !important;
        padding: 0 !important;
    }
}
