:root {
  --navy: #142c3a;
  --gold: #b99457;
  --bg: #f5f6f5;
  --ink: #203541;
  --muted: #72808a;
  --line: #e5e9e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px system-ui, -apple-system, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 242px;
  background: var(--navy);
  color: white;
  padding: 34px 24px;
  display: flex;
  flex-direction: column;
}

.brand {
  font: 32px Georgia, serif;
  letter-spacing: -1px;
}

.brand b { color: #d9ba80; font-weight: 400; }

.subbrand {
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 10px;
  color: #bdc8ce;
}

.navlabel {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #8ca1af;
  margin: 45px 12px 16px;
}

nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  color: #b8c8d1;
  padding: 13px 14px;
  margin: 4px 0;
  text-align: left;
  border-radius: 8px;
}

nav button.active { background: #2a4350; color: white; }
nav span { font-size: 18px; width: 24px; text-align: center; }

.sidefoot {
  margin-top: auto;
  border-top: 1px solid #34505d;
  padding-top: 22px;
  color: #bccbd2;
  font-size: 12px;
  line-height: 1.7;
}

.sidefoot strong { color: #ecd5ae; letter-spacing: 1px; }
main { margin-left: 242px; }

header {
  height: 82px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: white;
}

.crumb { color: var(--muted); font-size: 12px; }
.account { display: flex; gap: 12px; align-items: center; }

.avatar {
  background: #ecede8;
  color: #63766a;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.account small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.demo {
  background: #faf4e7;
  color: #846a38;
  border: 1px solid #eadbb8;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 11px;
}

.content {
  max-width: 1380px;
  margin: auto;
  padding: 35px 42px;
}

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 1.7px;
  color: var(--gold);
  font-weight: 600;
}

h1 { font: 32px Georgia, serif; margin: 10px 0 12px; }
p { color: var(--muted); line-height: 1.6; }

.primary {
  background: var(--navy);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
}

.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 15px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 28px 0;
}

.stat, .panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stat { padding: 20px 22px; }

.statlabel {
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.stat strong {
  font-size: 29px;
  font-weight: 500;
  display: block;
  margin: 14px 0 7px;
}

.stat small { color: var(--muted); font-size: 11px; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 22px;
}

.panel { padding: 24px; margin-bottom: 22px; }

.panelhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

h2 { font-size: 16px; margin: 0; font-weight: 600; }

.textbtn {
  border: 0;
  background: none;
  color: #8d703e;
  font-size: 12px;
  padding: 4px;
}

.badge {
  font-size: 10px;
  background: #eaf2ee;
  color: #3b7760;
  padding: 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge.amber { background: #fbf2df; color: #97732e; }

.case {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 19px;
  margin-top: 14px;
}

.casetop {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.caseid {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}

h3 { font-size: 15px; font-weight: 600; margin: 10px 0; }
.case p { font-size: 12px; margin: 5px 0; }
.steps { display: flex; margin: 23px 0 17px; }

.step {
  flex: 1;
  border-top: 3px solid #e7ebea;
  padding-top: 10px;
  font-size: 10px;
  color: #98a4aa;
}

.step.done { border-color: #769889; color: #618675; }
.step.current { border-color: var(--gold); color: #937139; }

.casebottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  font-size: 11px;
  color: var(--muted);
}

.uploadbox {
  background: #fafbf9;
  border: 1px dashed #c6d1cd;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.uploadicon { font-size: 26px; color: #83978c; }
.uploadbox p { font-size: 12px; margin: 8px 0 15px; }

.uploadbox strong {
  display: block;
  margin-top: 10px;
  font-size: 13px;
}

.timeline { margin-top: 24px; }

.event {
  padding: 0 0 22px 24px;
  position: relative;
  border-left: 1px solid var(--line);
  margin-left: 5px;
}

.event::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  background: #b89a63;
  border-radius: 50%;
  box-shadow: 0 0 0 4px white;
}

.event strong { font-size: 12px; font-weight: 500; }
.event p { font-size: 11px; margin: 6px 0; }
.event small { font-size: 10px; color: #98a3aa; }

.docrow {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.docrow:last-child { border: 0; }

.fileicon {
  width: 38px;
  height: 44px;
  border: 1px solid #dce4df;
  background: #f6f9f6;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #61836e;
  border-radius: 5px;
}

.docinfo { flex: 1; }
.docinfo strong { font-size: 12px; font-weight: 500; }

.docinfo small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
}

.download {
  background: #f3f5f2;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  color: #567263;
}

.payamount { font-size: 25px; margin: 18px 0 8px; }

.payline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin: 13px 0;
}

.notice {
  background: #f7f4ee;
  border-radius: 6px;
  font-size: 11px;
  color: #8c7753;
  padding: 12px;
  line-height: 1.6;
}

.footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8d989e;
  margin: 10px 0 0;
}

.hidden { display: none !important; }
.empty { padding: 35px; text-align: center; }
.toolbar { display: flex; gap: 12px; align-items: center; }

.toolbar input {
  border: 1px solid var(--line);
  padding: 11px;
  border-radius: 6px;
  flex: 1;
}

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 14px 22px;
  border-radius: 8px;
  box-shadow: 0 8px 30px #0002;
  max-width: 90vw;
  z-index: 5;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  width: min(500px, 90vw);
  color: var(--ink);
}

dialog::backdrop { background: #142c3a66; }
dialog h2 { margin-bottom: 18px; }

label {
  display: block;
  margin: 15px 0 8px;
  font-size: 12px;
}

select, input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
}

.dialogfoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 1050px) {
  aside { width: 195px; padding: 28px 15px; }
  main { margin-left: 195px; }
  .content { padding: 26px; }
  header { padding: 0 26px; }
  .stats { gap: 10px; }
  .grid { grid-template-columns: 1fr; }
  .stat { padding: 17px; }
  .welcome { align-items: flex-start; }
}

@media (max-width: 650px) {
  aside { position: static; width: auto; padding: 18px; }
  .brand { font-size: 25px; }
  .subbrand, .navlabel, .sidefoot { display: none; }
  nav { display: flex; overflow: auto; margin-top: 15px; }
  nav button {
    width: auto;
    white-space: nowrap;
    font-size: 11px;
    padding: 9px;
  }
  nav span { display: none; }
  main { margin: 0; }
  header { height: 65px; padding: 0 18px; }
  .content { padding: 24px 18px; }
  .crumb { display: none; }
  .account { width: 100%; justify-content: flex-end; }
  .stats { grid-template-columns: 1fr 1fr; }
  .welcome { display: block; }
  h1 { font-size: 28px; }
  .welcome .primary { margin-top: 8px; }
  .panel { padding: 18px; }
  .footer { display: block; line-height: 1.8; }
}
