/* ==========================================================================
   Laptop Care Ltd · Stylesheet
   Editorial, warm, considered. Cream background, deep ink text,
   terracotta accent, forest-green for healthy/success states.
   Display: Instrument Serif. UI: DM Sans. Numerics: JetBrains Mono.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg:           #FBF7F0;
    --bg-deep:      #F4EEE2;
    --surface:      #FFFFFF;
    --surface-2:    #FAF5EA;
    --surface-3:    #F1E9D6;
    --ink:          #1A1A1A;
    --ink-2:        #4B4B4B;
    --ink-3:        #8C8C8C;
    --ink-4:        #B8AE9A;

    --accent:       #C84B17;
    --accent-deep:  #A03A0E;
    --accent-soft:  #FBE3D4;
    --accent-tint:  #FDF1E8;

    --success:      #2D6A4F;
    --success-soft: #DCEFE3;
    --warning:      #B0791E;
    --warning-soft: #FBEFD2;
    --danger:       #A8331E;
    --danger-soft:  #F8DDD4;
    --info:         #2B5C8A;
    --info-soft:    #DDE9F4;
    --purple:       #6B3FA0;
    --purple-soft:  #EBE0F5;

    --border:       #E8DDC8;
    --border-2:     #D9CCB1;

    --shadow-sm:  0 1px 0 rgba(26,26,26,0.04);
    --shadow:     0 1px 0 rgba(26,26,26,0.04), 0 4px 16px -4px rgba(26,26,26,0.06);
    --shadow-lg:  0 1px 0 rgba(26,26,26,0.04), 0 12px 40px -8px rgba(26,26,26,0.12);

    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    background-image:
        radial-gradient(circle at 15% 0%,  rgba(200, 75, 23, 0.025), transparent 40%),
        radial-gradient(circle at 85% 100%, rgba(45, 106, 79, 0.022), transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ----- Typography ----- */
.display, .display-italic {
    font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.display-italic { font-style: italic; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ----- Layout shell ----- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 244px; flex-shrink: 0;
    background: var(--bg-deep);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}

.sidebar-brand {
    padding: 22px 18px 16px;
    display: flex; align-items: center; gap: 9px;
}
.sidebar-brand-mark {
    width: 32px; height: 32px; border-radius: 9px; background: var(--ink);
    display: flex; align-items: center; justify-content: center;
    color: var(--bg); position: relative;
}
.sidebar-brand-mark::after {
    content: ''; position: absolute; top: -2px; right: -2px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.sidebar-brand-text { font-family: 'Instrument Serif', serif; font-size: 19px; line-height: 1; }
.sidebar-brand-text em { font-style: italic; }
.sidebar-brand-sub {
    font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.08em;
    text-transform: uppercase; margin-top: 2px;
}

.sidebar-cta { padding: 0 12px 14px; }

.sidebar-section-label {
    font-size: 10.5px; color: var(--ink-4); text-transform: uppercase;
    letter-spacing: 0.08em; padding: 4px 11px 6px; font-weight: 600;
}

.sidebar-nav { padding: 0 10px; flex: 1; overflow-y: auto; }

.sidebar-link {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 11px; border-radius: 8px;
    color: var(--ink-2); font-size: 13.5px; font-weight: 500;
    cursor: pointer; transition: all 0.12s ease; text-decoration: none;
    letter-spacing: -0.005em; margin-bottom: 1px;
}
.sidebar-link:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.sidebar-link.active { background: var(--ink); color: var(--bg); }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-link span:nth-child(2) { flex: 1; }

.sidebar-badge {
    font-size: 11px; padding: 1px 6px; border-radius: 99px;
    background: var(--surface); color: var(--ink-2); font-weight: 600;
}
.sidebar-link.active .sidebar-badge {
    background: rgba(255,255,255,0.18); color: var(--bg);
}
.sidebar-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.sidebar-user {
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    display: flex; align-items: center; gap: 10px;
}

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 64px; padding: 0 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); background: rgba(251, 247, 240, 0.85);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 30;
}
.topbar-title-block { min-width: 0; }
.topbar-breadcrumb {
    font-size: 11.5px; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500;
}
.topbar-title {
    font-family: 'Instrument Serif', serif; font-size: 22px; line-height: 1.15; color: var(--ink);
}
.topbar-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.topbar-search {
    position: relative;
}
.topbar-search input {
    width: 260px; padding: 9px 10px 9px 32px;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--surface); font-size: 13px; color: var(--ink);
    font-family: inherit;
}
.topbar-search input:focus {
    outline: none; border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
.topbar-search svg {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--ink-4);
}
.topbar-search kbd {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    font-size: 10.5px; padding: 2px 5px; border-radius: 4px;
    background: var(--surface-3); color: var(--ink-3);
    font-family: 'JetBrains Mono', monospace; border: 1px solid var(--border);
}

.page { padding: 24px 28px 60px; }
.page-narrow { max-width: 920px; margin: 0 auto; }

/* ----- Buttons ----- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 14px; border-radius: 9px;
    font-family: inherit; font-weight: 500; font-size: 13.5px; line-height: 1;
    transition: all 0.15s ease;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    letter-spacing: -0.005em; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: 0 6px 16px -4px rgba(26,26,26,0.3); }

.btn-accent { background: var(--accent); color: #FFF; }
.btn-accent:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 6px 16px -4px rgba(200,75,23,0.3); }

.btn-success { background: var(--success); color: #FFF; }
.btn-success:hover { background: #1F4F39; }

.btn-danger { background: var(--danger); color: #FFF; }
.btn-danger:hover { background: #80271A; }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-soft { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
.btn-soft:hover { background: var(--surface-3); }

.btn-icon { padding: 8px 9px; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-lg { padding: 12px 18px; font-size: 14.5px; }
.btn-block { width: 100%; }

/* ----- Forms ----- */
.label {
    font-size: 12px; color: var(--ink-3); font-weight: 500;
    display: block; margin-bottom: 5px; letter-spacing: 0.005em;
}

.input, .select, .textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--surface); font-size: 14px; color: var(--ink);
    font-family: inherit; transition: all 0.15s ease;
    appearance: none; -webkit-appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.select {
    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='%238C8C8C' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-soft);
}
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-row { margin-bottom: 14px; }
.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; } }

.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--ink); }

.tag-input-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle {
    font-size: 12.5px; padding: 6px 12px; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--ink-2); cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.chip-toggle:hover { background: var(--surface-3); }
.chip-toggle.is-active {
    background: var(--ink); color: var(--bg); border-color: var(--ink);
}

/* ----- Cards ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-padded { padding: 18px 20px; }
.card-header {
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 16px 20px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

/* ----- Status & Priority ----- */
.status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; font-size: 12px; font-weight: 500;
    border-radius: 99px; letter-spacing: -0.005em; white-space: nowrap;
}
.status-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
}

.status-received      { color: #8C8C8C; background: var(--surface-3); }
.status-diagnosing    { color: var(--warning); background: var(--warning-soft); }
.status-quote-sent    { color: #7A6A2C; background: #FBF1CC; }
.status-quote-approved{ color: var(--success); background: var(--success-soft); }
.status-awaiting-parts{ color: var(--purple); background: var(--purple-soft); }
.status-in-repair     { color: var(--info); background: var(--info-soft); }
.status-quality-check { color: #3D5A7E; background: #E2E8EF; }
.status-ready-pickup  { color: var(--success); background: var(--success-soft); }
.status-delivered     { color: #8C8C8C; background: var(--surface-3); }
.status-on-hold       { color: var(--danger); background: var(--danger-soft); }
.status-cancelled     { color: #8C8C8C; background: var(--surface-3); }

.priority-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--ink-3);
}
.priority-high   { background: var(--accent); box-shadow: 0 0 0 3px rgba(200,75,23,0.18); }
.priority-normal { background: var(--ink-3); }
.priority-low    { background: var(--ink-4); }

/* ----- Avatar ----- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #FFF;
    font-size: 12px; font-weight: 600; flex-shrink: 0;
    letter-spacing: 0.02em;
    width: 32px; height: 32px;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 56px; height: 56px; font-size: 19px; }

/* ----- Tags / Pills ----- */
.tag {
    display: inline-flex; align-items: center;
    font-size: 11px; padding: 2px 8px; border-radius: 99px;
    background: var(--surface-3); color: var(--ink-2); font-weight: 500;
}
.tag-vip { background: var(--accent); color: #FFF; font-weight: 600; }
.tag-loyalty { background: var(--success); color: #FFF; font-weight: 600; }
.tag-corporate { background: var(--info); color: #FFF; font-weight: 600; }

/* ----- Tables ----- */
.table-card { padding: 0; overflow: hidden; }
.table {
    width: 100%; border-collapse: collapse;
}
.table thead th {
    padding: 11px 18px; background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 11.5px; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
    text-align: left;
}
.table tbody td {
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    font-size: 13.5px; vertical-align: middle;
}
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table-clickable tbody tr { cursor: pointer; }

.table-empty {
    padding: 60px 20px; text-align: center; color: var(--ink-3);
}

/* ----- Metrics ----- */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1024px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .metric-grid { grid-template-columns: 1fr; } }

.metric-card { padding: 20px; }
.metric-label {
    font-size: 11.5px; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500;
}
.metric-value {
    font-family: 'Instrument Serif', serif; font-size: 36px;
    line-height: 1; margin-top: 8px; color: var(--ink);
}
.metric-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.metric-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2);
    display: flex; align-items: center; justify-content: center; color: var(--ink);
}

/* ----- Alerts / Flash ----- */
.alert {
    padding: 12px 14px; border-radius: 10px;
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 13.5px; line-height: 1.5;
    margin-bottom: 16px;
}
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-danger  { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info    { background: var(--info-soft); color: var(--info); }

/* ----- Misc ----- */
.divider { border-top: 1px solid var(--border); }
.muted { color: var(--ink-3); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }

.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 22px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 22px; }
.p-0 { padding: 0; }

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.fs-xs { font-size: 11.5px; } .fs-sm { font-size: 12.5px; }
.fs-md { font-size: 14px; } .fs-lg { font-size: 16px; } .fs-xl { font-size: 20px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; }

/* ----- Drawer (slide-in) ----- */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(26, 26, 26, 0.32);
    z-index: 80; backdrop-filter: blur(2px); animation: fadeIn 0.2s;
}
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(720px, 96vw);
    background: var(--bg); z-index: 90;
    overflow-y: auto;
    box-shadow: -12px 0 48px -16px rgba(26, 26, 26, 0.2);
    animation: slideIn 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer-narrow { width: min(560px, 96vw); }
.drawer-header {
    padding: 20px 28px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg); z-index: 5;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.drawer-body { padding: 24px 28px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.fade-up { animation: fadeUp 0.4s ease-out backwards; }
.pulse-soft { animation: pulse 2s ease-in-out infinite; }

/* ----- Auth screen ----- */
.auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(200, 75, 23, 0.06), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(45, 106, 79, 0.04), transparent 50%);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 18px; padding: 36px 32px;
    box-shadow: var(--shadow-lg);
}
.auth-brand {
    display: flex; align-items: center; gap: 11px; margin-bottom: 28px;
}
.auth-brand-mark {
    width: 44px; height: 44px; border-radius: 12px; background: var(--ink);
    color: var(--bg); display: flex; align-items: center; justify-content: center;
    position: relative;
}
.auth-brand-mark::after {
    content: ''; position: absolute; top: -3px; right: -3px;
    width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
    border: 2px solid var(--surface);
}
.auth-title {
    font-family: 'Instrument Serif', serif; font-size: 28px;
    line-height: 1.15; margin-bottom: 4px;
}
.auth-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 24px; }

/* ----- Pipeline / Kanban ----- */
.pipeline {
    display: grid; gap: 12px; overflow-x: auto;
    grid-template-columns: repeat(6, minmax(220px, 1fr));
    padding-bottom: 8px;
}
.pipeline-col {
    background: var(--bg-deep); border-radius: 12px; padding: 8px;
    min-height: 400px;
}
.pipeline-col-header {
    padding: 8px 10px 12px; display: flex; align-items: center; justify-content: space-between;
}
.pipeline-card {
    padding: 11px; background: var(--surface); border-radius: 9px;
    border: 1px solid var(--border); cursor: pointer; margin-bottom: 7px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pipeline-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* ----- Timeline ----- */
.timeline { position: relative; }
.timeline::before {
    content: ''; position: absolute; left: 19px; top: 18px; bottom: 14px;
    width: 1px; background: var(--border);
}
.timeline-event { display: flex; gap: 14px; margin-bottom: 18px; position: relative; }
.timeline-bullet {
    width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; position: relative; z-index: 2; color: var(--ink-2);
}

/* ----- Stepper ----- */
.stepper { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.step-dot {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--surface-2); color: var(--ink-3);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--border);
}
.step.is-active .step-dot { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.step.is-done   .step-dot { background: var(--success); color: #FFF; border-color: var(--success); }
.step-label { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.step.is-active .step-label { color: var(--ink); font-weight: 600; }
.step-line { flex: 1; height: 1px; background: var(--border); }
.step-line.is-done { background: var(--success); }
.step { display: flex; align-items: center; gap: 8px; }

/* ----- Progress bar ----- */
.progress {
    height: 6px; background: var(--surface-3); border-radius: 99px;
    overflow: hidden;
}
.progress-bar {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-deep));
    border-radius: 99px; transition: width 0.5s ease;
}

/* ----- Photo grid ----- */
.photo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.photo-tile {
    aspect-ratio: 4 / 3; border-radius: 9px;
    background: var(--surface-3); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload {
    aspect-ratio: 4/3; border-radius: 9px; background: transparent;
    border: 1px dashed var(--border-2); color: var(--ink-3);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; cursor: pointer; font-size: 12px;
}

/* ----- Filter bar ----- */
.filter-bar {
    display: flex; gap: 4px; padding: 3px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px;
}
.filter-bar button {
    font-size: 12.5px; padding: 6px 12px; border-radius: 7px;
    background: transparent; color: var(--ink-3);
    border: none; cursor: pointer; font-weight: 500; font-family: inherit;
    transition: all 0.15s;
}
.filter-bar button:hover { color: var(--ink); }
.filter-bar button.is-active {
    background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-sm);
}

/* ----- Tabs ----- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab {
    padding: 9px 2px; font-size: 14px; font-weight: 500;
    color: var(--ink-3); border-bottom: 2px solid transparent;
    cursor: pointer; transition: all 0.15s; text-decoration: none;
    background: transparent; border-left: none; border-right: none; border-top: none;
    font-family: inherit;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* ----- Customer portal (public) ----- */
.portal-shell {
    min-height: 100vh; padding: 24px;
    display: flex; flex-direction: column; align-items: center;
}
.portal-card {
    width: 100%; max-width: 580px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 32px;
    box-shadow: var(--shadow);
}

/* ----- Two-column responsive ----- */
.cols-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1024px) { .cols-main { grid-template-columns: 1fr; } }

.cols-3-1 { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
@media (max-width: 1024px) { .cols-3-1 { grid-template-columns: 1fr; } }

/* ----- Pagination ----- */
.pagination {
    display: flex; gap: 4px; padding: 16px;
    justify-content: center; align-items: center;
}
.pagination a, .pagination span {
    min-width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 10px; border-radius: 7px;
    font-size: 13px; color: var(--ink-2);
    background: transparent; border: 1px solid var(--border);
    text-decoration: none;
}
.pagination a:hover { background: var(--surface-2); }
.pagination .is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }

/* ----- Mobile ----- */
@media (max-width: 720px) {
    .sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar-nav { display: none; }
    .app-layout { flex-direction: column; }
    .topbar { padding: 0 16px; flex-wrap: wrap; height: auto; padding: 12px 16px; }
    .topbar-search input { width: 100%; }
    .page { padding: 16px; }
}

/* Scrollbar */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
