
/* ── CSS Variables ── */
:root {
    --brand:        #FF8C42;
    --brand-dark:   #e07530;
    --brand-light:  #FFF4EC;
    --brand-border: #ffb68a;

    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --blue-600: #2563eb;
    --blue-700: #1d4ed8;

    --green-600: #059669;
    --green-700: #065f46;
    --green-100: #d1fae5;
    --green-200: #6ee7b7;

    --red-100:  #fef2f2;
    --red-300:  #fca5a5;
    --red-400:  #f87171;
    --red-500:  #ef4444;
    --red-600:  #dc2626;
    --red-800:  #991b1b;

    --yellow-100: #fef3c7;
    --yellow-800: #92400e;

    --blue-100: #dbeafe;
    --blue-800: #1e40af;

    --sky-100:  #e0f2fe;
    --sky-800:  #075985;

    --radius-sm:   0.5rem;
    --radius-md:   0.75rem;
    --radius-lg:   1rem;
    --radius-full: 999px;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    background: var(--gray-50);
    color: var(--gray-800);
}

.logo-text { font-family: 'DM Serif Display', serif; }
.mono      { font-family: 'DM Mono', monospace; }

/* ── Custom Scrollbar ── */
.custom-scroll::-webkit-scrollbar       { width: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #E8E4E0; border-radius: 4px; }
.custom-scroll { scrollbar-width: thin; scrollbar-color: #E8E4E0 transparent; }

/* ── Hidden utility ── */
.dts-hidden { display: none !important; }

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .page-wrapper { padding: 1rem; }
}

/* ── Main Card ── */
.main-card {
    width: 100%;
    display: flex;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    background: #fff;
    min-height: calc(100vh - 2rem);
}

/* ============================================================
   LEFT PANEL
   ============================================================ */
.left-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--gray-100);
    background: #fff;
}

/* Header */
.left-header {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    background: #fff;
}

.left-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.left-header-brand img {
    height: 44px;
    width: 44px;
    border-radius: 50%;
}

.brand-name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.125rem;
    line-height: 1.25;
    color: var(--brand);
}

.brand-sub {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Scrollable area */
.left-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* ── Left Hint ── */
.left-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--gray-400);
    font-size: 1rem;
    text-align: center;
    line-height: 1.6;
}

.left-hint svg    { margin-bottom: 0.75rem; opacity: 0.2; }
.left-hint p      { margin: 0; }
.left-hint strong { color: var(--gray-600); }

/* ============================================================
   CHIPS
   ============================================================ */
.chip {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--brand-border);
    color: var(--brand-border);
    padding: 0.38rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'DM Mono', monospace;
    user-select: none;
    line-height: 1.4;
}

.chip:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,140,66,0.3);
}

.chip:active { transform: translateY(0); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.dts-field {
    display: block;
    width: 100%;
    padding: 0.55rem 0.8rem;
    font-size: 0.925rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--gray-800);
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.dts-field:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255,140,66,0.15);
}

.dts-field::placeholder { color: var(--gray-400); }

select.dts-field {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    appearance: none;
}

.brand-focus:focus {
    outline: none;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(255,140,66,0.18);
}

/* Error text under fields */
.field-error {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--red-500);
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Brand (orange) */
.btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-brand:hover  { background: var(--brand-dark); }
.btn-brand:active { transform: scale(0.98); }
.btn-brand:disabled { opacity: 0.6; cursor: not-allowed; }

/* Icon-only compact variant */
.btn-brand.icon-btn { padding: 0.65rem 1rem; font-size: 1rem; }

/* Outline */
.btn-dts-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-dts-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Small size modifier */
.btn-dts-sm { padding: 0.6rem 1.1rem; font-size: 0.9rem; }

/* ============================================================
   FORM LAYOUT HELPERS
   ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* form-row: label + field */
.form-row-dts {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-label-dts {
    width: 7rem;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    padding-top: 0.625rem;
    font-weight: 500;
}

.form-label-dts .req { color: var(--red-500); }
.form-field-dts { flex: 1; }

/* ── Form action row: Cancel + Submit aligned right ── */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

/* ============================================================
   ALERTS
   ============================================================ */
.dts-alert-danger {
    padding: 0.7rem 0.95rem;
    background: var(--red-100);
    color: var(--red-800);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    margin-bottom: 1rem;
}

/* Submit error inline — shown ABOVE the action buttons */
.submit-error {
    display: none;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #fca5a5;
    background: var(--red-100);
    color: var(--red-800);
    font-size: 0.925rem;
    text-align: center;
}

/* ============================================================
   TRACK PANEL
   ============================================================ */
.pub-loading {
    display: none;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-500);
    font-size: 0.95rem;
}

.pub-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-100);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin-full 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}

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

.pub-error-msg {
    display: none;
    background: var(--red-100);
    color: var(--red-800);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    font-size: 0.925rem;
    margin-bottom: 1rem;
}

/* ── Codes strip ── */
.codes-strip {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: nowrap;
}

.code-container {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    text-align: center;
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .codes-strip {
        flex-direction: column;
    }
    .code-container canvas,
    .code-container img {
        max-width: 100%;
        height: auto;
    }
}

.code-container h6 {
    font-size: 0.76rem;
    color: var(--gray-500);
    margin: 0 0 0.55rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.code-container canvas,
.code-container img { max-width: 100%; display: block; margin: 0 auto; }

/* ── DocFind side-by-side layout ── */
.docfind-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.docfind-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.docfind-panel-header {
    padding: 0.7rem 1rem;
    background: #fffaf6;
    border-bottom: 2px solid var(--brand-border);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.01em;
}

.docfind-panel-header svg { color: var(--brand); }

/* Detail rows */
.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #f9fafb;
    gap: 0.65rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    font-weight: 600;
    min-width: 115px;
    padding-top: 0.1rem;
    font-family: 'DM Mono', monospace;
    flex-shrink: 0;
}

.detail-value {
    font-size: 0.925rem;
    color: var(--gray-800);
    font-weight: 500;
    flex: 1;
    line-height: 1.6;
}

/* ── Timeline ── */
.pub-timeline { padding: 0.65rem 0.85rem 0.85rem; }

/* Declined timeline status */
.timeline-item.declined {
    border-left-color: #dc3545;
}
.timeline-item.declined:before {
    border-color: #dc3545;
}
.timeline-item.declined .timeline-title {
    color: #dc3545;
}

.timeline-item {
    position: relative;
    padding-left: 1.75rem;
    padding-bottom: 1.1rem;
    border-left: 2px solid var(--gray-100);
    margin-left: 0.4rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.42rem;
    top: 0.3rem;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    background: #fff;
}

.timeline-item.completed::before { background: #10b981; border-color: #10b981; }
.timeline-item.received::before  { background: var(--brand); border-color: var(--brand); }
.timeline-item.pending::before   { background: #fff; border-color: var(--gray-300); }

.timeline-date {
    font-size: 0.78rem;
    color: var(--brand);
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    margin-bottom: 0.18rem;
}

.timeline-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.timeline-details {
    font-size: 0.83rem;
    color: var(--gray-500);
    line-height: 1.7;
}

.timeline-details strong { color: var(--gray-700); }

/* ============================================================
   BADGES
   ============================================================ */
.dts-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
}

.badge-success   { background: var(--green-100);  color: var(--green-700); }
.badge-warning   { background: var(--yellow-100); color: var(--yellow-800); }
.badge-primary   { background: var(--blue-100);   color: var(--blue-800); }
.badge-info      { background: var(--sky-100);    color: var(--sky-800); }
.badge-danger    { background: var(--red-100);    color: var(--red-800); }
.badge-secondary { background: var(--gray-100);   color: var(--gray-700); }

/* ============================================================
   SUCCESS PANEL
   ============================================================ */
.success-panel {
    animation: fadeSlideIn 0.3s ease;
}

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

.success-card {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-200);
    background: #fff;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
}

.success-card-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #15803d;
}

.success-card-sub {
    font-size: 0.875rem;
    color: #16a34a;
    margin-bottom: 0.5rem;
}

.tracking-badge {
    display: inline-block;
    font-family: 'DM Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--green-700);
    background: #fff;
    border: 2px solid var(--green-200);
    border-radius: var(--radius-sm);
    padding: 0.45rem 1.1rem;
    margin: 0.5rem 0;
    letter-spacing: 0.05em;
}

.codes-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.code-box {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    text-align: center;
}

.code-box canvas,
.code-box img { max-width: 100%; display: block; margin: 0 auto; }

.code-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    font-family: 'DM Mono', monospace;
    margin-top: 0.35rem;
}

/* ── New Doc button inside success panel ── */
.success-new-doc-row {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Success 3-col grid collapses on narrow left panel */
@media (max-width: 960px) {
    .success-grid-3col { grid-template-columns: 1fr 1fr !important; }
    .success-grid-3col > :first-child { grid-column: 1 / -1; flex-direction: row; justify-content: center; }
}

/* ============================================================
   CONFIRMATION DIALOG
   ============================================================ */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.confirm-overlay.active { display: flex; }

.confirm-dialog {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    max-width: 380px;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: dialog-pop 0.2s ease;
}

@keyframes dialog-pop {
    from { transform: scale(0.92) translateY(8px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff7ed;
    border: 2px solid #fed7aa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.confirm-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.4rem;
}

.confirm-body {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.confirm-body strong { color: var(--gray-700); }

.confirm-actions {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
}

.btn-confirm-cancel {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--gray-50);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-confirm-cancel:hover { background: var(--gray-100); }

.btn-confirm-leave {
    flex: 1;
    padding: 0.65rem 1rem;
    background: var(--red-500);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.925rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-confirm-leave:hover { background: var(--red-600); }

/* ============================================================
   ADD-DOC SECTION HEADER
   ============================================================ */
.section-back-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

/* ============================================================
   RIGHT PANEL — Login
   ============================================================ */
.right-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    background: var(--gray-50);
}

.login-box {
    width: 100%;
    max-width: 24rem;
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 1.75rem;
}

/* Login buttons */
.btn-login-dark {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--gray-800);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
    margin-bottom: 0.75rem;
}

.btn-login-dark:hover    { background: var(--gray-900); }
.btn-login-dark:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-login-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--blue-600);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-login-google:hover    { background: var(--blue-700); }
.btn-login-google:disabled { opacity: 0.65; cursor: not-allowed; }

/* OR divider */
.or-hr {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    margin: 1rem 0;
}

.or-hr::before,
.or-hr::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 1rem;
    gap: 0.1rem;
}

.tab-btn {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
}

.tab-btn.active             { color: var(--brand); border-bottom-color: var(--brand); }
.tab-btn:hover:not(.active) { color: var(--gray-700); }
.tab-panel                  { display: none; }
.tab-panel.active           { display: block; }

/* ============================================================
   SPIN ANIMATION (submit buttons)
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }

/* ============================================================
   SCANNER MODAL
   ============================================================ */
.pub-scanner-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.pub-scanner-modal.active { display: flex; }

.scanner-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: calc(100% - 2rem);
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: scanner-slide 0.3s ease;
}

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

.scanner-header {
    background: var(--brand);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scanner-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-scanner {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.close-scanner:hover { background: rgba(255, 255, 255, 0.2); }

.scanner-container {
    padding: 1.25rem;
    background: #f9fafb;
    position: relative;
}

#pub-scanner-video {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: var(--radius-md);
    display: block;
    object-fit: cover;
    margin-bottom: 1rem;
}

.scanner-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-scanner-control {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-scanner-control:hover { background: var(--brand-dark); }
.btn-scanner-control:active { transform: scale(0.98); }
.btn-scanner-control.active { background: var(--green-600); }

.scanner-result {
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
    font-family: 'DM Mono', monospace;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    body * { visibility: hidden; }
    #printArea, #printArea * { visibility: visible; }
    #printArea { position: fixed; top: 0; left: 0; width: 100%; }
}

/* ============================================================
   RESPONSIVE — collapse to single column on small screens
   ============================================================ */
@media (max-width: 768px) {
    .main-card   { flex-direction: column; }
    .left-panel,
    .right-panel { width: 100%; }
    .right-panel { padding: 1.5rem 1rem; }
    .grid-2      { grid-template-columns: 1fr; }
}
