/* Technologic Security — dashboard */
:root {
  --ink: #0b1422; --ink-2: #101c2e; --ink-3: #17263c;
  --paper: #f6f3ed; --card: #ffffff; --text: #18202c; --muted: #5d6878;
  --brass: #a8843f; --brass-hi: #c8a66a; --rule: #e2dccf;
  --bad: #b3362f; --ok: #2f7a4b; --warn: #9a6a10;
  --display: "Marcellus", Georgia, serif; --body: "Manrope", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 400 1rem/1.55 var(--body); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
h2 { font-size: 1.4rem; margin-bottom: 16px; }
h3 { font-size: 1.15rem; margin: 22px 0 10px; }
h3 small, label small { font: 400 0.86rem var(--body); color: var(--muted); margin-left: 6px; }
a { color: #6d5320; }
img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); margin: 0; }
small { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #f2ede4; padding: 26px 18px; display: flex; flex-direction: column; gap: 30px; position: sticky; top: 0; height: 100vh; }
.side__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; font-family: var(--display); font-size: 1.3rem; line-height: 1; padding: 0 8px; }
.side__brand small { display: block; font: 600 0.68rem var(--body); letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass-hi); margin-top: 5px; }
.side__nav { display: grid; gap: 4px; }
.side__nav a { display: flex; align-items: center; justify-content: space-between; color: #a9b3c3; text-decoration: none; padding: 11px 12px; border-radius: 3px; font-weight: 500; border-left: 2px solid transparent; }
.side__nav a:hover { color: #fff; background: var(--ink-2); }
.side__nav a[aria-current] { color: #fff; background: var(--ink-3); border-left-color: var(--brass-hi); }
.count { background: #d8433b; color: #fff; border-radius: 999px; min-width: 24px; padding: 1px 8px; font-size: 0.8rem; text-align: center; }
.side__foot { margin-top: auto; display: grid; gap: 6px; font-size: 0.94rem; padding: 0 12px; }
.side__foot a, .side__foot button { color: #a9b3c3; background: none; border: 0; padding: 6px 0; font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.side__foot a:hover, .side__foot button:hover { color: #fff; }

.main { padding: clamp(20px, 3.5vw, 44px); max-width: 1320px; width: 100%; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.top__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.done-form { display: grid; gap: 6px; justify-items: start; }
.back { display: inline-block; font-size: 0.92rem; margin-bottom: 6px; text-decoration: none; }
.back::before { content: "‹ "; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 20px; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 3px; font: 600 0.96rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink-3); }
.btn--ghost { background: transparent; color: var(--ink); border-color: #bdb6a6; }
.btn--ghost:hover { background: #ece7dc; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: #6d5320; text-decoration: underline; cursor: pointer; }
.linkbtn--bad { color: var(--bad); }

.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: clamp(18px, 2.4vw, 28px); margin-bottom: 22px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

[hidden] { display: none !important; }
label { display: block; font-weight: 600; font-size: 0.95rem; }
label > input, label > textarea, label > select { margin-top: 6px; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid #c9c2b3; border-radius: 3px; background: #fff; font: 400 1rem var(--body); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brass-hi); outline-offset: 0; border-color: var(--brass); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.switch { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 46px; height: 26px; border-radius: 999px; background: #c9c2b3; position: relative; cursor: pointer; transition: background-color 0.2s; margin-top: 2px; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }
.switch span { display: grid; gap: 2px; font-weight: 400; }
.switch small { margin: 0; }
.savebar { display: flex; align-items: center; gap: 18px; margin: -4px 0 26px; }

.flash { padding: 12px 16px; border-radius: 3px; border: 1px solid; margin: 0 0 18px; font-weight: 500; }
.flash--ok { background: #e9f4ec; border-color: #b5d6c0; color: #1f5a36; }
.flash--bad { background: #fbeceb; border-color: #e6b8b4; color: #8a2620; }
.flash--note { background: #fbf4e2; border-color: #e6d5a8; color: #6b4d0e; font-weight: 400; font-size: 0.94rem; margin: 0; }
.switchline { color: var(--muted); margin: -8px 0 22px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.tile { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 20px 22px; text-decoration: none; color: var(--muted); display: grid; gap: 2px; }
.tile:hover { border-color: var(--brass); }
.tile b { font: 400 2.6rem/1.1 var(--display); color: var(--text); }
.tile--alert { background: var(--ink); border-color: var(--ink); color: #a9b3c3; }
.tile--alert b { color: var(--brass-hi); }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; font-size: 0.84rem; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 13px 10px; border-bottom: 1px solid #efeadf; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td > a { font-weight: 600; }
.table small { display: block; }
.clip { max-width: 340px; }
.thumb { width: 84px; }
.thumb img { width: 72px; height: 54px; object-fit: cover; border-radius: 2px; background: #eee; }
.actions { white-space: nowrap; }
.actions > * { display: inline-block; margin-left: 12px; }
.actions form { display: inline; }
.toggle { border: 1px solid #c9c2b3; background: #fff; color: var(--muted); border-radius: 999px; padding: 4px 14px; font: 600 0.86rem var(--body); cursor: pointer; }
.toggle.is-on { background: #e9f4ec; border-color: #b5d6c0; color: #1f5a36; }

.badge { display: inline-block; font: 600 0.8rem var(--body); padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.badge--new { background: #fbeceb; color: #8a2620; }
.badge--in_progress { background: #fbf4e2; color: #6b4d0e; }
.badge--done { background: #e9f4ec; color: #1f5a36; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid var(--rule); background: var(--card); font-weight: 500; font-size: 0.94rem; }
.tabs a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { display: flex; gap: 8px; }
.search input { min-width: 240px; }
.pager { display: flex; justify-content: center; gap: 18px; padding-top: 16px; color: var(--muted); }

.kv { margin: 0 0 16px; }
.kv div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid #efeadf; }
.kv dt { color: var(--muted); font-size: 0.92rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.quote { background: var(--paper); border-left: 3px solid var(--brass-hi); padding: 16px 18px; font-size: 1.05rem; }
.shot img { max-height: 520px; border: 1px solid var(--rule); border-radius: 3px; }
.map { width: 100%; height: 260px; border: 1px solid var(--rule); border-radius: 3px; margin-top: 16px; }
.danger { text-align: right; margin-bottom: 30px; }
.danger button { background: none; border: 0; color: var(--bad); text-decoration: underline; font: inherit; cursor: pointer; }

.drop { border: 1.5px dashed #bdb6a6; border-radius: 4px; padding: 22px; text-align: center; cursor: pointer; font-weight: 400; background: var(--paper); }
.drop:hover { border-color: var(--brass); }
.drop strong { font-size: 1.05rem; }
.drop span { color: var(--muted); font-size: 0.92rem; }
.drop input { margin: 8px auto 0; max-width: 100%; }
.drop em { color: var(--ok); font-style: normal; font-weight: 600; }
.photos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photos li { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--rule); border-radius: 4px; }
.photos li.is-cover { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
.photos input { padding: 7px 9px; font-size: 0.9rem; }
.photos__actions { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; }
.photos__actions span { color: var(--brass); font-weight: 600; }

.gate { display: grid; place-items: center; min-height: 100vh; background: var(--ink); padding: 20px; }
.gate__card { background: var(--card); width: min(430px, 100%); padding: clamp(26px, 5vw, 44px); border-radius: 4px; display: grid; gap: 18px; border-top: 3px solid var(--brass-hi); }
.gate__card h1 { font-size: 1.8rem; }
.gate__card p { margin: 0; color: var(--muted); }
.gate__card img { background: var(--ink); padding: 8px; border-radius: 4px; width: 56px; height: 56px; }
.gate__back { font-size: 0.92rem; text-align: center; }
code { background: #efeadf; padding: 1px 6px; border-radius: 3px; font-size: 0.92em; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 16px; }
  .side__nav { display: flex; flex-wrap: wrap; order: 3; width: 100%; }
  .side__nav a { padding: 8px 12px; border-left: 0; }
  .side__foot { margin: 0 0 0 auto; display: flex; gap: 16px; padding: 0; }
  .side__foot form { display: inline; }
  .cols, .tiles { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tiles, .grid2, .grid3 { grid-template-columns: 1fr; }
  .search { width: 100%; } .search input { min-width: 0; }
}

/* v2: project order, home page text */
input[type="number"] { width: 100%; padding: 11px 12px; border: 1px solid #c9c2b3; border-radius: 3px; background: #fff; font: 400 1rem var(--body); color: var(--text); }
input.order { width: 76px; padding: 7px 8px; }
.check--field { align-self: end; min-height: 46px; }
.savebar--table { margin: 18px 0 0; flex-wrap: wrap; }
.top .muted { margin-top: 6px; }
.textgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.textgrid .wide { grid-column: 1 / -1; }
h2 small { font: 400 0.9rem var(--body); color: var(--muted); margin-left: 8px; }
@media (max-width: 560px) { .textgrid { grid-template-columns: 1fr; } }
