/* CERT brand (brandpad.io/cert): Amina (primary), Reckless Neue (secondary serif).
   Fonts are licensed - drop the woff2 files into /public/fonts to use them; otherwise the fallbacks below are used. */
@font-face { font-family: "Amina"; src: url("/static/fonts/Amina-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Amina"; src: url("/static/fonts/Amina-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amina"; src: url("/static/fonts/Amina-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Reckless Neue"; src: url("/static/fonts/RecklessNeue-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Reckless Neue"; src: url("/static/fonts/RecklessNeue-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  /* core */
  --black: #12110C; --white: #FFFFFF;
  /* neutrals */
  --stone: #ECEAE8; --stone-2: #CECBC3; --taupe: #C2BAB1; --grey: #8D8C85; --grey-2: #706F6F; --umber: #5C5753;
  --sand: #EFDFD1; --clay: #D3AEA0;
  --slate: #424950; --slate-2: #2F333C; --navy: #373F54; --navy-2: #212135;
  /* accents */
  --coral: #EC6754; --coral-2: #EE8C6C; --teal: #236E88; --aqua: #85CCD1; --yellow: #FFC930; --yellow-2: #FFF6A0;
  --sans: "Amina", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Reckless Neue", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-weight: 400; color: var(--black); background: var(--white); font-size: 15px; line-height: 1.45; }
a { color: var(--black); text-decoration-color: var(--taupe); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--coral); }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; letter-spacing: -0.01em; margin: 0 0 .4em; }
h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 22px; margin-top: 1.4em; }
h3 { font-size: 17px; }
small, .muted { color: var(--grey-2); }

/* layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--black) 230px, var(--white) 230px); }
.side { background: var(--black); color: var(--white); padding: 22px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; text-decoration: none; color: var(--white); }
.brand img { width: 46px; height: 46px; filter: invert(1); }
.brand .name { font-weight: 500; font-size: 15px; letter-spacing: -0.02em; }
.beta { display: inline-block; background: var(--coral); color: var(--black); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; vertical-align: middle; }
.nav a { display: block; color: var(--stone); text-decoration: none; padding: 8px 10px; margin: 1px 0; border-left: 2px solid transparent; font-size: 14px; }
.nav a:hover { color: var(--white); border-left-color: var(--grey); }
.nav a.on { color: var(--white); border-left-color: var(--coral); background: rgba(255,255,255,.05); }
.side .me { margin-top: auto; font-size: 12px; color: var(--taupe); }
.side .me button { background: none; border: 0; color: var(--stone-2); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.main { padding: 26px 34px 60px; max-width: 1280px; }
.topbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.topbar form { flex: 1; max-width: 460px; }
.crumbs { font-size: 13px; color: var(--grey-2); margin-bottom: 6px; }
.crumbs a { color: var(--grey-2); }
.beta-bar { background: var(--yellow-2); border-bottom: 1px solid var(--yellow); font-size: 12.5px; padding: 6px 34px; color: var(--umber); }

/* components */
.grid { display: grid; gap: 14px; }
.grid.k5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid.c2 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.grid.h2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card { border: 1px solid var(--stone-2); padding: 16px 18px; background: var(--white); }
.card.dark { background: var(--black); color: var(--white); border-color: var(--black); }
.card.sand { background: var(--sand); border-color: var(--sand); }
.kpi .n { font-family: var(--serif); font-size: 36px; font-weight: 300; line-height: 1; }
.kpi .l { font-size: 12.5px; color: var(--grey-2); margin-top: 6px; }
.card.dark .l { color: var(--taupe); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--grey-2); border-bottom: 1px solid var(--black); padding: 8px 8px; }
td { border-bottom: 1px solid var(--stone); padding: 9px 8px; vertical-align: top; }
tr:hover td { background: #faf9f8; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: var(--stone); color: var(--umber); white-space: nowrap; }
.pill.todo { background: var(--stone); } .pill.in_progress { background: var(--aqua); color: var(--black); }
.pill.done { background: var(--black); color: var(--white); } .pill.cant_do { background: var(--stone-2); }
.pill.urgent { background: var(--coral); color: var(--black); } .pill.high { background: var(--coral-2); color: var(--black); }
.pill.low { background: var(--white); border: 1px solid var(--stone-2); }
.pill.live { background: var(--teal); color: var(--white); }
.pill.faulty, .pill.out_of_service { background: var(--coral); color: var(--black); }
.overdue { color: var(--coral); font-weight: 500; }
.src { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--grey); }

/* forms */
input, select, textarea { font: inherit; border: 1px solid var(--stone-2); padding: 8px 10px; background: var(--white); color: var(--black); width: 100%; border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--coral); outline-offset: -1px; border-color: var(--coral); }
label { display: block; font-size: 12.5px; color: var(--grey-2); margin: 10px 0 4px; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
button, .btn { font: inherit; font-weight: 500; background: var(--black); color: var(--white); border: 1px solid var(--black); padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-block; border-radius: 0; }
button:hover, .btn:hover { background: var(--slate-2); }
button.ghost, .btn.ghost { background: var(--white); color: var(--black); }
button.coral { background: var(--coral); border-color: var(--coral); color: var(--black); }
details.add { margin: 10px 0; }
details.add > summary { cursor: pointer; display: inline-block; font-weight: 500; font-size: 14px; border-bottom: 1px solid var(--coral); list-style: none; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] { border: 1px solid var(--stone-2); padding: 12px 14px; }
.flash { background: var(--sand); border-left: 3px solid var(--coral); padding: 10px 14px; margin-bottom: 16px; }
.note { border-left: 2px solid var(--stone-2); padding: 6px 0 6px 12px; margin: 10px 0; white-space: pre-wrap; }
.note.call { border-left-color: var(--teal); } .note.email { border-left-color: var(--aqua); } .note.arthur { border-left-color: var(--taupe); }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--stone-2); margin: 18px 0 6px; font-size: 14px; }
.tabs a { text-decoration: none; padding: 8px 0; color: var(--grey-2); border-bottom: 2px solid transparent; }
.tabs a.on, .tabs a:hover { color: var(--black); border-bottom-color: var(--coral); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--grey-2); }
.empty { color: var(--grey); font-size: 14px; padding: 6px 0; }
.qr { border: 1px solid var(--stone-2); padding: 10px; text-align: center; }
.keybox { font-family: ui-monospace, monospace; background: var(--black); color: var(--yellow); padding: 10px; word-break: break-all; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .panel { background: var(--black); color: var(--white); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login .panel img { width: 120px; filter: invert(1); }
.login .panel h1 { font-size: 46px; max-width: 12ch; }
.login .form { padding: 56px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; }
.gbtn { display: inline-flex; gap: 10px; align-items: center; background: var(--white); color: var(--black); border: 1px solid var(--black); padding: 12px 18px; font-weight: 500; text-decoration: none; }
.gbtn:hover { background: var(--stone); }
.err { color: var(--coral); margin: 12px 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: var(--white); } .side { position: static; height: auto; }
  .grid.k5, .grid.c2, .grid.h2 { grid-template-columns: 1fr 1fr; } .main { padding: 18px; }
  .login { grid-template-columns: 1fr; }
}

/* contractors & work orders */
.nav a.sub { padding-left: 28px; font-size: 13.5px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 14px; margin: 6px 0 4px; }
.checks label { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 13.5px; color: var(--black); cursor: pointer; }
.checks input { width: auto; margin: 0; accent-color: var(--coral); }
.inline-check { display: flex; gap: 8px; align-items: center; color: var(--black); font-size: 14px; }
.inline-check input { width: auto; accent-color: var(--coral); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill.disc { background: var(--sand); color: var(--black); }
.pill.approved { background: var(--teal); color: var(--white); } .pill.pending { background: var(--yellow-2); color: var(--black); }
.pill.suspended, .pill.do_not_use { background: var(--coral); color: var(--black); }
.pill.draft { background: var(--white); border: 1px solid var(--stone-2); } .pill.issued { background: var(--yellow); color: var(--black); }
.pill.on_hold { background: var(--clay); color: var(--black); } .pill.completed { background: var(--black); color: var(--white); }
.pill.invoiced { background: var(--slate); color: var(--white); } .pill.cancelled { background: var(--stone-2); text-decoration: line-through; }
.warn { color: var(--coral); font-weight: 500; } .soon { color: #b8860b; font-weight: 500; }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.statusbar form { margin: 0; }
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 8px; margin: 10px 0 14px; align-items: end; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } }
