/* LEMS stylesheet. Every colour lives in :root, so the palette can be changed in one place. */
/* Design language: warm paper + ink. Colour is reserved for meaning: green/red/amber = state, terracotta = the one accent. */
:root {
  /* surfaces */
  --bg: #F2EFE6; --surface: #FBF9F3; --surface-2: #F5F2E9; --surface-3: #EAE6D9;
  --border: #D6D0BE; --border-2: #C2BAA3;
  /* text */
  --text: #1B1A17; --text-2: #4B4840; --text-3: #716B5B;
  /* ink (primary buttons, sidebar, "yours") and the single accent */
  --ink: #171612; --ink-2: #34322B; --side-bg: #171612;
  --accent: #BF3F0B; --accent-h: #992F06; --accent-soft: #F9E8DA; --accent-line: #EDC4A2;
  /* status */
  --ok: #2F6B3A; --ok-bg: #E9F1E4; --ok-line: #BCD3B3;
  --warn: #8A5A00; --warn-bg: #F7EDD3; --warn-line: #E5CF8E;
  --bad: #A3281C; --bad-bg: #F7E4DE; --bad-line: #E4B8AC;
  /* schedule slots */
  --slot-free: #EFEBDF; --slot-free-h: #E6E1D2; --slot-blocked: #F6F3EA;
  --radius: 3px; --radius-sm: 2px; --radius-xs: 2px;
  --shadow-xs: none; --shadow-sm: none;
  --shadow-lg: 0 12px 32px rgba(23,22,18,.18), 0 2px 6px rgba(23,22,18,.08);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 14px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 14px; font-weight: 600; }
small { color: var(--text-3); font-size: 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
svg { display: block; }
.sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .tools { display: flex; gap: 8px; align-items: center; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 7px 13px; cursor: pointer; font-weight: 550; font-size: 13px; line-height: 1.3; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #F4F1E8; }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: var(--surface); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.icon { padding: 0; width: 32px; height: 32px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
input, select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); font-size: 13.5px; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: #C6C6BE; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: var(--surface-3); color: var(--text-3); }
textarea { resize: vertical; }
label { display: block; font-weight: 550; margin: 14px 0 5px; font-size: 12.5px; color: var(--text-2); }
.err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.alert { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 12px; font-size: 13px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 34px; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 178px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 14px 8px 10px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 50; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 14px; margin: 0 0 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.brand:hover { color: var(--text); }
.logo { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.brand b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand b i { font-style: normal; color: var(--accent); }
.nav { flex: 1; overflow-y: auto; }
.nav-h { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 12px 10px 5px; }
.nav a { display: flex; gap: 9px; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 13px; margin-bottom: 1px; transition: background .12s, color .12s; }
.nav a svg { width: 15px; height: 15px; flex: none; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-user { position: relative; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.acct { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; cursor: pointer; background: none; border: 0; padding: 6px 8px; border-radius: var(--radius-sm); }
.acct:hover { background: var(--surface-3); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2); display: grid; place-items: center; font-weight: 600; font-size: 10px; flex: none; letter-spacing: .02em; }
.who { line-height: 1.25; min-width: 0; }
.who b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { font-size: 11px; color: var(--text-3); display: block; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 24px 0; max-width: 1240px; width: 100%; margin: 0 auto; }
.top .search { width: 100%; max-width: 305px; }
.grow { flex: 1; }
.rel { position: relative; }
.burger { display: none; width: 32px; height: 32px; border: 1px solid var(--border-2); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; place-items: center; }
.burger svg { width: 16px; height: 16px; }
.bell { position: relative; }
.badge-n { position: absolute; top: -5px; right: -5px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; font-weight: 700; border: 2px solid var(--bg); padding: 0 3px; box-sizing: content-box; }
.content { flex: 1; min-width: 0; padding: 20px 24px 56px; max-width: 1240px; width: 100%; margin: 0 auto; }
.content:focus { outline: none; }
.drop { position: absolute; right: 0; top: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 280px; z-index: 60; overflow: hidden; }
.drop.up { right: auto; left: 4px; top: auto; bottom: 54px; min-width: 210px; }
.drop .it { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.drop .it:last-child { border: 0; }
.drop .note { max-height: none; }
.drop.notes { max-height: 380px; overflow-y: auto; width: 320px; }
.note.unread { background: var(--accent-soft); }
.note small { display: block; margin-top: 2px; }
.empty { text-align: center; color: var(--text-3); padding: 32px 16px; font-size: 13px; }
.empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 3px; font-weight: 600; }

/* ---------- cards, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-h { display: flex; align-items: flex-start; gap: 9px; padding: 13px 16px 10px; flex-wrap: wrap; }
.card-h > svg { width: 15px; height: 15px; color: var(--text-3); flex: none; margin-top: 3px; }   /* centred on the 21px title line, not on title + caption */
.card-h .ttl { min-width: 0; }
.card-h .ttl small { display: block; margin-top: 1px; }
.card-h .right { margin-left: auto; display: flex; gap: 12px; align-items: center; align-self: center; }
.sect { margin-top: 18px; }
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.stat { padding: 14px 16px 13px; display: block; color: var(--text); transition: border-color .12s, box-shadow .12s; }
a.stat:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); color: var(--text); }
.stat .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stat .l { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat .chip { width: 24px; height: 24px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; }
.stat .chip svg { width: 13px; height: 13px; }
.stat .n { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.stat .d { font-size: 11.5px; margin-top: 4px; color: var(--text-3); }
.stat .d.ok { color: var(--ok); } .stat .d.bad { color: var(--bad); } .stat .d.warn { color: var(--warn); }
.stat.ok .chip { background: var(--ok-bg); color: var(--ok); }
.stat.warn .chip { background: var(--warn-bg); color: var(--warn); }
.stat.bad .chip { background: var(--bad-bg); color: var(--bad); }
.stat.acc .chip { background: var(--accent-soft); color: var(--accent); }

/* ---------- schedule ---------- */
.datenav { display: flex; gap: 6px; align-items: center; }
.sched-scroll { overflow-x: auto; border-top: 1px solid var(--border); }
.sched { min-width: 880px; }
.sched .row { display: grid; grid-template-columns: 230px repeat(var(--cols, 12), minmax(0, 1fr)); gap: 4px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.sched .row:last-child { border-bottom: 0; }
.sched .row.head { background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; color: var(--text-3); text-transform: uppercase; }
.sched .row.head span { text-align: center; } .sched .row.head span:first-child { text-align: left; }
.eqcell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eqcell .ic { width: 28px; height: 28px; border-radius: 7px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); display: grid; place-items: center; flex: none; }
.eqcell .ic svg { width: 14px; height: 14px; }
.eqcell b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eqcell small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.cell { height: 26px; border-radius: var(--radius-xs); border: 1px solid transparent; font-size: 9.5px; font-weight: 650; letter-spacing: .04em; display: grid; place-items: center; cursor: default; background: none; padding: 0; width: 100%; font-family: inherit; }
.cell.free { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.cell.free.go { cursor: pointer; }
.cell.free.go:hover { background: #DDF7E8; border-color: #86E0A6; box-shadow: 0 0 0 2px rgba(21,128,61,.12); }
.cell.taken { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.cell.mine { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.cell.past { background: var(--slot-blocked); border-color: var(--border); color: #B8B8B0; }
.cell.maint { background: repeating-linear-gradient(135deg, var(--slot-free) 0 5px, var(--surface-3) 5px 10px); border-color: var(--border); color: #A5A59C; }
.row.maint .eqcell b { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--text-3); }
.row.maint .eqcell small { text-decoration: line-through; }
.row.maint .eqcell .ic { opacity: .6; }
.tagm { display: inline-block; font-size: 9.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2); padding: 0 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; text-decoration: none; display: inline-block; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid transparent; }
.legend .l-free { background: var(--ok-bg); border-color: #6FD598; }
.legend .l-taken { background: var(--bad-bg); border-color: #F08A8A; }
.legend .l-mine { background: var(--accent-soft); border-color: #8E8AF0; }
.legend .l-maint { background: repeating-linear-gradient(135deg, #E0E0DA 0 3px, #F4F4F1 3px 6px); border-color: var(--border-2); }
.sched-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); }

/* ---------- tables ---------- */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 9px 16px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td small { display: block; }
td .nm { font-weight: 600; }
.acts-cell { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pills { display: flex; gap: 2px; background: var(--surface-3); padding: 2px; border-radius: var(--radius-sm); }
.pill { border: 0; background: none; padding: 3px 10px; border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.pill:hover { color: var(--text); }
.pill.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 600; }
.thumb-s { width: 34px; height: 34px; border-radius: 7px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); flex: none; }
.thumb-s svg, .thumb-s img { width: 100%; height: 100%; object-fit: cover; }
.cellflex { display: flex; align-items: center; gap: 10px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 550; padding: 1px 8px; border-radius: 20px; border: 1px solid var(--border-2); background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.b-available, .b-confirmed, .b-finished, .b-resolved { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.b-pending, .b-reserved, .b-awaiting_review { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.b-maintenance, .b-rejected, .b-in_repair { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.b-in_progress { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.b-canceled, .b-no_repair_required { background: var(--surface-3); border-color: var(--border-2); color: var(--text-3); }

/* ---------- equipment cards ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar > * { flex: 1 1 160px; width: auto; }
.toolbar .search { flex: 2 1 240px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; margin-bottom: -1px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab span { margin-left: 6px; font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 6px; border-radius: 10px; font-weight: 600; }
.tab.active span { background: var(--accent-soft); color: var(--accent); }
.eq { padding: 12px; display: flex; flex-direction: column; gap: 4px; transition: border-color .12s, box-shadow .12s; }
.eq:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.eq .thumb { height: 128px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border); overflow: hidden; margin-bottom: 8px; }
.eq .thumb svg, .eq .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eq h3 { font-size: 14px; }
.eq .meta { font-size: 12px; color: var(--text-3); }
.eq .row { margin-top: 6px; }
.eq .acts { margin-top: auto; padding-top: 10px; display: flex; gap: 6px; }
.eq .acts .btn { flex: 1; }
.eq.st-MAINTENANCE .thumb { filter: grayscale(.9); opacity: .75; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; gap: 8px; }
.pager > div { display: flex; align-items: center; gap: 6px; }
.photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-row { display: flex; gap: 14px; align-items: flex-start; }
.photo-prev { width: 120px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); flex: none; }
.photo-prev svg, .photo-prev img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- repair requests ---------- */
.rep { padding: 16px; margin-bottom: 12px; }
.rep .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rep .head .sub { margin-top: 2px; }
.rep p { margin: 10px 0 0; color: var(--text-2); }
.rep .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.rep .acts:empty { display: none; }
.ai { margin-top: 12px; padding: 12px 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); font-size: 13px; }
.ai.pending { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.ai ul { margin: 3px 0 0 18px; }
.ai a { text-decoration: underline; }

/* ---------- activity / lists ---------- */
.ev { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.ev small { display: block; }
.people td:first-child .cellflex { gap: 10px; }

/* ---------- modal, toast, skeleton ---------- */
.ov { position: fixed; inset: 0; background: rgba(28,28,30,.4); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); width: 100%; max-width: 480px; padding: 22px; animation: pop .14s; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h2 { font-size: 16px; margin-bottom: 4px; }
.modal p { color: var(--text-2); margin-top: 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot { min-height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 4px; border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--ok); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.25; }
.slot:hover:not(:disabled) { border-color: #86E0A6; }
.slot.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot:disabled { cursor: not-allowed; background: var(--slot-blocked); border-color: var(--border); color: #B2B2AA; font-weight: 500; }
.slot small { color: inherit; opacity: .8; font-size: 10.5px; }
.toasts, #toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: #fff; padding: 10px 15px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .15s; max-width: 340px; }
.toast.bad { background: var(--bad); }
.skeleton { height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.3s infinite; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

/* ---------- sign in / register ---------- */
:root { --hero-bg: #171612; --hero-fg: #F4F1E8; --hero-muted: #A39E8C; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--bg); }
.hero { position: relative; background: var(--hero-bg); color: var(--hero-fg); padding: 44px 56px 0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.hero-logo { width: 132px; display: block; filter: brightness(0) invert(1); }
.hero-body { max-width: 430px; padding-bottom: 64px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-muted); margin-bottom: 14px; }
.hero h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.03em; font-weight: 700; color: var(--hero-fg); }
.hero p.lead { color: var(--hero-muted); margin-top: 16px; font-size: 14.5px; line-height: 1.55; }
.ruler { height: 46px; margin: 0 -56px; background:
  repeating-linear-gradient(90deg, rgba(244,244,241,.5) 0 1px, transparent 1px 10px) bottom / 100% 8px no-repeat,
  repeating-linear-gradient(90deg, rgba(244,244,241,.75) 0 1px, transparent 1px 50px) bottom / 100% 16px no-repeat; }
.formwrap { display: grid; place-items: center; padding: 40px 28px; }
.formbox { width: 100%; max-width: 360px; }
.formbox h2 { font-size: 22px; letter-spacing: -.02em; font-weight: 700; }
.formbox .lead { color: var(--text-3); font-size: 13.5px; margin-top: 4px; margin-bottom: 8px; }
.formbox .hint { color: var(--text-3); font-size: 12px; margin-top: 5px; }
.formbox input { padding: 10px 12px; font-size: 14px; }
.formbox .btn.primary { width: 100%; margin-top: 22px; padding: 10px 13px; font-size: 14px; }
.formbox .alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.formbox .alt a { cursor: pointer; font-weight: 600; }

/* ---------- details dialog, calendar, notifications, profile, reports, help ---------- */
.muted { color: var(--text-3); }
.pad { padding: 18px 20px 16px; }
.pad h2 { font-size: 15px; margin-bottom: 4px; }
.eq .row { display: flex; align-items: center; gap: 8px; }
.btn.icon.sm { width: 26px; height: 26px; }
.btn.icon.sm svg { width: 14px; height: 14px; }
.modal.wide { max-width: 560px; }
.kvhead { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; flex-wrap: wrap; }
.info-thumb { height: 150px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border); overflow: hidden; margin: 8px 0 4px; }
.info-thumb svg, .info-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; margin-top: 12px; font-size: 13px; }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv dd small { display: block; }
.kv .pre { white-space: pre-wrap; }

.cal-scroll { overflow-x: auto; border-top: 1px solid var(--border); }
.cal { display: grid; grid-template-columns: 56px repeat(7, minmax(96px, 1fr)); min-width: 780px; }
.cal-h { padding: 8px 6px; text-align: center; font-size: 11px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.cal-h:first-child { border-left: 0; }
.cal-h b { display: block; font-size: 16px; color: var(--text); letter-spacing: 0; margin-top: 1px; }
.cal-h.today { background: var(--accent-soft); color: var(--accent); }
.cal-h.today b { color: var(--accent); }
.cal-t { padding: 6px 8px 0; font-size: 11px; color: var(--text-3); text-align: right; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-c { min-height: 46px; padding: 3px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.cal-c.today { background: rgba(238,242,255,.45); }
.chip { text-align: left; border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 7px; font-size: 11.5px; font-weight: 600; cursor: pointer; line-height: 1.25; background: var(--surface-3); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.chip small { display: block; font-weight: 500; color: inherit; opacity: .8; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { filter: brightness(.97); box-shadow: var(--shadow-xs); }
.chip.s-pending { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip.s-confirmed { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.chip.s-in_progress { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip.s-finished { background: var(--surface-3); border-color: var(--border-2); color: var(--text-3); }
.legend .l-pending { background: var(--warn-bg); border-color: #E9C46A; }
.legend .l-confirmed { background: var(--ok-bg); border-color: #6FD598; }
.legend .l-in_progress { background: var(--accent-soft); border-color: #8E8AF0; }
.legend .l-finished { background: var(--surface-3); border-color: var(--border-2); }
.legend .l-total { background: var(--accent-soft); border-color: var(--accent-line); }
.legend .l-used { background: var(--accent); border-color: var(--accent); }

.nrow { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; align-items: flex-start; }
.nrow:last-child { border-bottom: 0; }
.nrow small { display: block; }
.nrow .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex: none; }
.nrow.unread { background: var(--accent-soft); }
.nrow.unread .dot { background: var(--accent); }

.switch-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; cursor: pointer; font-weight: 400; color: var(--text); }
.switch-row b { display: block; font-weight: 600; font-size: 13px; }
.switch-row small { display: block; margin-top: 1px; line-height: 1.4; }
.switch { position: relative; width: 34px; height: 20px; flex: none; margin-top: 1px; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; padding: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--border-2); border-radius: 20px; transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.pad .foot { margin-top: 18px; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding: 14px 16px 6px; border-top: 1px solid var(--border); }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-t { width: 100%; background: var(--accent-soft); border: 1px solid var(--accent-line); border-bottom: 0; border-radius: 3px 3px 0 0; display: flex; align-items: flex-end; min-height: 2px; }
.bar-u { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; }
.bar span { font-size: 10px; color: var(--text-3); height: 12px; white-space: nowrap; }
.urow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.urow .un b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .un small { display: block; }
.ubar { height: 8px; background: var(--surface-3); border-radius: 8px; overflow: hidden; }
.ubar i { display: block; height: 100%; background: var(--accent); border-radius: 8px; min-width: 2px; }
.uv { font-size: 12px; color: var(--text-2); white-space: nowrap; min-width: 84px; text-align: right; }
.statusrow { display: flex; gap: 22px; flex-wrap: wrap; padding: 6px 16px 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.statusrow > div { display: flex; align-items: center; gap: 8px; }
.statusrow b { font-size: 16px; }
.rules { margin: 10px 0 0 18px; display: grid; gap: 8px; color: var(--text-2); font-size: 13.5px; }
.rules b { color: var(--text); }

/* ---------- design language: type, ruled stat strip, dark rail, square marks ---------- */
h1, .formbox h2, .hero h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; }
h1 { font-size: 25px; }
.page-head .sub, .stat .l, .stat .n, .stat .d, th, .nav-h, .cell, .meta, .tagm, .badge, .uv, .eqcell small, td small, .urow small, .kv dt, .cal-t, .cal-h span, .eyebrow, .pager, .legend, small { font-family: var(--mono); }
.page-head .sub { font-size: 12px; }
small { font-size: 11.5px; }
.nav a, .btn, .tab, .pill, input, select, textarea, .drop .it, .rules, td, .ev, .nrow, .empty { font-family: var(--sans); }
.legend, .pager { font-size: 11.5px; }

/* stats: one ruled strip instead of four floating cards (1px gaps over a border-coloured background = rules at any column count) */
.g4 { gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.g4 > .stat { border: 0; border-radius: 0; background: var(--surface); }
.stat .chip { display: none; }
.stat .top-row { margin-bottom: 6px; }
.stat .l { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--text-3); }
.stat .n { font-size: 30px; font-weight: 500; letter-spacing: -.04em; }
.stat .d { font-size: 11px; }
.card-h > svg { display: none; }

/* marks: square, technical */
.badge { border-radius: 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 0 6px; }
.badge::before { display: none; }
.b-in_progress { background: var(--ink); border-color: var(--ink); color: #F4F1E8; }
.modal { border-radius: 4px; }
.tagm { border-radius: 2px; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab.active span { background: var(--ink); color: #F4F1E8; }
.pills, .pill { border-radius: 2px; }
.slot.sel { background: var(--ink); border-color: var(--ink); color: #F4F1E8; }
.slot:hover:not(:disabled) { border-color: #8DB57F; }
.switch input:checked + i { background: var(--ink); }
.cell.free.go:hover { background: #DDE9D4; border-color: #8DB57F; box-shadow: 0 0 0 2px rgba(47,107,58,.14); }
.cell.mine { background: var(--ink); border-color: var(--ink); color: #F4F1E8; }
.chip.s-in_progress { background: var(--ink); border-color: var(--ink); color: #F4F1E8; }
.legend .l-free { border-color: #8DB57F; } .legend .l-taken { border-color: #D08F82; } .legend .l-mine { background: var(--ink); border-color: var(--ink); }
.legend .l-in_progress { background: var(--ink); border-color: var(--ink); } .legend .l-pending { border-color: #D8B96B; } .legend .l-confirmed { border-color: #8DB57F; }
.legend .l-maint { background: repeating-linear-gradient(135deg, #D9D4C3 0 3px, #EFEBDF 3px 6px); }

/* dark rail */
.side { background: var(--side-bg); border-right: 0; }
.brand { border-bottom-color: #2C2A23; color: #F4F1E8; }
.brand:hover { color: #fff; }
.brand b i { color: var(--accent); }
.nav-h { color: #7D7869; }
.nav a { color: #B9B5A7; border-radius: 2px; }
.nav a:hover { background: #221F19; color: #fff; }
.nav a.active { background: #26231C; color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.side-user { border-top-color: #2C2A23; }
.acct:hover { background: #221F19; }
.who b { color: #F4F1E8; }
.role { color: #8C8777; }
.avatar { background: #26231C; border-color: #3A372E; color: #D8D4C6; }
.drop.up .it, .drop.up .it b { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-lg); width: 220px; }
  .side.open { transform: none; }
  .burger { display: grid; }
  .top { padding: 12px 14px 0; } .content { padding: 16px 14px 48px; }
  .auth { grid-template-columns: 1fr; } .hero { padding: 26px 24px 0; } .hero-body { padding-bottom: 28px; } .hero h1 { font-size: 26px; } .ruler { margin: 0 -24px; }
}
@media (max-width: 640px) { .urow { grid-template-columns: 1fr auto; } .urow .ubar { grid-column: 1 / -1; order: 3; } .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } .g4, .g3, .g2 { grid-template-columns: 1fr; } .top .btn .lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
