:root {
  --ink: #17201d;
  --muted: #66736d;
  --line: #dfe7e2;
  --paper: #f5f7f4;
  --white: #fff;
  --green: #116d4b;
  --green-dark: #0a5138;
  --green-soft: #e3f2eb;
  --red: #b63b3b;
  --red-soft: #fbe9e7;
  --amber: #a56512;
  --amber-soft: #fff2d9;
  --shadow: 0 15px 45px rgba(28, 44, 37, .08);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px; display: flex; flex-direction: column; background: #10251e; color: #dce8e2; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 19px; letter-spacing: -.03em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px 12px 12px 4px; background: #e4b858; color: #17201d; font-weight: 900; }
.brand b { color: #85d6ad; }
.nav-list { margin-top: 48px; display: grid; gap: 7px; }
.nav-item { padding: 11px 13px; border-radius: 10px; color: #aabbb3; text-decoration: none; font-weight: 650; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 #e4b858; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.11); color: #aabbb3; font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #53cf8b; box-shadow: 0 0 0 4px rgba(83,207,139,.12); }
.main-content { width: min(1500px, 100%); padding: 34px clamp(24px, 4vw, 68px) 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 45px); line-height: 1.05; letter-spacing: -.045em; font-weight: 600; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; letter-spacing: -.03em; }
.avatar-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #d8e7de; color: var(--green-dark); font-weight: 850; }
.search-hero { padding: clamp(23px, 3vw, 34px); border-radius: 22px; background: linear-gradient(125deg, #174d3a, #0d2d24); color: #fff; box-shadow: var(--shadow); }
.segmented { width: fit-content; padding: 4px; display: flex; gap: 3px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: rgba(0,0,0,.16); }
.segmented button, .segmented label span { padding: 7px 17px; display: block; border: 0; border-radius: 7px; background: transparent; color: #bdd0c7; font-weight: 750; cursor: pointer; }
.segmented button.selected, .segmented label input:checked + span { background: #fff; color: var(--green-dark); }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.search-row { margin-top: 16px; display: flex; gap: 10px; }
.search-row input { min-width: 0; flex: 1; height: 53px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; outline: 0; color: var(--ink); }
.search-row input:focus { box-shadow: 0 0 0 4px rgba(228,184,88,.28); }
.primary-button { min-height: 48px; padding: 0 22px; border: 0; border-radius: 11px; background: #e4b858; color: #18221e; font-weight: 850; cursor: pointer; }
.primary-button:hover { background: #efc76d; }
.search-hero > p { margin: 12px 0 0; color: #b8cbc2; font-size: 13px; }
.stats-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { min-height: 138px; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.8); }
.stat-card > span { color: var(--muted); font-weight: 700; }
.stat-card strong { margin: 7px 0 auto; font: 600 37px/1 Georgia, serif; }
.stat-card small { color: var(--muted); }
.stat-card.urgent { border-color: #efc9c4; background: var(--red-soft); }
.stat-card.urgent strong { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .9fr); gap: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 8px 28px rgba(28,44,37,.04); }
.panel-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.panel-heading a { color: var(--green); font-size: 13px; font-weight: 750; }
.case-list { display: grid; }
.case-row { min-width: 0; padding: 15px 0; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; border-top: 1px solid #edf1ee; }
.case-row:first-child { border-top: 0; }
.case-row div { min-width: 0; }
.case-row strong, .case-row small { display: block; }
.case-row small { margin-top: 2px; color: var(--muted); }
.case-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; font-weight: 850; font-size: 12px; }
.case-avatar.coral { background: #c85f54; }.case-avatar.violet { background: #765eaf; }.case-avatar.blue { background: #477da2; }
.pill { padding: 6px 9px; border-radius: 99px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.pill.critical { color: var(--red); background: var(--red-soft); }.pill.pending { color: var(--amber); background: var(--amber-soft); }
.timeline { margin: 0; padding: 2px 0 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 23px 27px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 13px; bottom: -4px; width: 1px; background: var(--line); }
.timeline li > span { position: absolute; left: 0; top: 5px; width: 13px; height: 13px; border: 3px solid #d7ece2; border-radius: 50%; background: var(--green); }
.timeline strong, .timeline small { display: block; }.timeline small { margin-top: 3px; color: var(--muted); }
@media (max-width: 1050px) { .stats-grid { grid-template-columns: repeat(2,1fr); }.dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .app-shell { display: block; }.sidebar { position: static; width: 100%; height: auto; padding: 17px 18px; flex-direction: row; align-items: center; }.nav-list { margin: 0 0 0 auto; display: flex; }.nav-item { display: none; }.nav-item.active { display: block; }.sidebar-foot { display: none; }.main-content { padding: 24px 16px 45px; }.topbar { margin-bottom: 21px; }.search-row { flex-direction: column; }.search-row .primary-button { width: 100%; }.stats-grid { grid-template-columns: 1fr 1fr; }.stat-card { min-height: 120px; padding: 16px; }.case-row { grid-template-columns: 42px 1fr; }.case-row .pill { grid-column: 2; justify-self: start; }}
@media (max-width: 450px) { .stats-grid { grid-template-columns: 1fr; }.stat-card { min-height: 112px; }.brand > span:last-child { display: none; } }

/* Shared controls */
.muted { color: var(--muted); }
.optional { color: var(--muted); font-size: 12px; font-weight: 500; }
.wide { width: 100%; }
.small { min-height: 34px !important; padding: 0 12px !important; font-size: 12px; }
.text-button { padding: 7px 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.secondary-button, .danger-button { min-height: 42px; padding: 0 17px; display: inline-grid; place-items: center; border: 1px solid #cfdad4; border-radius: 10px; background: #fff; color: var(--green-dark); font-weight: 800; text-decoration: none; cursor: pointer; }
.secondary-button:hover { border-color: var(--green); background: #f3faf6; }
.danger-button { border-color: #e8b9b5; color: var(--red); }
.form-stack { display: grid; gap: 15px; }
.form-stack label { display: grid; gap: 6px; color: #34423c; font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #ced9d3; border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
input, select { min-height: 45px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #4f9678; box-shadow: 0 0 0 3px rgba(17,109,75,.12); }
.flash { margin: 0 0 18px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-weight: 650; }
.flash.success { border-color: #b9dec9; background: #edf8f1; color: #176341; }
.flash.error { border-color: #efc1bd; background: var(--red-soft); color: #94322f; }
.flash.warning { border-color: #ecd299; background: var(--amber-soft); color: #7c4c0c; }
.account-menu { display: flex; align-items: center; gap: 8px; }
.account-menu form { margin: 0; }
.account-menu .avatar-button { text-decoration: none; }
.mobile-menu { display: none; }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font: 600 23px/1.2 Georgia, serif; }
.empty-state p { margin: 7px 0 0; }
.empty-state.compact { padding: 22px 10px; }
.count-badge { min-width: 31px; height: 31px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--green-soft); color: var(--green); font-weight: 850; font-size: 12px; }
.kind-label { width: fit-content; color: var(--green); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.muted-pill, .status-none { background: #eef1ef; color: var(--muted); }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-banned, .status-device_banned { background: var(--red-soft); color: var(--red); }
.import-form > p { margin: 12px 0 0; color: #b8cbc2; font-size: 13px; }
.case-row.linked { color: inherit; text-decoration: none; }
.case-row.linked:hover strong { color: var(--green); }

/* Login */
.login-page { background: #0f2820; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); }
.login-brand { position: relative; overflow: hidden; padding: clamp(45px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: radial-gradient(circle at 15% 20%, rgba(69,154,112,.32), transparent 32%), linear-gradient(145deg, #153f30, #0b211b); }
.login-brand::after { content: "D"; position: absolute; right: -5vw; bottom: -23vh; color: rgba(255,255,255,.025); font: 800 min(75vw, 900px)/1 Georgia, serif; pointer-events: none; }
.brand-mark.large { width: 55px; height: 55px; margin-bottom: 35px; font-size: 23px; }
.eyebrow.light { color: #8ad0ac; }
.login-brand h1 { max-width: 730px; font-size: clamp(48px, 6vw, 82px); }
.login-brand > p:not(.eyebrow) { max-width: 590px; margin: 28px 0 0; color: #b4c9bf; font-size: 18px; }
.login-rule { z-index: 1; margin-top: 55px; color: #8ca79a; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.login-rule span { width: 42px; height: 1px; margin: 0 10px 4px 0; display: inline-block; background: #dcb257; }
.login-card { padding: clamp(38px, 7vw, 105px); display: flex; flex-direction: column; justify-content: center; background: #f8faf8; }
.login-card h2 { font-size: 36px; }
.login-card .form-stack { margin-top: 28px; }
.login-help { margin-top: 22px; color: var(--muted); }

/* Case library */
.cases-panel { margin-top: 20px; }
.filter-bar { margin-bottom: 22px; display: grid; grid-template-columns: minmax(220px, 1fr) 180px 220px auto; gap: 10px; }
.target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.target-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 15px; color: inherit; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.target-card:hover { transform: translateY(-2px); border-color: #9ebcae; box-shadow: var(--shadow); }
.target-card-head { display: flex; align-items: center; justify-content: space-between; }
.target-card h3 { margin: 15px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 21px/1.25 Georgia, serif; }
.target-card > p { margin: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.score-line { position: relative; margin: 19px 0 14px; padding-bottom: 11px; display: flex; align-items: baseline; gap: 5px; }
.score-line strong { font-size: 18px; }.score-line span { color: var(--muted); font-size: 11px; }
.score-line i, .score-track i { position: absolute; left: 0; bottom: 0; width: 100%; height: 5px; overflow: hidden; border-radius: 99px; background: #e7ece9; }
.score-line i::after, .score-track i::after { content: ""; display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); }
[data-score="1"]::after { width: 33.333% !important; }[data-score="2"]::after { width: 66.666% !important; }[data-score="3"]::after { width: 100% !important; background: var(--red) !important; }
.target-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }

/* Detail */
.back-link { margin: -7px 0 15px; display: inline-block; color: var(--green); font-weight: 750; text-decoration: none; }
.case-hero { padding: 26px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 20px; align-items: center; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(130deg, #fff, #f5f9f6); }
.case-hero.needs-action { border-color: #e7b6b2; background: linear-gradient(130deg, #fff, #fdf2f0); }
.profile-avatar { width: 83px; height: 83px; overflow: hidden; display: grid; place-items: center; border-radius: 24px; background: #d9e9e0; color: var(--green-dark); font: 700 25px Georgia, serif; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.case-identity h2 { margin: 4px 0; font-size: 32px; }.case-identity p { margin: 0; color: var(--muted); }.case-identity a { margin-top: 7px; display: inline-block; color: var(--green); font-size: 12px; font-weight: 750; }
.case-score { width: 190px; padding-left: 25px; border-left: 1px solid var(--line); }
.case-score > span { color: var(--muted); font-size: 11px; font-weight: 750; }.case-score > strong { display: block; margin: 4px 0 8px; font: 600 37px/1 Georgia, serif; }.case-score > strong small { color: var(--muted); font-size: 16px; }.case-score > b { margin-top: 9px; display: block; color: var(--red); font-size: 11px; }
.score-track { position: relative; height: 5px; }.score-track i { top: 0; }
.threshold-alert { margin-top: 14px; padding: 14px 18px; display: flex; gap: 15px; align-items: center; border: 1px solid #e9b7b3; border-radius: 13px; background: var(--red-soft); color: #84332f; }
.threshold-alert span { font-size: 13px; }
.case-layout { margin-top: 17px; display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 17px; align-items: start; }
.case-main, .case-actions { display: grid; gap: 17px; }
.sticky-panel { position: sticky; top: 18px; }
.community-list { display: grid; }
.community-row { padding: 14px 0; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #edf1ee; }
.community-row:first-child { border-top: 0; }.community-row.banned { margin: 4px 0; padding: 13px; border: 1px solid #efc6c2; border-radius: 12px; background: #fff6f5; }
.community-row strong, .community-row small { display: block; }.community-row small { margin-top: 2px; color: var(--muted); }
.community-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #e4ece7; color: #496158; font-size: 11px; font-weight: 850; }
.infraction { padding: 17px 0; display: grid; grid-template-columns: 39px 1fr; gap: 13px; border-top: 1px solid #edf1ee; }.infraction:first-child { border-top: 0; }.infraction.voided { opacity: .55; }
.severity-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; font-weight: 900; }.severity-mark.minor { background: var(--amber-soft); color: var(--amber); }.severity-mark.major { background: #f9dcc8; color: #a24f17; }.severity-mark.critical { background: var(--red-soft); color: var(--red); }
.infraction-title { display: flex; align-items: center; gap: 8px; }.infraction-body > p { margin: 7px 0; color: #49564f; }.infraction-body > small { color: var(--muted); }.infraction-body a { color: var(--green); }
.severity-minor { color: var(--amber); background: var(--amber-soft); }.severity-major { color: #a24f17; background: #f9dcc8; }.severity-critical { color: var(--red); background: var(--red-soft); }
.void-note { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #eef1ef; font-size: 12px; }
.inline-details { margin-top: 9px; }.inline-details summary, .moderator-row summary { color: var(--green); font-size: 12px; font-weight: 750; cursor: pointer; }
.inline-form { margin-top: 8px; display: flex; gap: 7px; }.inline-form input { flex: 1; }
.severity-picker { margin: 0; padding: 0; border: 0; }.severity-picker legend { margin-bottom: 7px; color: #34423c; font-size: 13px; font-weight: 750; }.severity-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }.severity-picker label { position: relative; }.severity-picker input { position: absolute; opacity: 0; }.severity-picker span { padding: 9px 5px; display: grid; text-align: center; border: 1px solid #d5ddd9; border-radius: 9px; cursor: pointer; }.severity-picker b, .severity-picker small { display: block; }.severity-picker small { color: var(--muted); font-weight: 500; }.severity-picker input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }

/* Accounts and audit */
.admin-grid, .account-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,.75fr); gap: 18px; align-items: start; }
.compact-panel { max-width: 520px; }
.moderator-list { display: grid; }.moderator-row { padding: 15px 0; display: grid; grid-template-columns: 43px minmax(0,1fr) auto auto; gap: 12px; align-items: center; border-top: 1px solid #edf1ee; }.moderator-row:first-child { border-top: 0; }.moderator-row.disabled { opacity: .58; }.moderator-row strong, .moderator-row small { display: block; }.moderator-row small { margin-top: 2px; color: var(--muted); }.moderator-actions { margin-top: 8px; padding: 9px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.audit-table { display: grid; }.audit-row { padding: 14px 0; display: grid; grid-template-columns: 13px 1fr auto; align-items: center; gap: 13px; border-top: 1px solid #edf1ee; }.audit-row:first-child { border-top: 0; }.audit-row strong, .audit-row small { display: block; }.audit-row small { margin-top: 3px; color: var(--muted); }.audit-row > a { color: var(--green); font-size: 12px; font-weight: 750; }.audit-dot { width: 10px; height: 10px; border: 3px solid #d5e8de; border-radius: 50%; background: var(--green); }
.account-summary { text-align: center; }.account-summary .plain { margin: 0 auto 17px; }.account-summary > p:not(.eyebrow) { color: var(--muted); }.account-summary dl { margin: 25px 0 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }.account-summary dl div { padding: 17px 5px 0; }.account-summary dt { color: var(--muted); font-size: 11px; }.account-summary dd { margin: 4px 0 0; font-weight: 750; }

@media (max-width: 1150px) { .target-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }.case-layout { grid-template-columns: minmax(0,1fr) 320px; }.filter-bar { grid-template-columns: 1fr 150px 190px auto; } }
@media (max-width: 900px) { .login-shell { grid-template-columns: 1fr; }.login-brand { min-height: 42vh; padding: 45px 9vw; }.login-brand h1 { font-size: clamp(42px, 10vw, 64px); }.login-rule { margin-top: 30px; }.login-card { min-height: 58vh; }.case-layout, .admin-grid, .account-grid { grid-template-columns: 1fr; }.compact-panel { max-width: none; }.sticky-panel { position: static; }.filter-bar { grid-template-columns: 1fr 1fr; }.filter-bar input { grid-column: 1 / -1; }.case-hero { grid-template-columns: auto 1fr; }.case-score { width: auto; padding: 17px 0 0; grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); }}
@media (max-width: 720px) { .mobile-menu { margin-left: auto; display: block; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: transparent; color: #fff; padding: 7px 10px; }.nav-list { position: absolute; z-index: 20; top: 69px; left: 13px; right: 13px; margin: 0; padding: 10px; display: none; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: #10251e; box-shadow: var(--shadow); }.nav-list.open { display: grid; }.nav-item, .nav-item.active { display: block; }.sidebar { position: relative; z-index: 10; }.target-grid { grid-template-columns: 1fr; }.moderator-row { grid-template-columns: 43px 1fr auto; }.moderator-row details { grid-column: 2 / -1; }.community-row { grid-template-columns: 39px 1fr; }.community-row .pill { grid-column: 2; justify-self: start; }.threshold-alert { align-items: start; flex-direction: column; gap: 4px; }.panel { padding: 19px; }}
@media (max-width: 500px) { .login-brand { min-height: 37vh; }.login-brand > p:not(.eyebrow), .login-rule { display: none; }.login-card { padding: 40px 22px; }.filter-bar { grid-template-columns: 1fr; }.filter-bar input { grid-column: auto; }.case-hero { grid-template-columns: 1fr; }.case-score { grid-column: auto; }.profile-avatar { width: 68px; height: 68px; }.inline-form { flex-direction: column; }.severity-picker { grid-template-columns: 1fr; }.topbar h1 { font-size: 30px; }}
