/* ========== Design Tokens ========== */
:root {
  --brand: #590816;
  --brand-dark: #3d0510;
  --brand-soft: #7a1a2c;
  --gold: #D4AF37;
  --gold-soft: #f0dc9a;
  --bg: #FAF7F1;
  --surface: #ffffff;
  --border: #e6e0d5;
  --border-strong: #d5cdbd;
  --text: #2a2521;
  --text-muted: #7a7268;
  --text-faint: #a49a8d;
  --danger: #b3261e;
  --success: #1f7a3d;
  --warning: #b7791f;
  --shadow-sm: 0 1px 2px rgba(89, 8, 22, 0.05);
  --shadow: 0 4px 14px rgba(89, 8, 22, 0.08);
  --shadow-lg: 0 12px 32px rgba(89, 8, 22, 0.14);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.req { color: var(--danger); }
code { background: rgba(212, 175, 55, 0.15); color: var(--brand); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ========== Login ========== */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(212, 175, 55, 0.10), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(89, 8, 22, 0.10), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 34px 34px 26px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.login-logo { margin-bottom: 14px; }
.login-logo img { width: 300px; max-width: 100%; height: auto; display: inline-block; }
.login-title { margin: 4px 0 4px; font-size: 21px; color: var(--brand); letter-spacing: 4px; }
.login-sub { margin: 0 0 22px; color: var(--text-muted); font-size: 12px; letter-spacing: 4px; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.login-foot { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border); color: var(--text-faint); font-size: 12px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 18px; margin: -4px 0 0; }

/* ========== Inputs & Buttons ========== */
.input {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(89, 8, 22, 0.10); }
.input-lg { padding: 11px 14px; font-size: 15px; }
.input-sm { padding: 5px 10px; font-size: 12px; width: auto; }
.textarea { resize: vertical; min-height: 60px; line-height: 1.6; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7268' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px;
  padding-right: 28px;
}
.field-label { font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border-radius: 6px; border: 1px solid transparent;
  cursor: pointer; font-weight: 500; letter-spacing: 0.5px;
  transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: rgba(89, 8, 22, 0.06); border-color: var(--brand); color: var(--brand); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: rgba(179, 38, 30, 0.4); }
.btn-danger-ghost:hover:not(:disabled) { background: rgba(179, 38, 30, 0.08); }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  background: transparent; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 16px; width: 30px; height: 30px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(89, 8, 22, 0.08); color: var(--brand); }

/* ========== Top Bar ========== */
.app-view { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 62px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-soft) 100%);
  color: #fff;
  display: flex; align-items: center; padding: 8px 24px; gap: 28px;
  box-shadow: 0 2px 8px rgba(89, 8, 22, 0.15);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.topbar-logo { width: 38px; height: 38px; object-fit: contain; display: block; }
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: 2px; }
.topbar-sub { font-size: 10px; opacity: 0.7; letter-spacing: 3px; margin-top: 2px; }
.topnav { flex: 1; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.nav-btn {
  background: transparent; color: rgba(255, 255, 255, 0.75); border: none;
  padding: 8px 18px; cursor: pointer; border-radius: 6px; letter-spacing: 1px;
  font-weight: 500; transition: all .15s;
}
.nav-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-btn.active { color: var(--gold); background: rgba(212, 175, 55, 0.12); box-shadow: inset 0 -2px 0 var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.whoami em {
  font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 10px;
  background: rgba(212, 175, 55, 0.18); color: var(--gold); letter-spacing: 1px;
}
.topbar-right .btn-ghost { color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.3); }
.topbar-right .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.5); }

/* ========== Main & Views ========== */
.main { flex: 1; padding: 24px; max-width: 1440px; margin: 0 auto; width: 100%; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.view-head h2 { margin: 0; font-size: 20px; color: var(--brand); letter-spacing: 2px; font-weight: 600; }
.view-head-right { display: flex; align-items: center; gap: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px; margin-bottom: 20px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; color: var(--brand); letter-spacing: 1px; font-weight: 600; }
.card-head h3::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--gold); margin-right: 8px; vertical-align: -2px; border-radius: 2px; }

/* ========== KPI ========== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid-6 { grid-template-columns: repeat(3, 1fr); }
.save-bar { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding-top: 12px; border-top: 1px dashed var(--border); }
.status-已到期 { background: rgba(122, 114, 104, 0.16); color: var(--text-muted); }

/* ========== 必填闪动提醒 ========== */
.field.err input, .field.err select, .field.err textarea {
  border-color: var(--danger) !important;
  background: rgba(179, 38, 30, 0.06) !important;
  animation: fieldShake .4s ease;
}
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.field-err-msg {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: errBlink 1.1s ease-in-out 2;
}
@keyframes errBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--gold));
}
.kpi-label { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; }
.kpi-value { font-size: 32px; font-weight: 700; color: var(--brand); margin: 8px 0 4px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value.money { font-size: 26px; }
.kpi-hint { font-size: 11px; color: var(--text-faint); }

/* ========== Charts ========== */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 0; }
.chart-card { margin-bottom: 20px; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-body { min-height: 220px; display: flex; align-items: center; justify-content: center; }
.donut-wrap { gap: 24px; }
.donut { flex: 0 0 190px; height: 190px; position: relative; }
.donut svg { display: block; }
.donut .center-num { font-size: 26px; font-weight: 700; fill: var(--brand); }
.donut .center-lbl { font-size: 11px; fill: var(--text-muted); letter-spacing: 1px; }
.legend { display: flex; flex-direction: column; gap: 8px; min-width: 130px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-name { color: var(--text); }
.legend-val { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 12px; }

.hbars { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.hbar-row { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: 12px; }
.hbar-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 18px; background: rgba(89, 8, 22, 0.06); border-radius: 3px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--brand) 0%, var(--brand-soft) 100%); border-radius: 3px; transition: width .5s ease; }
.hbar-fill.gold { background: linear-gradient(90deg, var(--gold) 0%, #b8952c 100%); }
.hbar-val { font-size: 12px; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

.vbars { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 210px; padding: 0 8px; }
.vbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.vbar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.vbar-fill {
  width: 100%; background: linear-gradient(180deg, var(--gold) 0%, var(--brand) 100%);
  border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: height .5s ease;
}
.vbar-num { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.vbar-lbl { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ========== Hearing list ========== */
.hearing-list { display: flex; flex-direction: column; gap: 8px; }
.hearing-item {
  display: grid; grid-template-columns: 110px 1fr 130px 90px;
  gap: 16px; align-items: center; padding: 12px 16px;
  background: rgba(212, 175, 55, 0.06); border-left: 3px solid var(--gold); border-radius: 4px;
  cursor: pointer;
}
.hearing-date { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.hearing-days { font-size: 12px; color: var(--text-muted); }
.hearing-name { font-size: 13px; color: var(--text); }
.hearing-empty { padding: 20px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ========== Filter & Table ========== */
.filter-card { padding: 16px 20px; }
.filter-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.filter-item { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.filter-item.grow { flex: 1; min-width: 240px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th {
  background: rgba(89, 8, 22, 0.04); color: var(--brand); font-weight: 600;
  letter-spacing: 0.5px; font-size: 12px; border-bottom: 2px solid var(--brand); white-space: nowrap;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: rgba(212, 175, 55, 0.06); }
.data-table tbody tr.clickable { cursor: pointer; }
.case-no { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--brand); font-weight: 500; }
.empty-cell { color: var(--text-faint); }
.money-cell { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand); }

.status-pill {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.5px;
  background: rgba(89, 8, 22, 0.08); color: var(--brand); white-space: nowrap;
}
.status-已签约 { background: rgba(31, 122, 61, 0.10); color: var(--success); }
.status-已发律师函 { background: rgba(58, 122, 88, 0.14); color: #2c6e4b; }
.status-签约后终止 { background: rgba(122, 114, 104, 0.14); color: var(--text-muted); }
.status-已立案 { background: rgba(74, 108, 174, 0.12); color: #3d5f9e; }
.status-已调解 { background: rgba(212, 175, 55, 0.18); color: #8a6f14; }
.status-已开庭 { background: rgba(183, 121, 31, 0.14); color: var(--warning); }
.status-结案 { background: rgba(89, 8, 22, 0.10); color: var(--brand); }
.status-归档 { background: rgba(42, 37, 33, 0.12); color: #2a2521; }
.staff-在职 { background: rgba(31, 122, 61, 0.10); color: var(--success); }
.staff-离职 { background: rgba(122, 114, 104, 0.14); color: var(--text-muted); }

.row-actions { display: flex; gap: 4px; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-faint); }
.empty.small { padding: 20px; font-size: 12px; }
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }

/* ========== Revenue extras ========== */
.recent-fees { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.recent-fee-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  padding: 8px 12px; background: rgba(250, 247, 241, 0.6);
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}
.recent-fee-row .rf-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-fee-row .rf-amt { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.recent-fee-row .rf-meta { grid-column: 1 / -1; color: var(--text-faint); font-size: 11px; }

/* ========== Settings ========== */
.settings-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
.settings-grid .card { margin-bottom: 20px; }
.card-head-right { display: inline-flex; align-items: center; gap: 10px; }

/* 账号管理横版表单 */
.user-form-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.3fr 0.9fr auto;
  gap: 14px 16px;
  align-items: end;
}
.user-form-row .field-full { grid-column: auto; }
@media (max-width: 1080px) {
  .user-form-row { grid-template-columns: 1fr 1fr; }
  .user-form-btn { grid-column: 1 / -1; }
}

.storage-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.st-item { background: rgba(250, 247, 241, 0.6); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.st-label { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }
.st-value { font-size: 20px; font-weight: 700; color: var(--brand); margin-top: 6px; font-variant-numeric: tabular-nums; }
.storage-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.storage-cols .field-label { margin-bottom: 8px; display: block; }
.storage-note { margin: 14px 0 0; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 4px 0; }
.pager .btn { padding: 4px 14px; font-size: 12px; }
.pager span { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.attach-cat.pin { background: rgba(212, 175, 55, 0.22); color: #8a6f14; }

/* ========== Follow alerts ========== */
.alert-chips { display: flex; gap: 14px; flex-wrap: wrap; }
.alert-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(250, 247, 241, 0.6); cursor: pointer;
  padding: 10px 18px; transition: all .15s;
}
.alert-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.alert-chip .chip-num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.alert-chip .chip-lbl { font-size: 12px; color: var(--text-muted); letter-spacing: .5px; }
.alert-chip.yellow { border-color: rgba(183, 121, 31, .45); background: rgba(183, 121, 31, .08); }
.alert-chip.yellow .chip-num { color: var(--warning); }
.alert-chip.red { border-color: rgba(179, 38, 30, .45); background: rgba(179, 38, 30, .07); }
.alert-chip.red .chip-num { color: var(--danger); }
.alert-chip.zero { opacity: .5; }

.follow-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.follow-item {
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(250, 247, 241, 0.5); padding: 10px 14px; font-size: 12px;
}
.follow-item .fi-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.follow-item .fi-date { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.follow-item .fi-note { color: var(--text); margin-top: 4px; white-space: pre-wrap; }
.follow-item .fi-meta { color: var(--text-faint); margin-top: 4px; }
.follow-item .fi-days { font-weight: 700; }
.follow-item .fi-days.yellow { color: var(--warning); }
.follow-item .fi-days.red { color: var(--danger); }
.follow-item .fi-actions { margin-left: auto; }
.type-unit { background: rgba(212, 175, 55, .18); color: #8a6f14; }
.type-case { background: rgba(74, 108, 174, .12); color: #3d5f9e; }
@media (max-width: 900px) {
  .storage-stats { grid-template-columns: repeat(2, 1fr); }
  .storage-cols { grid-template-columns: 1fr; }
}

/* ========== Modal ========== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(42, 37, 33, 0.55); backdrop-filter: blur(2px); }
.modal-panel {
  position: relative; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .18s ease;
}
.modal-lg { max-width: 940px; }
.modal-md { max-width: 680px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-head {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, rgba(89, 8, 22, 0.03), transparent);
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--brand); letter-spacing: 1.5px; font-weight: 600; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; background: rgba(250, 247, 241, 0.6);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.form-msg { min-height: 18px; font-size: 12px; color: var(--danger); }
.form-msg.ok { color: var(--success); }

/* ========== Fees ========== */
.h-fee::before { content: '💰 '; }
.fee-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fee-row {
  display: grid; grid-template-columns: 76px 110px 100px 80px 1fr 34px;
  gap: 10px; align-items: center; padding: 8px 12px;
  background: rgba(250, 247, 241, 0.6); border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}
.fee-row .fee-amt { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.fee-row .fee-del {
  background: transparent; border: 1px solid var(--border-strong); border-radius: 4px;
  color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 2px 0;
}
.fee-row .fee-del:hover { border-color: var(--danger); color: var(--danger); }
.fee-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fee-form .grow { flex: 1; min-width: 140px; }
.fee-form input[type="number"] { width: 120px; }
.fee-form input[type="date"] { width: 140px; }

/* ========== Attachments ========== */
.attach-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.attach-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.attach-head h4 { margin: 0; font-size: 14px; color: var(--brand); letter-spacing: 1px; font-weight: 600; }
.attach-head h4:not(.h-fee):not(.h-log)::before { content: '📎 '; }
.h-log::before { content: '🕘 '; }
.log-item .fi-date { font-variant-numeric: tabular-nums; }
.log-more { align-self: center; margin: 4px auto; display: flex; }
.log-end { text-align: center; padding: 6px 0; }

/* 收费表单行内提示 */
.fee-form-msg { margin-bottom: 8px; }
.input.fee-err {
  border-color: var(--danger) !important;
  background: rgba(179, 38, 30, 0.06) !important;
  animation: fieldShake .4s ease;
}
/* 条件必填视觉提示：金额>0 且未填时日期/方式金色边框呼吸 */
.input.fee-cond-req {
  border-color: var(--gold) !important;
  animation: condBreath 2s ease-in-out infinite;
}
@keyframes condBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  50% { box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25); }
}
.attach-head-right { display: flex; gap: 8px; align-items: center; }
.drop-zone {
  border: 1.5px dashed var(--border-strong); border-radius: 8px;
  padding: 14px; text-align: center; color: var(--text-faint); font-size: 12px;
  margin-bottom: 12px; transition: all .15s; background: rgba(250, 247, 241, 0.4);
}
.drop-zone.drag { border-color: var(--gold); background: rgba(212, 175, 55, 0.10); color: var(--brand); }
.upload-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.upload-progress .bar { flex: 1; height: 4px; background: rgba(89, 8, 22, 0.08); border-radius: 2px; overflow: hidden; }
.upload-progress .bar > div { height: 100%; background: var(--gold); width: 0%; transition: width .2s; }

.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach-item {
  display: grid; grid-template-columns: 32px 1fr 90px 90px 90px 80px;
  gap: 12px; align-items: center; padding: 10px 14px;
  background: rgba(250, 247, 241, 0.5); border: 1px solid var(--border);
  border-radius: 6px; transition: all .15s;
}
.attach-item:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.06); }
.attach-icon { font-size: 20px; text-align: center; }
.attach-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-cat { font-size: 11px; padding: 2px 8px; background: rgba(89, 8, 22, 0.06); color: var(--brand); border-radius: 10px; display: inline-block; text-align: center; }
.attach-size, .attach-date { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.attach-actions { display: flex; gap: 4px; justify-content: flex-end; }
.attach-actions button {
  background: transparent; border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 3px 8px; font-size: 11px; cursor: pointer; color: var(--text-muted);
}
.attach-actions button:hover { border-color: var(--brand); color: var(--brand); background: rgba(89, 8, 22, 0.04); }
.attach-actions button.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(179, 38, 30, 0.06); }

/* ========== About ========== */
.about-body p { margin: 6px 0; }
.about-site { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.site-link { display: inline-flex; align-items: center; line-height: 0; border-radius: 6px; transition: opacity .15s; }
.site-link:hover { opacity: 0.82; }
.site-link img { height: 44px; width: auto; display: block; }
.about-site a { color: var(--brand); }

/* ========== Toast ========== */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: rgba(42, 37, 33, 0.94); color: #fff;
  padding: 10px 20px; border-radius: 6px; font-size: 13px;
  box-shadow: var(--shadow-lg); z-index: 300; letter-spacing: 0.5px;
  animation: toastIn .18s ease; max-width: 90vw;
}
.toast.ok { background: rgba(31, 122, 61, 0.94); }
.toast.err { background: rgba(179, 38, 30, 0.94); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ========== Responsive ========== */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .topnav { gap: 2px; }
  .nav-btn { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 720px) {
  .main { padding: 16px; }
  .topbar { padding: 10px 14px; gap: 12px; flex-wrap: wrap; }
  .topbar-left { min-width: auto; }
  .topbar-sub { display: none; }
  .topnav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .attach-item { grid-template-columns: 24px 1fr 70px; row-gap: 6px; }
  .attach-item .attach-size, .attach-item .attach-date { display: none; }
  .fee-row { grid-template-columns: 70px 100px 1fr 30px; row-gap: 4px; }
  .hearing-item { grid-template-columns: 90px 1fr; row-gap: 6px; }
  .data-table th:nth-child(3), .data-table td:nth-child(3),
  .data-table th:nth-child(9), .data-table td:nth-child(9) { display: none; }
}
