/* Heirfolio — palette from design export */
:root {
    --bg: #f5f2ea;
    --ink: #211d17;
    --panel: #ffffff;
    --line: #e3dcc9;
    --side-bg: #211d17;
    --side-fg: #d9d2c3;
    --side-muted: #8f8672;
    --side-line: #3a342a;
    --gold: #cbb886;
    --gold-dark: #8a6d3b;
    --gold-darker: #6d5326;
    --amber: #d9a94a;
    --green: #5a7a4d;
    --red: #a4432e;
    --serif: 'Source Serif 4', serif;
    --sans: 'Libre Franklin', sans-serif;
    --mono: 'IBM Plex Mono', monospace;
}

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; }
a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: var(--gold-darker); text-decoration: underline; }
input, select, button, textarea { font-family: var(--sans); font-size: 13px; }
::selection { background: #e6d9bd; }
h1, h2, h3 { font-family: var(--serif); }

.boot { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100vh; font-family:var(--serif); font-size:28px; font-weight:700; }
.boot span { font-family:var(--sans); font-size:12px; color:var(--side-muted); margin-top:6px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 224px; flex-shrink: 0; background: var(--side-bg); color: var(--side-fg); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; box-sizing: border-box; }
.side-brand { padding: 24px 20px 18px; border-bottom: 1px solid var(--side-line); }
.side-brand .name { font-family: var(--serif); font-size: 24px; font-weight: 700; color: #f2ede1; }
.side-brand .tag { font-size: 11px; color: var(--side-muted); margin-top: 4px; line-height: 1.4; }
.side-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 6px; cursor: pointer; color: var(--side-fg); font-weight: 400; text-decoration: none; }
.side-nav a:hover { background: #332d23; text-decoration: none; }
.side-nav a.active { background: #3a342a; color: #f2ede1; font-weight: 600; }
.side-nav .count { font-family: var(--mono); font-size: 11px; background: var(--side-line); color: var(--gold); border-radius: 10px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--side-line); font-size: 11px; line-height: 1.6; color: var(--side-muted); }
.side-foot .head { color: var(--gold); font-weight: 600; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; }
.side-foot .row { display: flex; justify-content: space-between; }
.side-foot .row .v { font-family: var(--mono); color: var(--side-fg); }
.side-foot .row .v.warn { color: var(--amber); }
.side-foot .side-settings {
    display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px;
    border-radius: 6px; color: var(--side-fg); text-decoration: none; font-weight: 500; font-size: 12px;
    border: 1px solid var(--side-line);
}
.side-foot .side-settings:hover { background: #332d23; text-decoration: none; color: #f2ede1; }
.side-foot .side-settings.active { background: #3a342a; color: #f2ede1; border-color: #4a4336; }
.side-foot .side-settings .gear { font-size: 14px; color: var(--gold); line-height: 1; }

/* settings */
.settings-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.provider { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #faf8f3; }
.provider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.provider-name { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.provider-tag { font-family: var(--sans); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--gold-darker); background: #efe6d0; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.provider-meta { font-size: 12px; color: var(--side-muted); margin-top: 2px; }
.provider-actions { margin-top: 6px; }
.provider .field { margin-bottom: 0; }
.provider .field input { font-family: var(--mono); font-size: 12px; }

.main { flex: 1; padding: 28px 32px 60px; max-width: 1280px; box-sizing: border-box; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--side-muted); font-size: 12px; }

/* cards & stats */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat .label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); }
.stat .value { font-family: var(--mono); font-size: 22px; margin-top: 6px; }
.stat .value.money { color: var(--gold-darker); }
.stat .value.warn { color: var(--amber); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }

/* item grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; transition: box-shadow .12s; text-decoration: none; color: var(--ink); display: block; }
.tile:hover { box-shadow: 0 2px 10px rgba(33,29,23,.12); text-decoration: none; }
.tile .thumb { height: 140px; background: #eae4d5 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--side-muted); font-size: 11px; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .body { padding: 10px 12px 12px; }
.tile .title { font-weight: 600; font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .meta { font-size: 11px; color: var(--side-muted); margin-top: 4px; }
.tile .est { font-family: var(--mono); font-size: 12px; color: var(--gold-darker); margin-top: 6px; }

/* badges */
.badge { display: inline-block; font-size: 10px; letter-spacing: .04em; border-radius: 4px; padding: 2px 7px; font-weight: 600; }
.badge.captured { background: #eae4d5; color: var(--side-muted); }
.badge.cataloged { background: #e3ead9; color: var(--green); }
.badge.needsreview { background: #f4e3c0; color: #8a6117; }
.badge.evaluated { background: #e0e6ef; color: #3b567e; }
.badge.listed { background: #efe0ea; color: #7e3b68; }
.badge.sold { background: #dcd6c8; color: var(--ink); }
.badge.returned { background: #eae4d5; color: var(--side-muted); }
.badge.ai { background: #211d17; color: var(--gold); }
.badge.human { background: #e3dcc9; color: var(--ink); }

/* filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filters input[type=text], .filters input[type=tel], .filters input[type=number], .filters select { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: var(--panel); }
.filters input[type=text] { min-width: 220px; }
.filters .chk, .opinion-checks .chk, .chk {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--side-muted); user-select: none;
}
.filters .chk input, .opinion-checks .chk input, .chk input { accent-color: var(--gold-dark); }
.opinion-checks { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

.tile-wrap { position: relative; }
.tile-wrap.selected .tile { outline: 2px solid var(--gold-dark); outline-offset: 1px; }
.tile-check {
    position: absolute; z-index: 2; top: 8px; left: 8px;
    background: rgba(255,255,255,.92); border-radius: 4px; padding: 2px 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12); cursor: pointer;
}
.tile-check input { width: 16px; height: 16px; accent-color: var(--gold-dark); margin: 0; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.btn.primary:hover { background: #332d23; }
.btn.danger { color: var(--red); border-color: #e0c4bc; }
.btn.danger:hover { background: #f8ebe7; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* capture dropzone */
.dropzone { border: 2px dashed var(--gold); border-radius: 10px; background: #faf7ef; padding: 48px 24px; text-align: center; color: var(--side-muted); margin-bottom: 20px; }
.dropzone.active { background: #f3ecd9; border-color: var(--gold-dark); }
.dropzone .big { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.dropzone .hint { font-size: 12px; }

/* tables */
table.list, table.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.list th, table.table th { text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.list td, table.table td { padding: 10px 12px; border-bottom: 1px solid #efe9da; vertical-align: middle; }
table.list tr:last-child td, table.table tr:last-child td { border-bottom: none; }
table.table tr.muted-row { opacity: .55; }
.mono { font-family: var(--mono); }

/* detail */
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.detail-grid .imgs img { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.flag-card { border-left: 3px solid var(--amber); background: #fbf6ea; border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; }
.flag-card .reason { margin: 6px 0; }
.flag-card .meta { font-size: 11px; color: var(--side-muted); }

.empty { text-align: center; color: var(--side-muted); padding: 40px 0; font-size: 13px; }
#blazor-error-ui { position: fixed; bottom: 0; left: 0; right: 0; background: #f4e3c0; padding: 10px 16px; z-index: 999; }
