/* =====================================================================
   FindIt - stylesheet
   Design rules and tokens are documented in docs/DESIGN.md.

   1. Fonts & tokens        8. Badges, tags, alerts
   2. Base                  9. Item & match cards
   3. Layout & shell       10. Tables
   4. Navigation & menus   11. Page-specific (home, login, item, claim review, admin)
   5. Page header          12. Pagination, empty states, stats, chart
   6. Buttons              13. Responsive
   7. Forms & toolbar      14. Reduced motion
   ===================================================================== */

/* ---------- 1. Fonts & tokens ---------- */
@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Sans";
    src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                   U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Brand */
    --pine-800: #11392f;
    --pine-700: #164a3e;
    --pine-600: #1d5c4d;
    --pine-500: #2b7563;
    --pine-100: #dcebe5;
    --pine-50: #eef5f2;
    --marigold-500: #f2a93b;
    --marigold-200: #f8d9a4;
    --marigold-100: #fdf0d5;

    /* Meaning */
    --clay-700: #8a3121;
    --clay-600: #a63d2a;
    --clay-100: #f6d9d1;
    --clay-50: #fbeae5;
    --sky-600: #1f5f8b;
    --sky-50: #e6f0f7;
    --plum-600: #5b4b8a;
    --plum-50: #eeebf6;
    --amber-700: #8a5300;
    --amber-50: #fdf0d5;

    /* Neutrals (warm stone) */
    --ink: #1f1d19;
    --n-700: #45413a;
    --n-600: #5e594d;
    --n-500: #6f695c;
    --n-300: #c4beaf;
    --n-200: #ddd8cc;
    --n-100: #ece9e1;
    --n-50: #f5f3ee;
    --paper: #fbfaf7;
    --white: #ffffff;

    /* Type */
    --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.5rem;

    /* Spacing (4px grid) */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
    --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

    /* Shape */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-pill: 999px;
    --border: 1px solid var(--n-200);

    /* Elevation: used sparingly (see DESIGN.md) */
    --shadow-sm: 0 1px 2px rgba(31, 29, 25, 0.06);
    --shadow-md: 0 6px 16px -6px rgba(31, 29, 25, 0.14), 0 1px 2px rgba(31, 29, 25, 0.05);
    --shadow-lg: 0 16px 40px -12px rgba(31, 29, 25, 0.22);

    /* Motion & focus */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --fast: 140ms;
    --focus: 0 0 0 2px var(--white), 0 0 0 4px var(--pine-600), 0 0 0 7px rgba(242, 169, 59, 0.45);

    /* Layout */
    --page-max: 1200px;
    --gutter: 24px;
    --topbar-h: 64px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-base); letter-spacing: -0.01em; }
p { margin: 0 0 var(--s-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--pine-600); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--pine-800); }

img, svg { display: block; max-width: 100%; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9em;
       background: var(--n-50); border: var(--border); padding: 1px 6px; border-radius: var(--r-sm); }
strong { font-weight: 650; }
small { font-size: var(--text-sm); }
hr { border: 0; border-top: var(--border); margin: var(--s-6) 0; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
main:focus { outline: none; }

.icon { width: 1.125em; height: 1.125em; flex-shrink: 0; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: var(--s-4); top: -60px; z-index: 100;
    background: var(--ink); color: var(--white); padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-3); color: var(--white); }

.muted { color: var(--n-600); }
.small { font-size: var(--text-sm); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.inline { display: inline; }

/* A link that makes its whole card clickable. */
.stretched { text-decoration: none; color: inherit; }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.stretched:focus-visible { box-shadow: none; }
.stretched:focus-visible::after { box-shadow: var(--focus); }

/* ---------- 3. Layout & shell ---------- */
.container { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.page { padding-top: var(--s-8); padding-bottom: var(--s-16); min-height: 70vh; }
.stack > * + * { margin-top: var(--s-6); }
.section { margin-top: var(--s-12); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); flex-wrap: wrap; }
.section-head a { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s-1); }
.section-head a:hover { text-decoration: underline; }

.panel { background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-6); }
.panel--tint { background: var(--pine-50); border-color: var(--pine-100); }
.panel h2 { font-size: var(--text-lg); margin-bottom: var(--s-4); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.panel-head h2 { margin: 0; }
.panel-head a { font-size: var(--text-sm); font-weight: 600; }
.panel-foot { margin-top: var(--s-4); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-5); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.split--wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* Top bar */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: var(--border);
    box-shadow: var(--shadow-sm);
}
.topbar__inner { display: flex; align-items: center; gap: var(--s-6); min-height: var(--topbar-h); }
.topbar__inner--wide { width: 100%; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo-mark { width: 32px; height: 32px; }
.logo-word { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.logo-word span { color: var(--pine-600); }

.site-footer { border-top: var(--border); background: var(--white); padding: var(--s-10) 0; color: var(--n-600); font-size: var(--text-sm); }
.site-footer__inner { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s-8); }
.site-footer__inner.topbar__inner--wide { max-width: none; }
.site-footer .logo-mark { width: 28px; height: 28px; }
.site-footer__brand { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s-2) var(--s-2); }
.site-footer__brand p { grid-column: 1 / -1; margin-top: var(--s-2); max-width: 36ch; }
.site-footer h2 { font-size: var(--text-sm); color: var(--ink); margin-bottom: var(--s-2); letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.site-footer a { color: var(--n-700); }
.site-footer a:hover { color: var(--pine-700); }

/* Admin workspace: sidebar + content */
.workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.side-nav { background: var(--white); border-right: var(--border); padding: var(--s-6) var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.side-nav__title { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-xs); font-weight: 650; text-transform: uppercase;
                   letter-spacing: 0.08em; color: var(--n-500); padding: 0 var(--s-3) var(--s-3); margin: 0; }
.side-nav nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav nav a {
    display: flex; align-items: center; gap: var(--s-3); padding: 9px var(--s-3); border-radius: var(--r-md);
    color: var(--n-700); text-decoration: none; font-weight: 550; font-size: var(--text-sm);
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.side-nav nav a span:first-of-type { flex: 1; }
.side-nav nav a:hover { background: var(--n-50); color: var(--ink); }
.side-nav nav a[aria-current="page"] { background: var(--pine-50); color: var(--pine-700); box-shadow: inset 3px 0 0 var(--pine-600); }
.side-nav .count { background: var(--marigold-500); color: var(--ink); font-size: var(--text-xs); font-weight: 700;
                   min-width: 22px; text-align: center; border-radius: var(--r-pill); padding: 1px 7px; font-variant-numeric: tabular-nums; }
.side-nav__cta { margin-top: var(--s-6); display: flex; align-items: center; gap: var(--s-2); padding: 10px var(--s-3);
                 border: 1px dashed var(--pine-500); border-radius: var(--r-md); color: var(--pine-700); font-weight: 600;
                 font-size: var(--text-sm); text-decoration: none; }
.side-nav__cta:hover { background: var(--pine-50); color: var(--pine-800); }
.workspace__main { padding: var(--s-8) clamp(var(--s-4), 3vw, var(--s-10)) var(--s-16); min-width: 0; }

/* ---------- 4. Navigation & menus ---------- */
.site-nav { display: flex; align-items: center; gap: var(--s-6); flex: 1; }
.primary-nav { display: flex; align-items: center; gap: var(--s-1); }
.primary-nav a {
    display: inline-flex; align-items: center; gap: var(--s-2); padding: 8px 12px; border-radius: var(--r-md);
    color: var(--n-700); font-weight: 550; text-decoration: none; font-size: 0.9375rem; position: relative;
    transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.primary-nav a:hover { color: var(--ink); background: var(--n-50); }
.primary-nav a[aria-current="page"] { color: var(--pine-700); }
.primary-nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--pine-600);
}
.nav-actions { display: flex; align-items: center; gap: var(--s-3); margin-left: auto; }
.nav-toggle { display: none; }

/* Dropdown menus built on <details> (work without JavaScript) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-caret { transform: rotate(90deg); width: 14px; height: 14px; opacity: 0.8; transition: transform var(--fast) var(--ease); }
.menu[open] .menu-caret { transform: rotate(-90deg); }
.menu__panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px;
    background: var(--white); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    padding: var(--s-2);
}
.menu__panel--wide { width: 340px; }
.menu__option { display: flex; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.menu__option:hover { background: var(--n-50); color: var(--ink); }
.menu__option strong { display: block; }
.menu__option small { display: block; color: var(--n-600); line-height: 1.4; margin-top: 2px; }
.menu__icon { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; }
.menu__icon--lost { background: var(--clay-50); color: var(--clay-600); }
.menu__icon--found { background: var(--pine-50); color: var(--pine-600); }
.menu__who { padding: var(--s-2) var(--s-3) var(--s-3); border-bottom: var(--border); margin-bottom: var(--s-2); }
.menu__who strong, .menu__who small { display: block; }
.menu__who small { color: var(--n-600); overflow-wrap: anywhere; }
.menu__link {
    display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: 9px var(--s-3); border-radius: var(--r-md);
    color: var(--n-700); font: inherit; font-size: var(--text-sm); font-weight: 550; text-decoration: none;
    background: none; border: 0; cursor: pointer; text-align: left;
}
.menu__link:hover { background: var(--n-50); color: var(--ink); }

.account-button { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 10px 4px 4px; border-radius: var(--r-pill);
                  border: var(--border); background: var(--white); font-weight: 600; font-size: var(--text-sm); }
.account-button:hover { border-color: var(--n-300); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--pine-100); color: var(--pine-700);
          display: grid; place-items: center; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.02em; }

/* ---------- 5. Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-6); flex-wrap: wrap; margin-bottom: var(--s-8); }
.page-header__text { max-width: 68ch; }
.page-header__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.eyebrow { font-size: var(--text-sm); color: var(--n-600); margin-bottom: var(--s-2); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.eyebrow a { color: var(--n-600); text-decoration: none; display: inline-flex; align-items: center; gap: var(--s-1); }
.eyebrow a:hover { color: var(--pine-700); text-decoration: underline; }
.lead { font-size: var(--text-lg); color: var(--n-600); margin-top: var(--s-2); }

/* ---------- 6. Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: 44px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent;
    font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--pine-600); color: var(--white); }
.btn-primary:hover { background: var(--pine-700); color: var(--white); }
.btn-secondary, .btn-outline { background: var(--white); color: var(--ink); border-color: var(--n-200); }
.btn-secondary:hover, .btn-outline:hover { border-color: var(--n-300); background: var(--n-50); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--n-700); }
.btn-ghost:hover { background: var(--n-50); color: var(--ink); }
.btn-danger { background: var(--clay-600); color: var(--white); }
.btn-danger:hover { background: var(--clay-700); color: var(--white); }
.btn-danger-outline { background: var(--white); color: var(--clay-600); border-color: var(--clay-100); }
.btn-danger-outline:hover { background: var(--clay-50); color: var(--clay-700); }
.btn-success { background: var(--pine-600); color: var(--white); }
.btn-success:hover { background: var(--pine-700); color: var(--white); }
.btn-lost { background: var(--clay-600); color: var(--white); }
.btn-lost:hover { background: var(--clay-700); color: var(--white); }
/* Small destructive buttons (in tables) are outlined; full-size ones are solid. */
.btn-sm.btn-danger { background: var(--white); color: var(--clay-600); border-color: var(--clay-100); }
.btn-sm.btn-danger:hover { background: var(--clay-50); color: var(--clay-700); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--text-sm); border-radius: var(--r-sm); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--pine-600); cursor: pointer; text-decoration: underline; }

/* ---------- 7. Forms & toolbar ---------- */
.form { display: grid; gap: var(--s-5); }
.form-section { display: grid; gap: var(--s-5); padding-top: var(--s-6); border-top: var(--border); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section__title { font-size: var(--text-base); display: flex; align-items: center; gap: var(--s-2); }
.form-section__title .step { width: 24px; height: 24px; border-radius: 50%; background: var(--pine-100); color: var(--pine-700);
                              display: inline-grid; place-items: center; font-size: var(--text-xs); font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .fieldset legend { font-weight: 600; font-size: var(--text-sm); color: var(--ink); }
.field .optional { font-weight: 400; color: var(--n-500); }
.hint { font-size: var(--text-sm); color: var(--n-600); margin: 0; }
.hint .icon { display: inline; vertical-align: -3px; width: 15px; height: 15px; margin-right: 4px; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=search], select, textarea {
    width: 100%; min-height: 44px; padding: 10px 12px;
    font: inherit; font-size: var(--text-base); color: var(--ink);
    background: var(--white); border: 1px solid var(--n-300); border-radius: var(--r-md);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; cursor: pointer;
         background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e594d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
         background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input::placeholder, textarea::placeholder { color: var(--n-500); }
input:hover, select:hover, textarea:hover { border-color: var(--n-500); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--pine-600); box-shadow: 0 0 0 3px rgba(29, 92, 77, 0.18); border-radius: var(--r-md); }

/* File input styled as a drop area */
.file-drop { position: relative; display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4);
             border: 1.5px dashed var(--n-300); border-radius: var(--r-lg); background: var(--n-50); }
.file-drop:hover { border-color: var(--pine-500); background: var(--pine-50); }
.file-drop:focus-within { border-color: var(--pine-600); box-shadow: 0 0 0 3px rgba(29, 92, 77, 0.18); }
.file-drop__icon { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--white); border: var(--border);
                   display: grid; place-items: center; color: var(--pine-600); flex-shrink: 0; }
.file-drop strong { display: block; }
.file-drop small { color: var(--n-600); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-note { color: var(--clay-600); font-size: var(--text-sm); margin: 0; min-height: 0; }
.photo-preview { max-height: 200px; width: auto; border-radius: var(--r-md); border: var(--border); }
.photo-preview[hidden] { display: none; }
.current-photo { display: flex; align-items: center; gap: var(--s-4); }
.current-photo img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-md); border: var(--border); }

/* Radio "cards" */
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.choice { position: relative; display: flex; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--n-300);
          border-radius: var(--r-md); background: var(--white); cursor: pointer; font-size: var(--text-sm); }
.choice:hover { border-color: var(--n-500); }
.choice input { margin: 2px 0 0; accent-color: var(--pine-600); width: 18px; height: 18px; flex-shrink: 0; }
.choice strong { display: block; font-size: var(--text-base); }
.choice span span { color: var(--n-600); }
.choice:has(input:checked) { border-color: var(--pine-600); background: var(--pine-50); box-shadow: inset 0 0 0 1px var(--pine-600); }
.check { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); cursor: pointer; }
.check input { accent-color: var(--pine-600); width: 18px; height: 18px; }

/* "Private" field: visually different so finders know it stays hidden */
.private-field { padding: var(--s-4); border-radius: var(--r-lg); background: var(--marigold-100); border: 1px solid var(--marigold-200); }
.private-field > label { display: flex; align-items: center; gap: var(--s-2); }

.form-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; padding-top: var(--s-2); }
.form-actions .hint { flex-basis: 100%; }

/* Segmented control (Found / Lost tabs) */
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 4px; gap: 4px; background: var(--n-100); border-radius: var(--r-pill); }
.segmented a { flex-shrink: 0; white-space: nowrap; }
.segmented a { display: inline-flex; align-items: center; gap: var(--s-2); padding: 8px 18px; border-radius: var(--r-pill);
               color: var(--n-700); font-weight: 600; text-decoration: none; font-size: 0.9375rem; }
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="page"] { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--n-200); }
.segmented a[aria-current="page"] .icon { color: var(--pine-600); }
.segmented a.seg-lost[aria-current="page"] .icon { color: var(--clay-600); }
.segmented--spaced { margin-bottom: var(--s-6); }

/* Filter toolbar */
.toolbar { background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-4); margin-bottom: var(--s-6); }
.toolbar__row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.toolbar .field { flex: 1 1 150px; gap: 4px; }
.toolbar .field > label { font-size: var(--text-xs); font-weight: 600; color: var(--n-600); text-transform: uppercase; letter-spacing: 0.04em; }
.toolbar .field--search { flex: 3 1 260px; }
.toolbar .field--date { flex: 1 1 140px; }
.toolbar__actions { display: flex; gap: var(--s-2); }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--n-500); pointer-events: none; }
.search-input input { padding-left: 40px; }
.toolbar__more { display: contents; }
.toolbar__toggle { display: none; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); color: var(--n-600); font-size: var(--text-sm); }
.results-bar strong { color: var(--ink); }
.filter-chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.filter-chip { background: var(--pine-50); color: var(--pine-700); border-radius: var(--r-pill); padding: 2px 10px; font-weight: 600; }

/* ---------- 8. Badges, tags, alerts ---------- */
.badge, .tag {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    font-size: var(--text-xs); font-weight: 650; line-height: 1; letter-spacing: 0.01em;
    padding: 5px 8px 5px 7px; border-radius: var(--r-sm);
    background: var(--n-100); color: var(--n-700);
}
.badge .icon, .tag .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.badge-open      { background: var(--sky-50);   color: var(--sky-600); }
.badge-matched   { background: var(--plum-50);  color: var(--plum-600); }
.badge-claimed   { background: var(--amber-50); color: var(--amber-700); }
.badge-returned  { background: var(--pine-50);  color: var(--pine-700); }
.badge-closed    { background: var(--n-100);    color: var(--n-600); }
.badge-pending   { background: var(--amber-50); color: var(--amber-700); }
.badge-approved  { background: var(--pine-50);  color: var(--pine-700); }
.badge-rejected  { background: var(--clay-50);  color: var(--clay-700); }
.badge-collected { background: var(--n-100);    color: var(--n-700); }
.badge-admin     { background: var(--marigold-100); color: var(--amber-700); }
.badge-user, .badge-student, .badge-staff { background: var(--n-50); color: var(--n-700); box-shadow: inset 0 0 0 1px var(--n-200); }
.badge-lost  { background: var(--clay-50); color: var(--clay-700); }
.badge-found { background: var(--pine-50); color: var(--pine-700); }

.tag { border-radius: var(--r-pill); padding: 5px 10px 5px 8px; }
.tag-lost  { background: var(--clay-600); color: var(--white); }
.tag-found { background: var(--pine-600); color: var(--white); }

.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); margin-bottom: var(--s-5);
         border-radius: var(--r-md); border: 1px solid; font-size: 0.9375rem; }
.alert > .icon { width: 20px; height: 20px; margin-top: 1px; }
.alert__body { flex: 1; min-width: 0; }
.alert ul { margin: var(--s-1) 0 0; padding-left: 1.1rem; }
.alert-success { background: var(--pine-50);  border-color: var(--pine-100);  color: var(--pine-800); }
.alert-danger  { background: var(--clay-50);  border-color: var(--clay-100);  color: var(--clay-700); }
.alert-warning { background: var(--amber-50); border-color: var(--marigold-200); color: #6b4100; }
.alert-info    { background: var(--sky-50);   border-color: #c9dceb;           color: #174a6d; }
.alert a { color: inherit; font-weight: 600; }

/* ---------- 9. Item & match cards ---------- */
.item-card {
    position: relative; display: flex; flex-direction: column; background: var(--white);
    border: var(--border); border-radius: var(--r-lg); overflow: hidden;
    transition: box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.item-card:hover { box-shadow: var(--shadow-md); border-color: var(--n-300); }
.item-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--n-50); border-bottom: var(--border); }
.item-card__media .tag { position: absolute; left: var(--s-3); top: var(--s-3); }
.item-media { width: 100%; height: 100%; object-fit: cover; }
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
               color: var(--n-500); background: var(--n-50); font-size: var(--text-sm); font-weight: 550; }
.placeholder-icon { width: 44px; height: 44px; stroke-width: 1.5; color: var(--n-600); background: var(--white);
                    padding: 10px; border-radius: 50%; box-sizing: content-box; border: var(--border); }
.item-card--lost .placeholder-icon { color: var(--clay-600); }
.item-card--found .placeholder-icon { color: var(--pine-600); }
.item-card__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.item-card__title { font-size: var(--text-base); font-weight: 650; }
.item-card__title a:hover { text-decoration: underline; }
.meta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--n-600); font-size: var(--text-sm); }
.meta-list li { display: flex; align-items: center; gap: 6px; }
.meta-list .icon { width: 15px; height: 15px; color: var(--n-500); }
.item-card__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin-top: auto; padding-top: var(--s-2); }
.item-card__cat { font-size: var(--text-xs); color: var(--n-500); text-align: right; }

.match-list { display: grid; gap: var(--s-3); }
.match-list--grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.match-card { position: relative; display: flex; gap: var(--s-4); padding: var(--s-3); background: var(--white);
              border: var(--border); border-radius: var(--r-lg); transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.match-card:hover { border-color: var(--n-300); box-shadow: var(--shadow-md); }
.match-card__thumb { width: 92px; height: 92px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; border: var(--border); }
.match-card__thumb.placeholder span { display: none; }
.match-card__thumb .placeholder-icon { width: 28px; height: 28px; padding: 8px; }
.match-card__body { flex: 1; min-width: 0; display: grid; gap: 4px; align-content: start; }
.match-card__top { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.match-card__title { font-size: var(--text-base); margin-top: 2px; }
.match-card__title a:hover { text-decoration: underline; }
.match-card__meta { font-size: var(--text-sm); color: var(--n-600); margin: 0; }
.score { margin-top: var(--s-2); }
.score__head { display: flex; justify-content: space-between; font-size: var(--text-sm); gap: var(--s-2); }
.score__label { font-weight: 700; font-variant-numeric: tabular-nums; }
.score__level { color: var(--n-600); }
.score__bar { height: 6px; background: var(--n-100); border-radius: var(--r-pill); overflow: hidden; margin: 6px 0; }
.score__bar span { display: block; height: 100%; border-radius: inherit; background: var(--pine-600); }
.score--good .score__bar span { background: var(--pine-500); }
.score--fair .score__bar span { background: var(--marigold-500); }
.score__why { font-size: var(--text-xs); color: var(--n-600); margin: 0; }

/* ---------- 10. Tables ---------- */
.table-card { background: var(--white); border: var(--border); border-radius: var(--r-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-weight: 600; color: var(--n-600); background: var(--n-50); padding: 10px var(--s-4);
            border-bottom: var(--border); white-space: nowrap; }
.table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--n-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fdfcfa; }
.table .cell-main { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.table .cell-main a { font-weight: 600; color: var(--ink); text-decoration: none; }
.table .cell-main a:hover { color: var(--pine-700); text-decoration: underline; }
.cell-sub { display: block; color: var(--n-600); font-size: var(--text-xs); font-weight: 400; margin-top: 2px; }
.table .num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form, .table .actions a { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.table .empty-row { text-align: center; color: var(--n-600); padding: var(--s-10); }
.thumb-sm { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; border: var(--border); }
.thumb-sm.placeholder span { display: none; }
.thumb-sm .placeholder-icon { width: 20px; height: 20px; padding: 0; border: 0; background: none; }
.inline-form { display: inline-flex; gap: var(--s-2); align-items: center; }
.inline-form select, .inline-form input[type=text] { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: var(--text-sm); width: auto; }
.inline-form input[type=text] { min-width: 180px; }

/* ---------- 11. Page-specific ---------- */

/* Home */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-10); align-items: center; padding: var(--s-6) 0 var(--s-10); }
.home-hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; max-width: 16ch; }
.home-hero h1 em { font-style: normal; color: var(--pine-600); }
.home-hero .lead { max-width: 52ch; margin-top: var(--s-4); }
.hero-search { margin-top: var(--s-6); display: flex; gap: var(--s-2); background: var(--white); border: 1px solid var(--n-300);
               border-radius: var(--r-lg); padding: 6px; max-width: 560px; box-shadow: var(--shadow-sm); }
.hero-search:focus-within { border-color: var(--pine-600); box-shadow: 0 0 0 3px rgba(29, 92, 77, 0.18); }
.hero-search .search-input { flex: 1; }
.hero-search input { border: 0; min-height: 44px; box-shadow: none !important; }
.hero-links { margin-top: var(--s-4); display: flex; gap: var(--s-5); flex-wrap: wrap; font-size: var(--text-sm); color: var(--n-600); }
.hero-links a { font-weight: 600; display: inline-flex; align-items: center; gap: var(--s-1); }
.hero-board { background: var(--white); border: var(--border); border-radius: var(--r-xl); padding: var(--s-6); }
.hero-board h2 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.08em; color: var(--n-500); margin-bottom: var(--s-4); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: var(--border); padding-bottom: var(--s-5); margin-bottom: var(--s-4); }
.hero-stats div + div { border-left: var(--border); padding-left: var(--s-4); }
.hero-stats strong { display: block; font-size: var(--text-3xl); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.hero-stats span { font-size: var(--text-sm); color: var(--n-600); }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.recent-list li { position: relative; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2); border-radius: var(--r-md); }
.recent-list li:hover { background: var(--n-50); }
.recent-list .thumb-sm { width: 40px; height: 40px; }
.recent-list__text { min-width: 0; flex: 1; }
.recent-list a { font-weight: 600; font-size: var(--text-sm); }
.recent-list small { display: block; color: var(--n-600); font-size: var(--text-xs); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: var(--border); border-radius: var(--r-xl); }
.how li { list-style: none; padding: var(--s-6); display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-4); }
.how li + li { border-left: var(--border); }
.how { padding: 0; margin: 0; counter-reset: step; }
.how__num { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
            font-weight: 700; color: var(--pine-700); background: var(--pine-50); border: 1px solid var(--pine-100); }
.how h3 { font-size: var(--text-base); }
.how p { color: var(--n-600); font-size: var(--text-sm); margin: 0; }

.lost-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-3); }

/* Login / register split */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 620px; background: var(--white);
        border: var(--border); border-radius: var(--r-xl); overflow: hidden; }
.auth__aside { background: var(--pine-700); color: #e6f0ec; padding: var(--s-10); display: flex; flex-direction: column; gap: var(--s-6); position: relative; }
.auth__aside h2 { color: var(--white); font-size: var(--text-2xl); line-height: 1.25; max-width: 18ch; }
.auth__aside .logo-word { color: var(--white); }
.auth__aside .logo-word span { color: var(--marigold-500); }
.auth__aside .logo-mark rect { fill: var(--pine-800); }
.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.auth__points li { display: flex; gap: var(--s-3); font-size: 0.9375rem; line-height: 1.45; }
.auth__points .icon { width: 20px; height: 20px; color: var(--marigold-500); margin-top: 1px; }
.auth__points strong { color: var(--white); display: block; }
.auth__note { margin-top: auto; font-size: var(--text-sm); color: #b9d1c8; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: var(--s-4); }
.auth__main { padding: var(--s-10) clamp(var(--s-6), 5vw, var(--s-16)); display: flex; flex-direction: column; justify-content: center; gap: var(--s-6); }
.auth__main h1 { font-size: var(--text-3xl); }
.auth__main .form { max-width: 420px; }
.auth__switch { font-size: var(--text-sm); color: var(--n-600); }
.demo { max-width: 420px; border-top: var(--border); padding-top: var(--s-5); }
.demo h2 { font-size: var(--text-sm); margin-bottom: var(--s-1); }
.demo p { font-size: var(--text-sm); color: var(--n-600); }
.demo__list { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.demo__btn { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left; padding: 10px var(--s-3);
             border: var(--border); border-radius: var(--r-md); background: var(--white); font: inherit; cursor: pointer; color: var(--ink); }
.demo__btn:hover { border-color: var(--pine-500); background: var(--pine-50); }
.demo__btn .avatar { width: 34px; height: 34px; }
.demo__btn span span { display: block; font-size: var(--text-sm); color: var(--n-600); }
.demo__btn code { margin-left: auto; font-size: var(--text-xs); }
.demo__more { font-size: var(--text-xs); color: var(--n-600); margin-top: var(--s-3); }

/* Report / claim forms */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-8); align-items: start; }
.form-card { background: var(--white); border: var(--border); border-radius: var(--r-xl); padding: var(--s-8); }
.form-aside { position: sticky; top: calc(var(--topbar-h) + var(--s-6)); display: grid; gap: var(--s-4); }
.tips { background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-5); font-size: var(--text-sm); }
.tips h2 { font-size: var(--text-sm); margin-bottom: var(--s-3); display: flex; gap: var(--s-2); align-items: center; }
.tips ul { margin: 0; padding-left: 1.1rem; display: grid; gap: var(--s-2); color: var(--n-700); }
.tips--private { background: var(--marigold-100); border-color: var(--marigold-200); }

/* Item detail */
.item-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s-10); align-items: start; }
.item-detail__photo { position: sticky; top: calc(var(--topbar-h) + var(--s-6)); aspect-ratio: 4 / 3; border-radius: var(--r-xl);
                      overflow: hidden; border: var(--border); background: var(--n-50); }
.item-detail__photo .placeholder-icon { width: 72px; height: 72px; padding: 20px; }
.item-detail__photo .placeholder span { font-size: var(--text-base); }
.item-detail__head { display: grid; gap: var(--s-3); }
.item-detail__badges { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.item-detail h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.item-detail .description { font-size: var(--text-lg); color: var(--n-700); margin-top: var(--s-2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: var(--s-6) 0; border: var(--border); border-radius: var(--r-lg); background: var(--white); }
.facts > div { padding: var(--s-4); border-bottom: var(--border); }
.facts > div:nth-child(odd) { border-right: var(--border); }
.facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.facts dt { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--n-600); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.facts dt .icon { width: 15px; height: 15px; color: var(--n-500); }
.facts dd { margin: 4px 0 0; font-weight: 550; }
.claim-wait { margin-top: var(--s-3); }
.secret { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); background: var(--marigold-100); border: 1px solid var(--marigold-200); margin-bottom: var(--s-4); }
.secret > .icon { width: 20px; height: 20px; color: var(--amber-700); margin-top: 2px; }
.secret strong { display: block; }
.secret p { margin: var(--s-1) 0; }
.secret small { color: #6b4100; }
.secret--admin { background: var(--n-50); border-color: var(--n-200); }
.secret--admin > .icon { color: var(--n-600); }
.cta-box { border: 1px solid var(--pine-100); background: var(--pine-50); border-radius: var(--r-lg); padding: var(--s-5); display: grid; gap: var(--s-3); }
.cta-box h2 { font-size: var(--text-lg); }
.cta-box p { color: var(--n-700); margin: 0; font-size: 0.9375rem; }
.cta-box--lost { background: var(--clay-50); border-color: var(--clay-100); }
.cta-box .btn { justify-self: start; }
.owner-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

/* Claim review (admin) */
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5); align-items: stretch; }
.review__col { background: var(--white); border: var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.review__head { padding: var(--s-4) var(--s-5); border-bottom: var(--border); display: flex; align-items: center; gap: var(--s-3); background: var(--n-50); }
.review__head h2 { font-size: var(--text-base); }
.review__head .icon { width: 20px; height: 20px; color: var(--n-600); }
.review__body { padding: var(--s-5); display: grid; gap: var(--s-4); align-content: start; }
.review dl { margin: 0; display: grid; gap: var(--s-4); }
.review dt { font-size: var(--text-xs); color: var(--n-600); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.review dd { margin: 0; }
.compare-key { padding: var(--s-4); border-radius: var(--r-md); background: var(--marigold-100); border: 1px solid var(--marigold-200); }
.compare-key--claim { background: var(--pine-50); border-color: var(--pine-100); }
.compare-key dt { color: var(--ink); display: flex; gap: var(--s-2); align-items: center; }
.compare-key dd { font-size: var(--text-lg); font-weight: 550; line-height: 1.4; }
.review-summary { display: flex; align-items: center; gap: var(--s-4); background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-5); flex-wrap: wrap; }
.review-summary .thumb-sm { width: 56px; height: 56px; }
.review-summary__text { flex: 1; min-width: 200px; }
.decision { margin-top: var(--s-5); }
.decision textarea { min-height: 80px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); font-size: var(--text-sm); }
.timeline li { display: flex; gap: var(--s-3); }
.timeline .icon { width: 18px; height: 18px; color: var(--pine-600); margin-top: 1px; }

/* Claims list (user) */
.claim-list { display: grid; gap: var(--s-3); }
.claim-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: start;
             background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-4); }
.claim-row .thumb-sm { width: 64px; height: 64px; }
.claim-row h3 { font-size: var(--text-base); }
.claim-row .alert { margin: var(--s-3) 0 0; }
.claim-steps { display: flex; gap: var(--s-1); margin-top: var(--s-3); list-style: none; padding: 0; font-size: var(--text-xs); color: var(--n-500); flex-wrap: wrap; }
.claim-steps li { display: flex; align-items: center; gap: 4px; }
.claim-steps li + li::before { content: ""; width: 16px; height: 1px; background: var(--n-300); margin-right: 4px; }
.claim-steps .done { color: var(--pine-700); font-weight: 600; }
.claim-steps .stop { color: var(--clay-700); font-weight: 600; }
.claim-steps .icon { width: 14px; height: 14px; }

/* Dashboard */
.greeting { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-8); }
.match-group + .match-group { margin-top: var(--s-6); }
.match-group__for { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); color: var(--n-600); margin-bottom: var(--s-3); flex-wrap: wrap; }
.match-group__for a { font-weight: 650; color: var(--ink); }

/* Admin overview */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--n-100); font-size: var(--text-sm); }
.activity li:last-child { border-bottom: 0; }
.activity .avatar { width: 28px; height: 28px; font-size: 10px; grid-row: span 2; }
.activity time { color: var(--n-500); font-size: var(--text-xs); }
.activity a { font-weight: 600; }

/* ---------- 12. Pagination, empty states, stats, chart ---------- */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: var(--s-8); }
.pagination a, .pagination .is-disabled { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 38px; min-width: 38px;
                                          justify-content: center; padding: 0 var(--s-3); border-radius: var(--r-md); font-weight: 600;
                                          font-size: var(--text-sm); text-decoration: none; color: var(--n-700); }
.pagination a:hover { background: var(--n-100); color: var(--ink); }
.pagination a[aria-current="page"] { background: var(--ink); color: var(--white); }
.pagination .is-disabled { color: var(--n-300); }
.pagination__pages { display: flex; gap: 2px; }

.empty { text-align: center; padding: var(--s-12) var(--s-6); background: var(--white); border: 1px dashed var(--n-300); border-radius: var(--r-lg); }
.empty__icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto var(--s-4);
               background: var(--pine-50); color: var(--pine-600); }
.empty__icon .icon { width: 26px; height: 26px; }
.empty h3 { font-size: var(--text-lg); margin-bottom: var(--s-2); }
.empty p { color: var(--n-600); max-width: 46ch; margin: 0 auto; }
.empty__actions { margin-top: var(--s-5); display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.empty--compact { padding: var(--s-6); text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s-4); align-items: center; }
.empty--compact .empty__icon { margin: 0; grid-row: span 3; width: 44px; height: 44px; }
.empty--compact p { margin: 0; }
.empty--compact .empty__actions { justify-content: flex-start; margin-top: var(--s-3); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-6); }
.stat { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 2px var(--s-2);
        background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5);
        color: var(--ink); text-decoration: none; }
.stat__icon { grid-column: 2; grid-row: 1 / span 2; color: var(--n-500); }
.stat__icon .icon { width: 20px; height: 20px; }
.stat__value { grid-column: 1; grid-row: 1; font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat__label { grid-column: 1; font-size: var(--text-sm); color: var(--n-600); }
.stat__note { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--n-500); margin-top: var(--s-1); }
a.stat:hover { border-color: var(--pine-500); color: var(--ink); }
.stat--action { background: var(--marigold-100); border-color: var(--marigold-200); }
.stat--action .stat__icon { color: var(--amber-700); }
.stat--good .stat__value { color: var(--pine-700); }

.chart { width: 100%; max-width: 560px; height: auto; font-family: var(--font); }
.chart__label { font-size: 13.5px; fill: var(--n-700); }
.chart__value { font-size: 13.5px; font-weight: 650; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart__track { fill: var(--n-50); }
.chart__found { fill: var(--pine-600); }
.chart__lost { fill: url(#hatch-lost); }
.chart__lost-bg { fill: var(--clay-50); }
.chart__lost-line { stroke: var(--clay-600); stroke-width: 3; }
.chart-legend { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); color: var(--n-600); margin-top: var(--s-4); }
.key { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.key--found { background: var(--pine-600); margin-left: var(--s-3); }
.key--lost { background: repeating-linear-gradient(45deg, var(--clay-600) 0 2px, var(--clay-50) 2px 5px); border: 1px solid var(--clay-600); }

/* ---------- 13. Responsive ---------- */
@media (max-width: 1080px) {
    .workspace { grid-template-columns: 1fr; }
    .side-nav { border-right: 0; border-bottom: var(--border); padding: var(--s-2) var(--gutter); flex-direction: row; align-items: center; overflow-x: auto; gap: var(--s-2); }
    .side-nav__title { display: none; }
    .side-nav nav { flex-direction: row; gap: 2px; }
    .side-nav nav a { white-space: nowrap; }
    .side-nav nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--pine-600); }
    .side-nav__cta { margin: 0 0 0 auto; white-space: nowrap; }
    .form-layout { grid-template-columns: 1fr; }
    .form-aside { position: static; }
}

@media (max-width: 900px) {
    :root { --gutter: 16px; }
    .nav-toggle { display: inline-flex; align-items: center; gap: var(--s-2); margin-left: auto; min-height: 40px; padding: 0 12px;
                  border: var(--border); border-radius: var(--r-md); background: var(--white); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
    .js .site-nav { display: none; }
    .site-nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: var(--s-4);
                background: var(--white); border-bottom: var(--border); box-shadow: var(--shadow-lg); padding: var(--s-4) var(--gutter) var(--s-6); }
    .no-js .site-nav { position: static; box-shadow: none; border: 0; padding: 0 0 var(--s-4); }
    .no-js .topbar__inner { flex-wrap: wrap; }
    .nav-open .site-nav { display: flex; }
    .primary-nav { flex-direction: column; align-items: stretch; }
    .primary-nav a { padding: 12px; }
    .primary-nav a[aria-current="page"] { background: var(--pine-50); }
    .primary-nav a[aria-current="page"]::after { display: none; }
    .nav-actions { flex-direction: column; align-items: stretch; margin: 0; }
    .nav-actions .menu > summary { width: 100%; justify-content: center; }
    .menu__panel { position: static; width: auto; box-shadow: none; margin-top: var(--s-2); }
    .menu__panel--wide { width: auto; }
    .account-button { width: 100%; justify-content: flex-start; padding: 6px 12px 6px 6px; }

    .home-hero, .split, .split--wide-left, .item-detail, .review, .auth { grid-template-columns: 1fr; }
    .home-hero { gap: var(--s-6); padding-top: 0; }
    .item-detail { gap: var(--s-6); }
    .item-detail__photo { position: static; }
    .auth__aside { padding: var(--s-6); }
    .auth__points { display: none; }
    .auth__note { display: none; }
    .auth__main { padding: var(--s-6); }
    .site-footer__inner { grid-template-columns: 1fr; gap: var(--s-6); }
}

@media (max-width: 720px) {
    h1 { font-size: var(--text-2xl); }
    .page { padding-top: var(--s-6); }
    .page-header { margin-bottom: var(--s-6); }
    .lead { font-size: var(--text-base); }
    .form-row, .choice-row { grid-template-columns: 1fr; }
    .form-card { padding: var(--s-5); border-radius: var(--r-lg); }
    .how { grid-template-columns: 1fr; }
    .how li + li { border-left: 0; border-top: var(--border); }
    .facts { grid-template-columns: 1fr; }
    .facts > div:nth-child(odd) { border-right: 0; }
    .facts > div:nth-last-child(2) { border-bottom: var(--border); }
    .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: var(--s-3); }
    .item-card__body { padding: var(--s-3); }
    .item-card__cat { display: none; }
    .item-card .placeholder span { display: none; }
    .item-card .placeholder-icon { width: 30px; height: 30px; padding: 9px; margin-top: var(--s-4); }
    .match-list--grid, .lost-board { grid-template-columns: 1fr; }
    .match-card__thumb { width: 72px; height: 72px; }
    .claim-row { grid-template-columns: auto minmax(0, 1fr); }
    .claim-row > .badge { grid-column: 2; grid-row: 1; justify-self: end; }
    .pagination span span, .pagination a span { display: none; }

    /* Toolbar: search always visible, other filters behind the "Filters" button */
    .toolbar__toggle { display: inline-flex; flex: 1 1 auto; }
    .toolbar__more { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); flex-basis: 100%; }
    .js .toolbar:not(.is-open) .toolbar__more { display: none; }
    .toolbar__actions { flex: 1 1 auto; }
    .toolbar__actions .btn { flex: 1; }

    /* Tables turn into stacked cards */
    .table-card { background: transparent; border: 0; border-radius: 0; overflow: visible; }
    .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { background: var(--white); border: var(--border); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3); }
    .table tbody tr:hover td { background: none; }
    .table td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); text-align: right; }
    .table td[data-label]::before { content: attr(data-label); font-size: var(--text-xs); font-weight: 600; color: var(--n-600);
                                     text-transform: uppercase; letter-spacing: 0.04em; text-align: left; flex-shrink: 0; }
    .table td.cell-primary { display: block; text-align: left; padding-bottom: var(--s-2); border-bottom: 1px solid var(--n-100); margin-bottom: var(--s-1); }
    .table td.cell-primary::before { display: none; }
    .table .actions { justify-content: flex-end; flex-wrap: wrap; padding-top: var(--s-3); white-space: normal; }
    .table .actions::before { display: none; }
    .table .empty-row { display: block; }
    .inline-form { flex-wrap: wrap; justify-content: flex-end; }
    .inline-form input[type=text] { min-width: 0; flex: 1; }
    .review-summary { padding: var(--s-4); }
}

@media (max-width: 420px) {
    .hero-stats strong { font-size: var(--text-2xl); }
    .toolbar__more { grid-template-columns: 1fr; }
    .hero-search { flex-direction: column; }
    .hero-search .btn { width: 100%; }
}

/* ---------- 14. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
