/* ==========================================================
   Bestatter-Portal – Archive Variant
   Museum/ledger aesthetic applied to the full portal app.
   Same class names as portal.css, restyled.
   ========================================================== */

/* ── Archive palette (override) ─────────────────────────── */
:root {
    --a-paper:     #F6EEDD;
    --a-paper-2:   #FBF5E8;
    --a-card:      #FFFBF2;
    --a-ink:       #2B2419;
    --a-ink-2:     #5B4E36;
    --a-muted:     #96876A;
    --a-rule:      #D8C9A8;
    --a-rule-soft: #E8DDC5;
    --a-gold:      #A47E3B;
    --a-gold-deep: #6E5222;
    --a-success:   #3F6D36;
    --a-error:     #8E3A2C;
}

body {
    background: var(--a-paper);
    color: var(--a-ink);
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    /* paper grain */
    background-image:
      radial-gradient(circle at 20% 30%, rgba(139,115,85,0.035) 0px, transparent 1.5px),
      radial-gradient(circle at 70% 60%, rgba(139,115,85,0.028) 0px, transparent 1.5px),
      radial-gradient(circle at 40% 80%, rgba(139,115,85,0.025) 0px, transparent 1.5px);
    background-size: 3px 3px, 5px 5px, 7px 7px;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--a-ink);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.005em;
}

/* ── Header / top bar ───────────────────────────────────── */
.portal-header {
    background: var(--a-card);
    border-bottom: 1px solid var(--a-rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    cursor: pointer;
}
.brand-mark {
    display: none; /* archive uses wordmark only */
}
.brand-text {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    line-height: 1;
}
.brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--a-ink);
    letter-spacing: -0.005em;
    line-height: 1;
    white-space: nowrap;
}
.brand-name em {
    font-style: italic;
    color: var(--a-gold-deep);
}
.brand-sub {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--a-muted);
    font-weight: 600;
    padding-left: 0.9rem;
    border-left: 1px solid var(--a-rule);
    white-space: nowrap;
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Body container ─────────────────────────────────────── */
.portal-body {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 2.25rem 2.5rem 3rem;
}

/* ── Page heading ───────────────────────────────────────── */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 0.1rem;
}
.page-heading .title-block::before {
    display: none;
}
.page-heading .title-block h1 {
    font-size: 2.1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}
.page-heading .title-block p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--a-muted);
    font-size: 0.95rem;
}

/* ── Buttons — overrides ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--a-ink);
    background: var(--a-ink);
    color: var(--a-paper);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 1px;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    line-height: 1.4;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
}
.btn:focus-visible { outline: 2px solid var(--a-gold); outline-offset: 2px; }
.btn svg { width: 14px; height: 14px; }

.btn-primary {
    background: var(--a-ink);
    color: var(--a-paper);
    border-color: var(--a-ink);
    box-shadow: none;
}
.btn-primary:hover {
    background: var(--a-gold-deep);
    border-color: var(--a-gold-deep);
    color: var(--a-paper);
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--a-ink);
    border-color: var(--a-rule);
}
.btn-secondary:hover {
    background: var(--a-paper);
    border-color: var(--a-ink);
    color: var(--a-ink);
}

.btn-ghost {
    background: transparent;
    color: var(--a-muted);
    border-color: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.btn-ghost:hover {
    background: transparent;
    color: var(--a-ink);
}

.btn-danger {
    background: transparent;
    color: var(--a-error);
    border-color: var(--a-error);
}
.btn-danger:hover {
    background: var(--a-error);
    border-color: var(--a-error);
    color: var(--a-paper);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
}

/* ── Form overrides ─────────────────────────────────────── */
.form-group label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--a-muted);
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.form-input, .form-textarea {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    color: var(--a-ink);
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--a-ink);
    box-shadow: none;
}

/* ── Stats — archival index cards ───────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    box-shadow: none;
    transition: none;
    position: relative;
    overflow: visible;
}
.stat-card:hover { transform: none; box-shadow: none; }
.stat-card::before { display: none; }

.stat-icon {
    width: 32px; height: 32px;
    border-radius: 0;
    border: 1px solid var(--a-rule);
    background: var(--a-paper);
    color: var(--a-gold-deep);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 14px; height: 14px; }

.stat-text { display: flex; flex-direction: column; gap: 0.15rem; }
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--a-ink);
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--a-muted);
    font-weight: 600;
    margin-top: 0.35rem;
}

/* ── Toolbar ────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--a-rule);
    border-bottom: 1px solid var(--a-rule);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 280px;
    flex: 0 0 auto;
}
.search-box svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--a-muted);
    width: 14px; height: 14px;
    pointer-events: none;
}
.search-box input {
    width: 100%;
    padding: 0.5rem 0.8rem 0.5rem 2rem;
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    background: var(--a-card);
    color: var(--a-ink);
    transition: border-color 0.2s ease;
}
.search-box input::placeholder { color: var(--a-muted); opacity: 1; }
.search-box input:focus {
    outline: none;
    border-color: var(--a-ink);
    box-shadow: none;
}

.filter-tabs {
    display: inline-flex;
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 0;
    gap: 0;
    margin-left: auto;
}
.filter-tab {
    border: none;
    background: transparent;
    padding: 0.45rem 0.9rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--a-muted);
    border-radius: 0;
    cursor: pointer;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-right: 1px solid var(--a-rule);
}
.filter-tab:last-child { border-right: none; }
.filter-tab:hover { color: var(--a-ink); }
.filter-tab.active {
    background: var(--a-ink);
    color: var(--a-paper);
    box-shadow: none;
}
.filter-tab .count {
    display: inline;
    place-items: initial;
    min-width: 0;
    height: auto;
    padding: 0;
    background: transparent;
    color: inherit;
    border-radius: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
    margin-left: 0.15rem;
}
.filter-tab.active .count {
    background: transparent;
    color: inherit;
    opacity: 0.7;
}

/* ── Order list — ledger rows ───────────────────────────── */
.order-list {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}
.order-list::before {
    content: 'Ref.           Familie · in memoriam                                            Kontakt                 Eingang           Status';
    display: none; /* drop pre-baked header; columns are clearly labelled by design */
}

.order-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--a-rule-soft);
    border-radius: 0;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
    box-shadow: none;
}
.order-card:last-child { border-bottom: none; }
.order-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--a-rule-soft);
    background: var(--a-paper-2);
}

/* Replace avatar circle with a readable sequential number */
.order-avatar {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--a-gold-deep);
    display: inline-flex;
    align-items: center;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.order-avatar::before {
    display: none;
}

.order-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.order-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--a-ink);
    line-height: 1.2;
    letter-spacing: -0.005em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    font-family: 'Source Sans 3', sans-serif;
    font-style: normal;
    font-size: 0.92rem;
    color: var(--a-ink-2);
}
.order-meta > span:first-child {
    /* email — break it into its own column visually */
    display: none;
}
.order-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--a-muted); opacity: 0.7; }

/* Use pseudo-column: inject email as a discrete column via data */
.order-card::after {
    content: '';
}

.order-status-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.order-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-shrink: 0;
}
.order-actions .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    line-height: 1.4;
    height: 2rem;
    box-sizing: border-box;
}

/* Badges → stamps */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0.25rem 0.55rem;
    border: 1px solid currentColor;
    border-radius: 1px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    line-height: 1;
    white-space: nowrap;
    background: transparent;
}
.badge::before { display: none; }

.badge-created     { color: #8a7a5c; }
.badge-email-sent  { color: #3a6a9e; }
.badge-uploading   { color: #9b6a12; }
.badge-submitted   { color: var(--a-success); }
.badge-processing  { color: #744f96; }
.badge-done        {
    color: var(--a-success);
    background: rgba(63,109,54,0.08);
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 3.5rem 2rem;
    text-align: center;
}
.empty-illustration {
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    color: var(--a-gold);
    margin: 0 auto 0.75rem;
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-style: italic;
    line-height: 1;
}
.empty-illustration svg { display: none; }
.empty-illustration::before {
    content: '—';
}
.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--a-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(43, 36, 25, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    box-shadow: 0 20px 60px rgba(43, 36, 25, 0.25);
    padding: 2rem 2.25rem;
}
.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.modal-header p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--a-muted);
    font-size: 0.9rem;
}
.modal-actions {
    border-top: 1px solid var(--a-rule-soft);
    padding-top: 1.25rem;
    margin-top: 1.5rem;
}

/* QR modal */
.qr-modal { text-align: center; }
.qr-wrapper {
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    background: var(--a-card);
}
.qr-modal .qr-url {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.78rem;
    color: var(--a-ink-2);
    background: var(--a-paper);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 0.5rem 0.75rem;
}

/* ── Detail page ────────────────────────────────────────── */
.back-nav {
    background: none;
    border: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--a-muted);
    cursor: pointer;
    padding: 0;
    margin: 0 0 1.5rem;
    font-weight: 700;
}
.back-nav:hover { background: transparent; color: var(--a-ink); }
.back-nav svg { display: none; }
.back-nav::before { content: '← '; }

.detail-hero {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 1.75rem 1.9rem;
    box-shadow: none;
    margin-bottom: 1.5rem;
    display: block;
    position: relative;
}
.detail-hero .order-avatar {
    position: absolute;
    top: 1rem; right: 1.3rem;
    font-size: 0.75rem;
}
.detail-hero .order-avatar::before {
    content: 'REF № ';
    font-family: 'Source Sans 3', sans-serif;
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--a-muted);
    margin-right: 0.3rem;
}
.hero-info { flex: none; min-width: 0; }
.hero-info h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.hero-info > p {
    font-family: 'Playfair Display', serif !important;
    font-style: italic !important;
    font-size: 1rem !important;
    color: var(--a-ink-2) !important;
    margin-top: 0 !important;
}
.hero-info > p strong {
    font-weight: 600 !important;
    color: var(--a-gold-deep) !important;
}
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--a-rule-soft);
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.75rem;
    color: var(--a-muted);
    font-variant-numeric: tabular-nums;
}
.hero-meta .meta-item { gap: 0.45rem; }
.hero-meta svg { width: 12px; height: 12px; color: var(--a-muted); }
.hero-badge-row { margin-top: 0.9rem; }

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
}

.detail-card {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 1.4rem 1.6rem;
    box-shadow: none;
    margin-bottom: 1.25rem;
}
.detail-card h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--a-muted);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--a-rule-soft);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.detail-card h3 .count-pill {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 500;
    background: transparent;
    color: var(--a-muted);
    padding: 0;
    border-radius: 0;
    letter-spacing: 0.02em;
    text-transform: none;
}

/* ── Timeline — archival ────────────────────────────────── */
.timeline {
    display: block;
    padding-left: 0;
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 19px; top: 14px; bottom: 14px;
    width: 1px;
    background: var(--a-rule);
}
.timeline-item {
    position: relative;
    padding: 0.7rem 0;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 1rem;
    align-items: baseline;
}
.timeline-item:not(:last-child)::after { display: none; }

.timeline-dot {
    position: static;
    justify-self: center;
    align-self: start;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--a-card);
    border: 1.5px solid var(--a-rule);
    color: transparent;
    margin-top: 0.4rem;
    display: block;
    z-index: 1;
}
.timeline-dot svg { display: none; }

.timeline-item.completed .timeline-dot {
    background: var(--a-success);
    border-color: var(--a-success);
    position: relative;
}
.timeline-item.completed .timeline-dot::after {
    content: '';
    position: absolute;
    left: 2.5px; top: 0.5px;
    width: 4px; height: 6.5px;
    border: solid var(--a-paper);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}
.timeline-item.active .timeline-dot {
    background: var(--a-gold);
    border-color: var(--a-gold);
    box-shadow: 0 0 0 4px rgba(164,126,59,0.18);
}
.timeline-item.active .timeline-dot::before { display: none; }

.timeline-content {
    line-height: 1.4;
}
.timeline-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--a-ink-2);
    margin-bottom: 0;
    letter-spacing: -0.005em;
}
.timeline-item.completed .timeline-title { color: var(--a-ink); }
.timeline-item.active .timeline-title { color: var(--a-ink); font-weight: 600; }
.timeline-item:not(.completed):not(.active) .timeline-title {
    color: var(--a-muted);
    opacity: 0.6;
}
.timeline-meta {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.72rem;
    color: var(--a-muted);
    font-variant-numeric: tabular-nums;
    /* place timestamp in the right column */
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    padding-top: 0.3rem;
    white-space: nowrap;
}

/* ── Photo grid — contact sheet ─────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.4rem;
    background: var(--a-ink);
    padding: 0.55rem;
    border-radius: 1px;
}
.photo-thumb {
    aspect-ratio: 1;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    transition: none;
    position: relative;
}
.photo-thumb::after { display: none; }
.photo-thumb:hover {
    transform: none;
    border-color: var(--a-gold);
    box-shadow: none;
}

.photo-placeholder {
    background: linear-gradient(135deg, var(--bg1, #E8D4B8) 0%, var(--bg2, #C9A86C) 100%);
    color: rgba(255,255,255,0.7);
    font-family: ui-monospace, Menlo, monospace;
}

.photo-empty {
    background: transparent;
    border: 1px dashed var(--a-rule);
    border-radius: 1px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: var(--a-muted);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.9rem;
}
.photo-empty svg {
    color: var(--a-muted);
    opacity: 0.5;
    width: 36px;
    height: 36px;
    display: block;
    margin: 0 auto 0.6rem;
}

/* ── Side cards ─────────────────────────────────────────── */
.side-card {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 1px;
    padding: 1.25rem 1.4rem;
    box-shadow: none;
    margin-bottom: 1.25rem;
}
.side-card h4 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--a-muted);
    font-weight: 700;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--a-rule-soft);
}
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 0.6rem 0.8rem;
    padding: 0.55rem 0;
    border-bottom: 1px dotted var(--a-rule-soft);
    align-items: baseline;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }
.info-label {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.7rem;
    color: var(--a-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.info-value {
    font-size: 0.88rem;
    color: var(--a-ink);
    word-break: break-word;
    font-weight: 400;
}

.note-body {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--a-ink-2);
    padding: 0.75rem 0.9rem;
    background: var(--a-paper);
    border-left: 2px solid var(--a-gold);
    border-radius: 0;
}

.side-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}
.side-actions .btn {
    justify-content: flex-start;
}

/* ── Video ready banner ─────────────────────────────────── */
.video-ready {
    background: linear-gradient(180deg, #F3F0E0 0%, #ECE4C8 100%);
    border: 1px solid #C9B681;
    border-radius: 1px;
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    position: relative;
}
.video-ready::before {
    content: 'FERTIG';
    position: absolute;
    top: -9px; left: 1.4rem;
    background: var(--a-paper);
    color: var(--a-success);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    padding: 0 0.5rem;
}
.video-ready-icon { display: none; }
.video-ready-text { flex: none; }
.video-ready-text strong {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--a-ink);
    display: block;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}
.video-ready-text span {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.78rem;
    color: var(--a-ink-2);
    font-variant-numeric: tabular-nums;
}
.video-ready .btn-download {
    background: var(--a-ink);
    color: var(--a-paper);
    border-color: var(--a-ink);
}
.video-ready .btn-download:hover {
    background: var(--a-gold-deep);
    border-color: var(--a-gold-deep);
}

/* ── Toast ──────────────────────────────────────────────── */
.toast {
    background: var(--a-ink);
    color: var(--a-paper);
    border-radius: 1px;
    padding: 0.7rem 1.1rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(43, 36, 25, 0.3);
}
.toast svg {
    color: var(--a-gold);
    width: 14px; height: 14px;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--a-muted);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.82rem;
    border-top: 1px solid var(--a-rule-soft);
    margin-top: 2rem;
}
.footer a {
    color: var(--a-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--a-rule);
    padding-bottom: 1px;
}
.footer a:hover { color: var(--a-ink); border-color: var(--a-ink); }

/* ── Login Screen ───────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--a-paper);
}
.login-card {
    background: var(--a-card);
    border: 1px solid var(--a-rule);
    border-radius: 6px;
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 16px rgba(43,36,25,0.08);
}
.login-brand {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--a-rule-soft);
}
.login-brand::before {
    content: '✦';
    display: block;
    color: var(--a-gold);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.15em;
}
.login-brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--a-ink);
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.login-brand-sub {
    font-size: 0.8rem;
    color: var(--a-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 0.35rem;
    font-weight: 500;
}
.login-error {
    background: rgba(142,58,44,0.08);
    border: 1px solid rgba(142,58,44,0.25);
    color: var(--a-error);
    border-radius: 4px;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.login-btn {
    width: 100%;
    margin-top: 0.25rem;
    justify-content: center;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .order-card {
        grid-template-columns: 70px 1fr auto;
        row-gap: 0.5rem;
    }
    .order-card > :nth-child(3),
    .order-card > :nth-child(4) {
        display: none; /* hide email column on narrow */
    }
}

@media (max-width: 680px) {
    .portal-header { padding: 0.85rem 1.1rem; flex-wrap: wrap; gap: 0.5rem; }
    .brand-sub { display: none; }
    .portal-body { padding: 1.5rem 1.1rem 2rem; }
    .stats-row { grid-template-columns: 1fr; gap: 0.6rem; }
    .page-heading h1 { font-size: 1.6rem; }
    .toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .search-box { width: 100%; }
    .filter-tabs { margin-left: 0; overflow-x: auto; }
    .order-card {
        grid-template-columns: 60px 1fr auto;
        padding: 0.9rem 1rem;
    }
    .detail-hero { padding: 1.25rem; }
    .detail-hero .order-avatar { position: static; margin-bottom: 0.75rem; }
    .modal { padding: 1.5rem; }
}
