:root {
  --ink: #17211e;
  --muted: #6e7975;
  --line: #e2e8e5;
  --paper: #ffffff;
  --canvas: #f4f6f3;
  --forest: #193e34;
  --forest-2: #245447;
  --lime: #cbf36a;
  --lime-soft: #effbd0;
  --blue: #4569dc;
  --amber: #dd8b2d;
  --red: #cf574d;
  --shadow: 0 12px 40px rgba(31, 48, 42, .08);
  --radius: 15px;
  --text-scale: 1;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  zoom: var(--text-scale);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 25px 16px 18px;
  color: #f6fbf8;
  background:
    radial-gradient(circle at 20% 10%, rgba(203,243,106,.12), transparent 24%),
    #122b24;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 21px; letter-spacing: -.4px; }
.brand small { display: block; color: #9fb5ad; font-size: 8px; letter-spacing: 3px; margin-top: 2px; }
.brand-mark { width: 34px; height: 38px; position: relative; }
.brand-mark span { position: absolute; width: 22px; height: 31px; border: 2px solid var(--lime); border-radius: 2px 12px 2px 12px; transform: rotate(13deg); }
.brand-mark span:last-child { left: 10px; top: 5px; transform: rotate(-13deg); opacity: .65; }
.brand-logo { display: none; width: 38px; height: 38px; object-fit: contain; border-radius: 7px; }
.primary-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  width: 100%;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: #b9cac4;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: .2s ease;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: #14271f; background: var(--lime); }
.nav-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}
.nav-count { margin-left: auto; min-width: 21px; padding: 3px 6px; border-radius: 9px; color: #dff6aa; background: rgba(203,243,106,.12); text-align: center; font-size: 9px; }
.nav-item.active .nav-count { color: white; background: var(--forest); }
.nav-count.muted { color: #a6bdb5; background: rgba(255,255,255,.07); }
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.nav-divider { height: 1px; margin: 12px 10px; background: rgba(255,255,255,.09); }
.sidebar-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.status-pulse { width: 9px; height: 9px; border-radius: 50%; background: #83d98c; box-shadow: 0 0 0 4px rgba(131,217,140,.12); }
.sidebar-card div, .profile div:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-card strong, .profile strong { display: block; font-size: 11px; }
.sidebar-card small, .profile small { display: block; margin-top: 3px; color: #90a79f; font-size: 9px; }
.sidebar-card button, .profile button { border: 0; color: #9db1aa; background: transparent; }
.profile { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { flex: 0 0 auto !important; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #18352c; background: #d8e8ce; font-size: 11px; font-weight: 800; }
.main { width: calc(100% - 252px); margin-left: 252px; min-width: 0; }
.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.global-search { position: relative; max-width: 530px; flex: 1; }
.global-search > span { position: absolute; left: 14px; top: 13px; color: transparent; width: 15px; height: 15px; border: 1.5px solid #7d8884; border-radius: 50%; }
.global-search > span::after { content: ""; position: absolute; width: 6px; height: 1.5px; right: -5px; bottom: -2px; background: #7d8884; transform: rotate(45deg); }
.global-search input { width: 100%; height: 42px; padding: 0 70px 0 42px; border: 1px solid transparent; border-radius: 11px; outline: none; color: var(--ink); background: #f1f4f1; font-size: 12px; }
.global-search input:focus { border-color: #9ec8b6; background: white; box-shadow: 0 0 0 3px rgba(77,133,108,.1); }
.global-search kbd { position: absolute; right: 10px; top: 10px; padding: 5px 7px; border: 1px solid #dce2de; border-radius: 6px; color: #8b9591; background: white; font-size: 9px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: #5e6c67; background: white; font-weight: 700; }
.notification span { position: absolute; right: -4px; top: -5px; width: 16px; height: 16px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: white; background: #df664f; font-size: 8px; }
.button { height: 39px; border: 1px solid var(--line); border-radius: 10px; padding: 0 15px; color: var(--ink); background: white; font-size: 11px; font-weight: 700; }
.button:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(20,47,39,.09); }
.button.primary { color: white; border-color: var(--forest); background: var(--forest); }
.button.primary span { margin-right: 7px; color: var(--lime); font-size: 17px; }
.button.secondary { color: var(--forest); border-color: #b7c9c2; background: #f7faf8; }
.button.danger { color: #a53d36; border-color: #f0c8c5; background: #fff8f7; }
.mobile-menu { display: none; }
.content { padding: 30px 34px 44px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 7px; color: #6b7873; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, serif; font-size: 31px; font-weight: 500; letter-spacing: -.7px; }
.page-head p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.date-card { display: flex; align-items: center; gap: 11px; padding: 8px 13px 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.date-tile { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: var(--lime-soft); font-weight: 800; font-size: 12px; }
.date-card strong { display: block; font-size: 10px; }
.date-card small { color: var(--muted); font-size: 9px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card { position: relative; min-height: 123px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 2px 4px rgba(30,50,43,.02); }
.metric-card[data-metric] { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card[data-metric]:hover, .metric-card[data-metric]:focus-visible { transform: translateY(-2px); border-color: #b8cbc2; box-shadow: var(--shadow); outline: none; }
.metric-card[data-metric]::before { content: "Open list"; position: absolute; right: 14px; bottom: 11px; z-index: 2; color: var(--accent, var(--forest)); font-size: 7px; font-weight: 800; opacity: 0; transition: opacity .18s; }
.metric-card[data-metric]:hover::before, .metric-card[data-metric]:focus-visible::before { opacity: 1; }
.metric-card::after { content: ""; position: absolute; width: 72px; height: 72px; right: -22px; bottom: -34px; border-radius: 50%; background: var(--accent-soft, #eef5f2); }
.metric-label { display: flex; justify-content: space-between; align-items: center; color: #68756f; font-size: 10px; font-weight: 700; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--accent, var(--forest)); background: var(--accent-soft, #eff5f2); font-size: 10px; }
.metric-value { display: block; margin-top: 10px; font-family: Georgia, serif; font-size: 27px; }
.metric-note { margin-top: 7px; color: var(--muted); font-size: 9px; }
.metric-note .up { color: #3f8c66; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(295px, .8fr); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 2px 4px rgba(30,50,43,.02); }
.card-header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-header h2 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.link-button { border: 0; color: var(--forest-2); background: transparent; font-size: 10px; font-weight: 800; }
.matter-table { width: 100%; border-collapse: collapse; }
.matter-table th { padding: 10px 15px; color: #84908b; background: #fafbfa; text-align: left; font-size: 8px; letter-spacing: .7px; text-transform: uppercase; }
.matter-table td { padding: 13px 15px; border-top: 1px solid #edf0ee; font-size: 10px; vertical-align: middle; }
.matter-table tbody tr { cursor: pointer; transition: .15s ease; }
.matter-table tbody tr:hover { background: #f8fbf8; }
.matter-main { display: flex; align-items: center; gap: 10px; }
.matter-type { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: #e9f1ed; font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.matter-main strong { display: block; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.matter-main small, .client-cell small { display: block; margin-top: 4px; color: #89938f; font-size: 8px; }
.client-cell strong { display: block; font-size: 10px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 12px; color: #3a6857; background: #e8f4ee; font-size: 8px; font-weight: 800; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.review { color: #9a641f; background: #fff1dc; }
.badge.draft { color: #596a9f; background: #edf0fa; }
.badge.closed { color: #6c7471; background: #ecefed; }
.team-stack { display: flex; }
.mini-avatar { width: 23px; height: 23px; margin-left: -5px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: #29443b; background: #d6e5de; font-size: 7px; font-weight: 800; }
.mini-avatar:first-child { margin-left: 0; }
.timeline { padding: 6px 18px 13px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 39px 1fr; gap: 9px; padding: 12px 0; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 45px; bottom: -10px; width: 1px; background: #e1e7e4; }
.timeline-icon { width: 37px; height: 37px; z-index: 1; display: grid; place-items: center; border-radius: 10px; color: var(--color, #517563); background: var(--soft, #edf5f1); font-size: 9px; font-weight: 800; }
.timeline-content strong { display: block; font-size: 10px; line-height: 1.4; }
.timeline-content p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.timeline-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: #949d99; font-size: 8px; }
.schedule-list { padding: 4px 18px 12px; }
.schedule-item { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #edf0ee; }
.schedule-item:last-child { border-bottom: 0; }
.schedule-date { text-align: center; }
.schedule-date strong { display: block; font-family: Georgia, serif; font-size: 18px; }
.schedule-date small { color: #87918d; font-size: 8px; text-transform: uppercase; }
.schedule-info { padding-left: 11px; border-left: 2px solid var(--event-color, var(--forest)); }
.schedule-info strong { display: block; font-size: 9px; line-height: 1.4; }
.schedule-info small { display: block; margin-top: 4px; color: #89938f; font-size: 8px; }
.priority { padding: 4px 7px; border-radius: 9px; color: #b24b43; background: #fff0ee; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 14px 18px 18px; }
.quick-action { min-height: 63px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfcfb; text-align: left; font-size: 9px; font-weight: 700; }
.quick-action span { width: 24px; height: 24px; display: grid; place-items: center; margin-bottom: 7px; border-radius: 7px; color: var(--forest); background: var(--lime-soft); font-size: 11px; }
.quick-action:hover { border-color: #aac5b9; background: white; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 16px; }
.toolbar .filter { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: #56645f; background: white; font-size: 10px; outline: none; }
.toolbar-search { min-width: 240px; flex: 1; }
.view-summary { margin-left: auto; color: var(--muted); font-size: 10px; }
.panel { padding: 18px; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
.case-hero { position: relative; padding: 22px; overflow: hidden; color: white; border-radius: var(--radius); background: var(--forest); }
.case-hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: -100px; top: -110px; border: 35px solid rgba(203,243,106,.09); border-radius: 50%; }
.case-hero-content { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 26px; align-items: end; }
.case-hero-summary { min-width: 0; }
.case-hero .back-link { position: relative; z-index: 1; border: 0; padding: 0; color: #bcd0c9; background: transparent; font-size: 9px; }
.case-hero h1 { position: relative; z-index: 1; margin-top: 16px; font-size: 27px; }
.case-hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 18px; margin-top: 19px; color: #b7cbc4; font-size: 9px; }
.case-hero-meta strong { display: block; margin-bottom: 4px; color: white; font-size: 10px; }
.case-hero .badge { position: absolute; z-index: 2; right: 20px; top: 20px; }
.case-hero-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-right: 36px; }
.hero-insight { min-height: 84px; padding: 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-insight-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.hero-insight-head span { color: #c9d8d2; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.hero-insight-head strong { color: white; font-size: 12px; }
.hero-insight small { display: block; margin-top: 6px; color: #d5e4de; font-size: 8px; line-height: 1.4; }
.hero-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.hero-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--lime); }
.tabbar { display: flex; gap: 4px; margin: 16px 0; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.tab-button { white-space: nowrap; flex: 1; min-width: 86px; height: 35px; border: 0; border-radius: 8px; color: #6c7773; background: transparent; font-size: 9px; font-weight: 700; }
.tab-button.active { color: var(--forest); background: var(--lime-soft); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.info-card { padding: 17px; }
.info-card h3 { margin: 0 0 14px; font-family: Georgia, serif; font-size: 15px; font-weight: 500; }
.definition-list { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.definition-list small { display: block; margin-bottom: 4px; color: #89948f; font-size: 8px; text-transform: uppercase; }
.definition-list strong { display: block; font-size: 10px; line-height: 1.4; }
.progress-track { height: 7px; margin: 12px 0 7px; overflow: hidden; border-radius: 5px; background: #edf1ef; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--forest); }
.side-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 15px; font-weight: 500; }
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task-item { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.task-check { width: 16px; height: 16px; border: 1.5px solid #a8b4af; border-radius: 5px; background: white; }
.task-check.done { border-color: var(--forest); background: var(--forest); box-shadow: inset 0 0 0 4px white; }
.task-item strong { display: block; font-size: 9px; line-height: 1.4; }
.task-item small { display: block; margin-top: 5px; color: #8b9591; font-size: 8px; }
.task-actions { display: flex; gap: 8px; margin-top: 6px; }
.task-actions .link-button { padding: 0; font-size: 8px; }
.activity-stream { display: flex; flex-direction: column; gap: 10px; }
.activity-note { padding: 12px; border-left: 2px solid #bedbce; border-radius: 0 9px 9px 0; background: #f8faf9; }
.activity-note strong { display: block; font-size: 9px; }
.activity-note p { margin: 5px 0; color: #68756f; font-size: 9px; line-height: 1.45; }
.activity-note small { color: #939c98; font-size: 8px; }
.audit-list { display: flex; flex-direction: column; gap: 9px; }
.audit-row { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(0,1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.audit-row strong { display: block; font-size: 9px; }
.audit-row small { display: block; margin-top: 4px; color: #89948f; font-size: 8px; }
.audit-row code { overflow: auto; color: #5b6862; white-space: nowrap; font-size: 8px; }
.party-list { display: flex; flex-direction: column; gap: 8px; }
.party-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.party-role { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: #e8f2ed; font-size: 7px; font-weight: 900; }
.party-row.opponent .party-role { color: #974a43; background: #ffefed; }
.party-row strong { display: block; font-size: 9px; }
.party-row small { display: block; margin-top: 3px; color: #89948f; font-size: 7px; }
.party-row .link-button { white-space: nowrap; }
.access-panel { padding: 13px; border: 1px solid #cfe0d7; border-radius: 10px; background: #f3f8f5; }
.access-panel strong { display: block; font-size: 9px; }
.access-panel p { margin: 5px 0 0; color: #6b7973; font-size: 8px; line-height: 1.5; }
.focused-list { display: flex; flex-direction: column; }
.focused-row { display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(140px,.8fr) minmax(120px,.6fr) auto; align-items: center; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); cursor: pointer; }
.focused-row:last-child { border-bottom: 0; }
.focused-row:hover { background: #f6f9f7; }
.focused-row strong { display: block; font-size: 9px; }
.focused-row small { display: block; margin-top: 4px; color: #89948f; font-size: 7px; }
.focused-row time { color: #6f7b76; font-size: 8px; }
.calendar-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; margin-top: 16px; }
.calendar-shell { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.calendar-toolbar h2 { margin: 0; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.calendar-toolbar p { margin: 4px 0 0; color: #7a8580; font-size: 9px; }
.calendar-legend { display: flex; align-items: center; gap: 7px; color: #6b7671; font-size: 8px; font-weight: 800; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #bdc9c2; }
.legend-dot.hearing { background: #d84b45; }
.legend-dot.deadline { background: var(--forest); }
.legend-dot.task { background: #d79532; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-left: 1px solid var(--line); }
.calendar-weekday { padding: 10px 8px; border-right: 1px solid var(--line); color: #7b8782; background: #f8faf9; text-align: center; font-size: 7px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; }
.calendar-day { min-height: 116px; padding: 8px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); background: white; }
.calendar-day.muted { background: #f7f9f8; color: #a2aca7; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--lime); }
.calendar-date { margin-bottom: 7px; color: #33423c; font-size: 9px; font-weight: 900; }
.calendar-events { display: flex; flex-direction: column; gap: 5px; }
.calendar-event { width: 100%; padding: 6px 7px; border: 1px solid #dce6e0; border-left: 3px solid var(--forest); border-radius: 8px; background: #f8fbf9; text-align: left; cursor: pointer; }
.calendar-event.hearing { border-left-color: #d84b45; background: #fff7f6; }
.calendar-event.task { border-left-color: #d79532; background: #fffaf2; }
.calendar-event:hover { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(28,52,43,.08); }
.calendar-event strong { display: block; overflow: hidden; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; font-size: 7px; }
.calendar-event small { display: block; overflow: hidden; margin-top: 2px; color: #75817c; white-space: nowrap; text-overflow: ellipsis; font-size: 6px; }
.calendar-more { color: #7b8782; font-size: 7px; font-weight: 800; }
.calendar-side .focused-row { grid-template-columns: 1fr auto auto; padding: 12px 0; }
.category-label { display: inline-block; margin-top: 10px; padding: 4px 7px; border-radius: 8px; color: #476d5d; background: #edf6f1; font-size: 7px; font-weight: 800; }
.source-label { display: inline-flex; align-items: center; gap: 4px; color: #7b8782; font-size: 7px; font-weight: 700; }
.source-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #7fa18f; }
.document-register { overflow: hidden; }
.document-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.document-table th { padding: 11px 12px; color: #7c8883; background: #f8faf8; border-bottom: 1px solid var(--line); text-align: left; font-size: 7px; letter-spacing: .65px; text-transform: uppercase; }
.document-table th button { padding: 0; border: 0; color: inherit; background: transparent; font-size: inherit; font-weight: 800; letter-spacing: inherit; text-transform: inherit; }
.document-table td { padding: 11px 12px; border-bottom: 1px solid #edf1ee; color: #4e5b56; font-size: 8px; vertical-align: middle; }
.document-table tbody tr { cursor: pointer; transition: .15s ease; }
.document-table tbody tr:hover { background: #f4f8f5; }
.document-table tbody tr:last-child td { border-bottom: 0; }
.doc-name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-icon { width: 32px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #dce5e0; border-radius: 7px; color: var(--forest); background: #edf4f0; font-size: 7px; font-weight: 900; }
.file-icon.pdf { color: #aa4841; background: #fff0ef; }
.file-icon.docx { color: #4564ae; background: #edf1fc; }
.file-icon.image { color: #7d5992; background: #f6eff9; }
.file-icon.video { color: #a66d24; background: #fff4e3; }
.doc-name-cell strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); font-size: 9px; }
.doc-name-cell small { display: block; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #89948f; font-size: 7px; }
.version-pill { display: inline-block; min-width: 27px; padding: 4px 6px; border-radius: 7px; color: #52635c; background: #eef2f0; text-align: center; font-size: 7px; font-weight: 800; }
.register-footer { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); color: #7c8883; background: #fbfcfb; font-size: 8px; }
.document-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.summary-chip { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.summary-chip small { display: block; color: #83908a; font-size: 7px; text-transform: uppercase; }
.summary-chip strong { display: block; margin-top: 5px; font-size: 11px; }
.lifecycle { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 0; padding: 18px; overflow-x: auto; }
.lifecycle-step { position: relative; min-width: 112px; padding: 0 10px; text-align: center; }
.lifecycle-step:not(:last-child)::after { content: ""; position: absolute; left: 62%; right: -38%; top: 15px; height: 2px; background: #dfe6e2; }
.lifecycle-number { position: relative; z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; margin: auto; border: 2px solid #dce4e0; border-radius: 50%; color: #8b9691; background: white; font-size: 9px; font-weight: 800; }
.lifecycle-step.complete .lifecycle-number { color: white; border-color: var(--forest); background: var(--forest); }
.lifecycle-step.current .lifecycle-number { color: var(--forest); border-color: var(--lime); background: var(--lime); box-shadow: 0 0 0 5px var(--lime-soft); }
.lifecycle-step.complete::after { background: var(--forest); }
.lifecycle-step strong { display: block; margin-top: 10px; font-size: 8px; }
.lifecycle-step small { display: block; margin-top: 4px; color: #8a9590; font-size: 7px; line-height: 1.35; }
.intake-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.pipeline-column { min-width: 220px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #eef2ef; }
.pipeline-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; padding: 0 2px; }
.pipeline-head strong { font-size: 9px; text-transform: uppercase; letter-spacing: .6px; }
.pipeline-head span { min-width: 20px; padding: 3px 6px; border-radius: 8px; color: #68756f; background: white; text-align: center; font-size: 8px; }
.intake-card { margin-bottom: 9px; padding: 13px; border: 1px solid #e0e7e3; border-radius: 10px; background: white; box-shadow: 0 2px 5px rgba(33,52,45,.03); }
.intake-card { cursor: pointer; transition: .15s ease; }
.intake-card:hover { border-color: #afc8bc; transform: translateY(-1px); }
.intake-card:last-child { margin-bottom: 0; }
.intake-card strong { display: block; font-size: 9px; line-height: 1.4; }
.intake-card p { margin: 5px 0 10px; color: #7b8782; font-size: 8px; }
.gate-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 9px 0; padding: 8px; border-radius: 9px; background: #f7faf8; }
.gate-summary small { color: #7f8a85; font-size: 7px; font-weight: 800; }
.risk-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.risk { padding: 4px 7px; border-radius: 8px; color: #3d7259; background: #ebf6ef; font-size: 7px; font-weight: 800; }
.risk.medium { color: #9a641f; background: #fff1dc; }
.risk.high { color: #a64740; background: #ffebe9; }
.risk-row small { color: #929b97; font-size: 7px; }
.checklist { display: flex; flex-direction: column; gap: 9px; }
.check-row { display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.check-state { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--forest); background: var(--lime-soft); font-size: 9px; font-weight: 900; }
.check-state.pending { color: #9b6727; background: #fff2df; }
.check-row strong { display: block; font-size: 9px; }
.check-row small { display: block; margin-top: 3px; color: #8a9490; font-size: 7px; }
.check-row time { color: #8a9490; font-size: 7px; }
.client-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.client-card { padding: 17px; cursor: pointer; }
.record-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.record-meta span { padding: 4px 6px; border-radius: 7px; color: #617069; background: #f0f4f2; font-size: 7px; font-weight: 700; }
.client-head { display: flex; align-items: center; gap: 11px; }
.client-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: #e3eee8; font-family: Georgia, serif; font-size: 15px; }
.client-head strong { display: block; font-size: 11px; }
.client-head small { display: block; margin-top: 4px; color: #8a9490; font-size: 8px; }
.client-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.client-stats small { display: block; color: #8a9490; font-size: 8px; }
.client-stats strong { display: block; margin-top: 4px; font-size: 10px; }
.correspondence-layout { display: grid; grid-template-columns: 320px minmax(0,1fr); min-height: 600px; overflow: hidden; }
.message-list { border-right: 1px solid var(--line); }
.message-filter { padding: 12px; border-bottom: 1px solid var(--line); }
.message-filter input { width: 100%; height: 35px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 9px; }
.message-row { padding: 14px; border-bottom: 1px solid #edf0ee; cursor: pointer; }
.message-row:hover, .message-row.active { background: #f2f8f4; }
.message-row.unbound { border-left: 3px solid var(--amber); }
.message-row-head { display: flex; justify-content: space-between; gap: 8px; }
.message-row strong { font-size: 9px; }
.message-row time { color: #919a96; font-size: 7px; }
.message-row p { margin: 7px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
.message-row small { color: #89948f; font-size: 8px; }
.message-detail { padding: 24px; }
.message-detail h2 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.message-meta { display: flex; align-items: center; gap: 10px; margin: 18px 0; padding: 12px 0; border-block: 1px solid var(--line); }
.message-meta .avatar { color: white; background: var(--forest); }
.message-meta strong { display: block; font-size: 10px; }
.message-meta small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.message-body { max-width: 690px; color: #4d5a55; font-family: Georgia, serif; font-size: 12px; line-height: 1.8; }
.binding-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 24px; padding: 14px; border: 1px solid #f0d5ad; border-radius: 11px; background: #fff8ec; }
.binding-banner strong { display: block; color: #805726; font-size: 10px; }
.binding-banner small { color: #9d7a4e; font-size: 8px; }
.locked-context { min-height: 55px; padding: 11px 13px; border: 1px solid #bfd4c9; border-radius: 10px; background: #f1f8f4; }
.locked-context strong { display: block; color: var(--forest); font-size: 10px; }
.locked-context small { display: block; margin-top: 5px; color: #6f7e77; font-size: 8px; }
.mailbox-switcher { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.mailbox-switcher select { min-width: 0; flex: 1; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 8px; }
.mailbox-permission { padding: 4px 7px; border-radius: 8px; color: #3f6d59; background: #eaf4ef; font-size: 7px; font-weight: 800; }
.approval-banner { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; margin: 15px 0; padding: 12px; border: 1px solid #eed1a7; border-radius: 10px; background: #fff8ec; }
.approval-banner.approved { border-color: #c9e0d4; background: #f1f8f4; }
.approval-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #986120; background: #ffe9c8; font-size: 8px; font-weight: 900; }
.approval-banner.approved .approval-icon { color: #37694f; background: #dff1e7; }
.approval-banner strong { display: block; font-size: 9px; }
.approval-banner small { display: block; margin-top: 3px; color: #89765e; font-size: 7px; }
.approval-status { padding: 5px 8px; border-radius: 8px; color: #966122; background: white; font-size: 7px; font-weight: 800; }
.correspondence-type { display: inline-block; margin-right: 5px; padding: 3px 5px; border-radius: 6px; color: #5a6b64; background: #edf1ef; font-size: 6px; font-weight: 800; text-transform: uppercase; }
.compose-editor { min-height: 180px !important; font-family: Georgia, serif; line-height: 1.65; }
.attachment-box { padding: 12px; border: 1px dashed #bfcfc7; border-radius: 9px; color: #76837d; background: #f9fbfa; font-size: 8px; }
.attachment-option { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid #e5ece8; cursor: pointer; }
.attachment-option:last-child { border-bottom: 0; }
.attachment-option input { margin-top: 2px; }
.attachment-option strong, .attachment-option small { display: block; }
.attachment-option strong { color: #33423c; font-size: 9px; }
.attachment-option small { margin-top: 3px; color: #7c8983; font-size: 7px; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 13px; }
.workflow-step { padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: #77827e; background: #fafbfa; font-size: 7px; text-align: center; }
.workflow-step.active { color: var(--forest); border-color: #afc9bd; background: var(--lime-soft); font-weight: 800; }
.mailbox-table { width: 100%; border-collapse: collapse; }
.mailbox-table th, .mailbox-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; }
.mailbox-table th { color: #7d8984; background: #fafbfa; font-size: 7px; text-transform: uppercase; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.permission-tag { padding: 4px 6px; border-radius: 7px; color: #4d665b; background: #eef4f1; font-size: 6px; font-weight: 800; }
.empty-view { padding: 80px 20px; text-align: center; }
.empty-view span { width: 54px; height: 54px; display: grid; place-items: center; margin: auto; border-radius: 15px; color: var(--forest); background: var(--lime-soft); font-family: Georgia, serif; font-size: 20px; }
.empty-view h2 { margin: 17px 0 7px; font-family: Georgia, serif; font-weight: 500; }
.empty-view p { color: var(--muted); font-size: 11px; }
.modal-layer { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10,29,23,.55); backdrop-filter: blur(4px); }
.modal-layer.open { display: flex; }
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; border-radius: 17px; background: white; box-shadow: 0 30px 80px rgba(12,31,25,.25); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.modal-close { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; color: #63706b; background: white; }
.modal-body { padding: 21px 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; color: #596761; font-size: 9px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dbe2de; border-radius: 9px; outline: none; background: white; font-size: 10px; }
.field textarea { min-height: 82px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #84ad9b; box-shadow: 0 0 0 3px rgba(54,108,84,.09); }
.conditional-section { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfa; }
.conditional-section[hidden] { display: none; }
.section-label { grid-column: 1 / -1; margin: 0; font-family: Georgia, serif; font-size: 14px; font-weight: 500; }
.repeatable-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.small-remove { width: 38px; height: 39px; border: 1px solid #efcbc7; border-radius: 8px; color: #a54b44; background: #fff7f6; }
.add-inline { justify-self: start; grid-column: 1 / -1; border: 0; padding: 0; color: var(--forest); background: transparent; font-size: 8px; font-weight: 800; }
.directory-field { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.directory-field input { min-width: 0; }
.directory-add { width: 39px; height: 39px; border: 1px solid #bcd0c7; border-radius: 9px; color: var(--forest); background: #f2f8f5; font-size: 16px; font-weight: 800; }
.directory-note { display: block; margin-top: 5px; color: #8b9591; font-size: 7px; line-height: 1.4; }
.task-mini-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.task-mini { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; cursor: pointer; }
.task-mini:hover { background: #f3f8f5; }
.task-mini strong { display: block; font-size: 8px; }
.task-mini small { display: block; margin-top: 3px; color: #89948f; font-size: 7px; }
.task-mini time { color: #9c6322; font-size: 7px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 23px; border-top: 1px solid var(--line); background: #fafbfa; }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; min-height: 550px; }
.paper-preview { padding: 35px; background: #e9eeeb; }
.media-preview { min-height: 470px; display: grid; place-items: center; overflow: hidden; background: #202724; }
.media-preview img, .media-preview video, .media-preview iframe { width: 100%; max-height: 500px; border: 0; object-fit: contain; }
.preview-unavailable { max-width: 330px; padding: 25px; color: #dce6e1; text-align: center; }
.preview-unavailable .file-icon { width: 54px; height: 60px; margin: 0 auto 16px; color: var(--forest); background: var(--lime-soft); font-size: 10px; }
.preview-unavailable strong { display: block; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.preview-unavailable p { color: #aebdb7; font-size: 9px; line-height: 1.6; }
.paper { min-height: 470px; padding: 45px; background: white; box-shadow: 0 5px 20px rgba(36,52,46,.12); color: #27322e; font-family: Georgia, serif; font-size: 10px; line-height: 1.8; }
.paper h3 { text-align: center; font-size: 14px; }
.preview-meta { padding: 22px; border-left: 1px solid var(--line); }
.preview-meta h3 { margin: 0 0 18px; font-family: Georgia, serif; font-size: 16px; font-weight: 500; }
.preview-meta dl { margin: 0; }
.preview-meta dt { margin-top: 13px; color: #8b9591; font-size: 8px; text-transform: uppercase; }
.preview-meta dd { margin: 4px 0 0; font-size: 9px; line-height: 1.5; }
.metadata-tabs { display: flex; gap: 5px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.metadata-tab { padding: 6px 8px; border: 0; border-radius: 7px; color: #75817c; background: transparent; font-size: 8px; font-weight: 800; }
.metadata-tab.active { color: var(--forest); background: var(--lime-soft); }
.version-history { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.version-row { padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.version-row strong { display: block; font-size: 8px; }
.version-row small { display: block; margin-top: 3px; color: #8b9591; font-size: 7px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.service-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.service-card strong { display: block; font-size: 10px; }
.service-card small { display: block; margin-top: 5px; color: #7e8985; font-size: 8px; line-height: 1.45; }
.text-size-controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.text-size-sample { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.text-size-sample strong { display: block; font-size: 12px; }
.text-size-sample small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.guide-list, .faq-list { display: grid; gap: 9px; }
.guide-link, .faq-item { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.guide-link { display: block; color: var(--forest); text-decoration: none; font-size: 9px; font-weight: 800; }
.guide-link small, .faq-item small { display: block; margin-top: 4px; color: #7c8983; font-size: 8px; font-weight: 500; line-height: 1.45; }
.colour-input { display: flex; align-items: center; gap: 9px; }
.colour-input input[type="color"] { width: 42px; padding: 3px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast { min-width: 260px; padding: 13px 15px; border-left: 3px solid var(--lime); border-radius: 10px; color: white; background: #183a30; box-shadow: var(--shadow); font-size: 10px; animation: toast-in .25s ease; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: repeat(2, 1fr); }
  .case-layout { grid-template-columns: 1fr; }
  .case-hero-content { grid-template-columns: 1fr; align-items: stretch; }
  .case-hero-insights { padding-right: 0; }
  .intake-layout { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); transition: .25s ease; box-shadow: 12px 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .main { width: 100%; margin-left: 0; }
  .topbar { padding: 0 16px; }
  .mobile-menu { display: block; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 9px; }
  .global-search kbd, .icon-button { display: none; }
  .global-search input { padding-right: 10px; }
  .content { padding: 22px 16px 35px; }
  .page-head { flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .matter-table th:nth-child(2), .matter-table td:nth-child(2), .matter-table th:nth-child(4), .matter-table td:nth-child(4) { display: none; }
  .client-grid { grid-template-columns: 1fr; }
  .document-table th:nth-child(4), .document-table td:nth-child(4), .document-table th:nth-child(7), .document-table td:nth-child(7), .document-table th:nth-child(8), .document-table td:nth-child(8) { display: none; }
  .document-summary { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .correspondence-layout { grid-template-columns: 1fr; }
  .message-list { border-right: 0; }
  .message-detail { display: none; }
  .workflow-steps { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .case-hero-insights { grid-template-columns: 1fr; }
  .focused-row { grid-template-columns: 1fr auto; }
  .focused-row > :nth-child(2), .focused-row > :nth-child(3) { display: none; }
  .calendar-grid { grid-template-columns: 1fr; border-left: 0; }
  .calendar-weekday { display: none; }
  .calendar-day { min-height: auto; border-left: 1px solid var(--line); }
  .calendar-day.muted { display: none; }
  .preview-layout { grid-template-columns: 1fr; }
  .preview-meta { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .top-actions .button { width: 39px; padding: 0; font-size: 0; }
  .top-actions .button span { margin: 0; }
  .metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 108px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .conditional-section { grid-template-columns: 1fr; }
  .section-label, .repeatable-row, .add-inline { grid-column: auto; }
  .repeatable-row { grid-template-columns: 1fr auto; }
  .repeatable-row .field:nth-child(2) { grid-column: 1 / -1; }
  .quick-actions { grid-template-columns: 1fr; }
}
