:root {
  --ink: #0d1a20;
  --ink-2: #14262e;
  --line: #e3e8ea;
  --bg: #f4f6f7;
  --card: #ffffff;
  --text: #16232a;
  --muted: #667a83;
  --accent: #f5a524;
  --accent-ink: #2a1a00;
  --teal: #1fae95;
  --danger: #d64545;
  --warn: #c98a0b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: #0d7a68; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.3px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: none; background: var(--ink); color: #cfe0e6; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { color: #fff; font-weight: 800; font-size: 20px; padding: 4px 10px 18px; display: flex; align-items: center; gap: 10px; }
.side .brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: inline-block; }
.side a {
  display: block; color: #b7cbd3; padding: 9px 12px; border-radius: 9px; margin-bottom: 2px; font-weight: 600;
}
.side a:hover { background: var(--ink-2); text-decoration: none; color: #fff; }
.side a.on { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side .sep { height: 1px; background: #223841; margin: 14px 4px; }
.side .badge { float: right; background: var(--danger); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; }
.main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* Cards & tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.5px; }
.stat span { color: var(--muted); font-size: 13px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafcfc; }
.tablewrap { overflow-x: auto; }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: #dde5e8; display: block; }
.thumb.lg { width: 120px; height: 120px; border-radius: 14px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink-2); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #e7eef0; color: #40565f; }
.pill.ok { background: #dcf5ee; color: #0d7a68; }
.pill.bad { background: #fde5e5; color: #a12a2a; }
.pill.warn { background: #fdf0d3; color: #8a5d00; }
.pill.info { background: #dfeefb; color: #1b5a92; }

/* Forms */
label { display: block; font-weight: 700; font-size: 13px; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cdd8dc; border-radius: 9px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f5a52455; border-color: var(--accent); }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 14px; }
.check input { width: 18px; height: 18px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 700;
  cursor: pointer; background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(0.96); text-decoration: none; }
.btn.ghost { background: #fff; border-color: #cdd8dc; color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; }

/* Notices */
.notice { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.notice.ok { background: #e6f7f2; border-color: #b8e6da; color: #0b5f50; }
.notice.err { background: #fdecec; border-color: #f4c2c2; color: #8f2323; }
.notice.warn { background: #fff5dc; border-color: #f3dc9b; color: #7a5200; }
.notice.info { background: #e8f2fc; border-color: #bcd8f2; color: #1b5a92; }

.pager { display: flex; gap: 6px; align-items: center; margin-top: 14px; }
.pager a, .pager span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pager span.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Login / installer */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--ink); }
.center .card { width: 100%; max-width: 440px; margin: 0; padding: 28px; }
.center.wide .card { max-width: 640px; }
.logo { font-weight: 800; font-size: 26px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.logo i { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: inline-block; }
.req li { margin: 4px 0; }
.req .yes { color: #0b8a6f; }
.req .no { color: var(--danger); font-weight: 700; }

.photos { display: flex; gap: 14px; flex-wrap: wrap; }
.photos figure { margin: 0; }
.photos figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
pre.out { background: #0f1c22; color: #cfe6ee; padding: 12px; border-radius: 10px; overflow: auto; max-height: 240px; font-size: 12.5px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .side .brand { width: 100%; padding-bottom: 6px; }
  .side .sep { display: none; }
  .main { padding: 18px 14px 50px; }
}
