:root {
  --ink: #142522;
  --muted: #71807c;
  --line: #e5ebe8;
  --canvas: #f5f7f5;
  --panel: #ffffff;
  --forest: #173d35;
  --forest-2: #215c4d;
  --mint: #dcece6;
  --amber: #d69535;
  --shadow: 0 5px 20px rgba(20, 47, 40, .055);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button { color: inherit; }
svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 248px; display: flex; flex-direction: column; color: #dfe9e5; background: var(--forest); padding: 29px 18px 22px; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 10px 38px; color: white; text-decoration: none; font-family: Georgia, serif; font-size: 25px; letter-spacing: -.4px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--forest); background: #e6c98e; border-radius: 10px 10px 10px 3px; font-size: 20px; font-weight: 700; }
.nav-label { margin: 0 13px 10px; color: #8eaaa2; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.main-nav { flex: 1; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 9px; padding: 11px 13px; margin: 3px 0; color: #bad0c9; background: transparent; cursor: pointer; text-align: left; transition: .2s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(255,255,255,.11); font-weight: 650; }
.nav-item svg { width: 19px; }
.nav-count { margin-left: auto; min-width: 23px; padding: 2px 6px; border-radius: 12px; color: #d8e7e2; background: rgba(255,255,255,.1); font-size: 11px; text-align: center; }
.alert-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #e6ad57; box-shadow: 0 0 0 3px rgba(230,173,87,.12); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.09); padding-top: 17px; }
.storage-row { display: flex; justify-content: space-between; margin: 0 6px 8px; color: #aec3bd; font-size: 11px; }
.storage-row strong { color: white; }
.progress { height: 4px; margin: 0 6px; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.1); }
.progress span { display: block; width: 68%; height: 100%; background: #dab977; }
.sidebar-footer p { margin: 7px 6px 19px; color: #78968d; font-size: 10px; }
.main-content { min-width: 0; margin-left: 248px; }
.topbar { height: 76px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); padding: 0 40px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.search-wrap { width: min(450px, 45vw); display: flex; align-items: center; gap: 10px; color: #8b9894; }
.search-wrap svg { width: 19px; }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-wrap input::placeholder { color: #8c9995; }
kbd { border: 1px solid #dce2df; border-bottom-width: 2px; border-radius: 5px; padding: 3px 7px; color: #84908d; background: #fafbfa; font: 10px system-ui; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.icon-btn { position: relative; display: grid; place-items: center; border: 0; color: #53625e; background: transparent; cursor: pointer; }
.notification-dot { position: absolute; top: -2px; right: -1px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #cf6b55; box-sizing: content-box; }
.user-profile { display: flex; align-items: center; gap: 10px; border-left: 1px solid var(--line); padding-left: 18px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 11px; font-weight: 750; }
.avatar-sand { color: #6f4d20; background: #efdbb5; }
.user-copy { display: flex; flex-direction: column; line-height: 1.25; }
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.user-profile > svg { width: 14px; color: #8d9996; }
.menu-toggle { display: none; }
.content { max-width: 1540px; margin: 0 auto; padding: 35px 40px 46px; }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 27px; }
.eyebrow { margin: 0 0 8px; color: #899792; font-size: 9px; font-weight: 750; letter-spacing: 1.35px; }
h1 { margin: 0 0 7px; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 36px); font-weight: 500; letter-spacing: -.7px; }
.welcome-row p:last-child { margin: 0; color: var(--muted); }
.primary-btn, .secondary-btn, .calendar-btn { border-radius: 8px; padding: 11px 16px; font-weight: 650; cursor: pointer; transition: transform .15s, background .15s; }
.primary-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--forest); color: white; background: var(--forest); box-shadow: 0 3px 9px rgba(23,61,53,.14); }
.primary-btn:hover { background: var(--forest-2); transform: translateY(-1px); }
.primary-btn svg { width: 16px; }
.secondary-btn { border: 1px solid var(--line); background: white; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 15px; min-height: 112px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); padding: 20px; box-shadow: var(--shadow); }
.stat-icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; }
.stat-icon.green { color: #3e7a68; background: #e4f0eb; }
.stat-icon.amber { color: #a46d29; background: #f8ecd9; }
.stat-icon.blue { color: #4e6f83; background: #e5eef3; }
.stat-icon.rose { color: #9e625a; background: #f5e8e5; }
.stat-card > div:last-child { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 3px 9px; }
.stat-card span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.stat-card strong { font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.stat-card small { overflow: hidden; color: #8a9693; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.stat-card small.positive { color: #49816e; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, .75fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px 17px; }
.panel-heading h2 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 18px; font-weight: 600; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.text-btn { border: 0; padding: 6px; color: var(--forest-2); background: transparent; font-size: 11px; font-weight: 650; cursor: pointer; }
.text-btn span { margin-left: 5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { border-block: 1px solid var(--line); padding: 10px 14px; color: #8c9895; background: #fafbfa; font-size: 9px; letter-spacing: .6px; text-align: left; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 23px; }
td { border-bottom: 1px solid #edf1ef; padding: 12px 14px; font-size: 11px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafcfb; }
.case-name { display: flex; align-items: center; gap: 10px; }
.case-name > div { display: flex; flex-direction: column; gap: 2px; }
.case-name strong { font-size: 11px; }
.case-name small { color: #919d99; font-size: 9px; }
.file-icon { display: grid; place-items: center; width: 31px; height: 35px; border-radius: 5px 5px 7px 5px; color: #407361; background: #e5f0eb; font-size: 8px; font-weight: 800; }
.blue-file { color: #55788d; background: #e7f0f4; }
.violet-file { color: #776991; background: #eeeaf5; }
.orange-file { color: #9a6b35; background: #f5eadb; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 5px 8px; font-size: 9px; font-weight: 650; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.progress-status { color: #3d7562; background: #e5f1ec; }
.review-status { color: #9a6b2a; background: #f8eddc; }
.signed-status { color: #607783; background: #e8eef1; }
.draft-status { color: #777f7d; background: #eef0ef; }
.muted { color: #9ca7a3; }
.more-btn { border: 0; color: #84918d; background: transparent; letter-spacing: 2px; cursor: pointer; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }
.deadline-panel { min-width: 0; }
.icon-btn.mini { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 7px; }
.icon-btn.mini svg { width: 15px; }
.timeline { padding: 0 23px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 47px 1fr; gap: 13px; padding: 12px 0; }
.timeline-item:not(:last-child) { border-bottom: 1px solid #edf1ef; }
.date-box { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 48px; border-radius: 8px; color: #48685e; background: #e8f0ed; }
.date-box strong { font-family: Georgia, serif; font-size: 18px; line-height: 1; }
.date-box span { margin-top: 4px; font-size: 7px; font-weight: 800; letter-spacing: .8px; }
.urgent .date-box { color: #9b584b; background: #f6e6e2; }
.timeline-item > div:last-child { min-width: 0; align-self: center; }
.tiny-label { color: #a1aaa7; font-size: 7px; font-weight: 750; letter-spacing: .8px; }
.urgent .tiny-label { color: #b76657; }
.timeline-item h3 { overflow: hidden; margin: 4px 0 3px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item p { overflow: hidden; margin: 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-btn { width: calc(100% - 46px); margin: 14px 23px 21px; border: 1px solid #d9e2de; color: #315b50; background: #f8faf9; font-size: 10px; }
.calendar-btn:hover { background: #eff5f2; }
.quick-section { padding-bottom: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 23px; }
.quick-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 15px; background: #fbfcfb; text-align: left; cursor: pointer; transition: .18s ease; }
.quick-card:hover { border-color: #cddbd6; background: #f6faf8; transform: translateY(-1px); }
.quick-icon { display: grid; place-items: center; flex: 0 0 auto; width: 37px; height: 37px; border-radius: 9px; color: #447163; background: #e6f0ec; }
.quick-icon svg { width: 17px; }
.quick-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.quick-card strong { font-size: 11px; }
.quick-card small { color: var(--muted); font-size: 9px; }
.quick-card .arrow { margin-left: auto; color: #6d827b; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(8,27,22,.52); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(460px, 100%); border-radius: 14px; background: white; padding: 30px; box-shadow: 0 24px 70px rgba(0,0,0,.2); animation: modalIn .2s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal h2 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 26px; }
.modal-intro { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.close-btn { position: absolute; top: 15px; right: 17px; border: 0; color: #788581; background: transparent; font-size: 25px; cursor: pointer; }
.modal form { display: grid; gap: 14px; }
.modal label { display: grid; gap: 7px; color: #465550; font-size: 11px; font-weight: 650; }
.modal input, .modal select { width: 100%; border: 1px solid #dce3e0; border-radius: 8px; outline: none; padding: 11px 12px; color: var(--ink); background: white; }
.modal input:focus, .modal select:focus { border-color: #6a9185; box-shadow: 0 0 0 3px rgba(60,111,95,.1); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.toast { position: fixed; z-index: 60; right: 25px; bottom: 25px; max-width: min(360px, calc(100vw - 40px)); border-radius: 9px; padding: 12px 16px; color: white; background: #173d35; box-shadow: 0 12px 30px rgba(0,0,0,.18); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1150px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .deadline-panel .timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
  .timeline-item { border: 1px solid var(--line) !important; border-radius: 9px; padding: 12px; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 12px 0 35px rgba(0,0,0,.15); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 20px; }
  .menu-toggle { display: grid; }
  .search-wrap { width: auto; flex: 1; }
  .user-copy, .user-profile > svg, kbd { display: none; }
  .user-profile { padding-left: 13px; }
  .content { padding: 28px 20px 40px; }
  .quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { height: 65px; gap: 12px; }
  .search-wrap input::placeholder { color: transparent; }
  .top-actions { gap: 10px; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .welcome-row .primary-btn { width: 100%; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 135px; align-items: flex-start; flex-direction: column; padding: 15px; }
  .stat-card > div:last-child { width: 100%; }
  .stat-card small { grid-column: 1 / -1; }
  .deadline-panel .timeline { display: block; }
  .timeline-item { margin-bottom: 9px; }
  .panel-heading { padding: 18px; }
  th:first-child, td:first-child { padding-left: 18px; }
  .quick-grid { padding: 0 18px; }
  .modal { padding: 26px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
