/* Davidson Legal CRM — C1 Gunmetal · Hunter. token values come from site/themes.json at build time. */
:root {
  --bg: #E9E7E3; --surface: #F8F7F5; --rail: #26292C; --ink: #1C1E20; --muted: #5E6266;
  --line: #DEDBD5; --accent: #2F5D4A; --accentHover: #264C3D; --accentInk: #FFFFFF;
  --accentOnDark: #93C4AC; --danger: #B3261E; --ok: #2F7D4F;
  --head: 'EB Garamond', Georgia, 'Times New Roman', serif; --body: 'Nunito Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 22px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.4; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 18px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
#shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
#rail { background: var(--rail); color: #EDEAE4; padding: 18px 0 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
#rail img { height: 26px; margin: 0 0 22px 25px; display: block; }
#rail .grp { color: #9FA3A7; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin: 18px 13px 6px 25px; }
#rail a { display: block; color: #EDEAE4; padding: 7px 13px 7px 22px; border-left: 3px solid transparent; }
#rail a.mat { font-size: 13px; color: #CFCBC4; padding: 4px 13px 4px 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rail a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
#rail a.on { border-left-color: var(--accentOnDark); background: rgba(255,255,255,.08); color: #fff; }
#main { padding: 18px 28px 40px; min-width: 0; }
#top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
#top .crumb { color: var(--muted); } #top .spacer { flex: 1; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: flex-end; margin: 6px 0 18px; }
.eyebrow { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .val { font-family: var(--head); font-size: 34px; font-weight: 600; line-height: 1.1; margin: 2px 0; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.cols { display: grid; grid-template-columns: 7fr 3fr; gap: 16px; align-items: start; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding: 0 10px 8px 0; font-weight: 600; }
td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; padding-right: 14px; }
.sub { color: var(--muted); font-size: 12px; } .r { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); } .danger { color: var(--danger); } .accent { color: var(--accent); } .ok { color: var(--ok); }
.count { font-family: var(--body); font-size: 13px; font-weight: 700; }
.aside { margin-left: auto; font-family: var(--body); font-size: 12px; color: var(--muted); font-weight: 400; }
.win { margin-left: auto; font-family: var(--body); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 400; }
.win select { margin-left: 6px; font-family: var(--body); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: var(--surface); color: var(--ink); }
.pad { padding: 8px 0; } .foot { font-size: 12px; margin-top: 6px; }
.btn, button { font-family: var(--body); font-size: 13px; background: var(--accent); color: var(--accentInk); border: 0;
  border-radius: 8px; padding: 8px 14px; cursor: pointer; display: inline-block; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn:hover, button:hover { background: var(--accentHover); text-decoration: none; }
.btn.outline { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.btn.outline:hover { background: var(--bg); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); box-shadow: none; padding: 4px 12px; font-size: 12px; }
.icon { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 6px; color: var(--muted); }
.icon:hover { background: var(--bg); text-decoration: none; color: var(--accent); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar .col { width: 60%; background: var(--accent); border-radius: 6px 6px 0 0; height: 0; min-height: 2px; }
.bar .n { font-size: 12px; margin-bottom: 4px; }
.bar .lab { font-size: 10px; color: var(--muted); text-align: center; margin-top: 6px; height: 28px; overflow: hidden; line-height: 1.2; }
.row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.row:last-child { border-bottom: 0; } .row:hover { text-decoration: none; background: var(--bg); }
.row > div:nth-child(2) { flex: 1; min-width: 0; } .row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .b { font-weight: 700; } .row .mark { width: 14px; color: var(--accent); font-size: 11px; padding-top: 2px; }
.day { width: 38px; text-align: center; } .dow { font-size: 10px; color: var(--muted); } .dom { font-family: var(--head); font-size: 20px; line-height: 1; }
.err { border-left: 3px solid var(--danger); }
input[type=search] { font-family: var(--body); font-size: 13px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); min-width: 260px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  #shell { grid-template-columns: 1fr; } #rail { position: static; height: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 10px; }
  #rail .grp, #rail a.mat { display: none; } #rail img { margin: 0 10px 0 4px; }
  #rail a { border-left: 0; border-bottom: 3px solid transparent; padding: 6px 10px; } #rail a.on { border-bottom-color: var(--accentOnDark); }
  #main { padding: 14px 16px 30px; } input[type=search] { min-width: 0; width: 100%; } #top { flex-wrap: wrap; }
  table.tasks th:nth-child(4), table.tasks td:nth-child(4), table.tasks th:nth-child(6), table.tasks td:nth-child(6) { display: none; }
}
