* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", -apple-system, sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 2px 8px rgba(15, 118, 110, .2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { font-weight: 700; color: #fff; font-size: 16px; letter-spacing: .5px; }
nav { display: flex; gap: 4px; }
nav a {
  padding: 8px 14px;
  text-decoration: none;
  color: rgba(255,255,255,.75);
  border-radius: 6px;
  font-size: 13px;
  transition: all .2s;
}
nav a.active, nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.8);
  font-size: 13px;
}
.page { max-width: 1320px; margin: 0 auto; padding: 28px 32px; }

/* Login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
}
.login-shell { width: min(420px, calc(100vw - 32px)); }
.login-panel {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.login-panel h1 { text-align: center; color: #0f766e; margin-bottom: 24px; }

/* Cards & Panels */
.hero, .panel, .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.02);
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
  border: 1px solid #99f6e4;
}
.hero h1 { color: #0f766e; }
h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
h2 { margin: 0 0 16px; font-size: 16px; font-weight: 600; color: #334155; }
h3 { margin: 18px 0 8px; font-size: 15px; color: #334155; }
p { color: #64748b; line-height: 1.7; margin: 4px 0; }

/* Stats Grid */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.client-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.dashboard-grid { margin-top: 24px; }
.risk-stats { margin-bottom: 18px; }
.card { padding: 22px; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.label { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.value { font-size: 30px; font-weight: 700; margin-top: 8px; color: #0f766e; }
.risk-high .value { color: #dc2626; }
.risk-medium .value { color: #d97706; }
.risk-low .value { color: #0284c7; }

/* Layout */
.layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.panel { padding: 24px; margin-bottom: 20px; }
.grow { flex: 1; min-width: 300px; }

/* Forms */
.form { display: grid; gap: 14px; min-width: 320px; }
.form.wide { max-width: 900px; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline input, .form-inline select { min-width: 120px; }
label { display: grid; gap: 6px; color: #374151; font-size: 13px; font-weight: 500; }
input, select, textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
textarea { resize: vertical; }

/* Buttons */
button, .primary, .secondary {
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  transition: all .2s;
}
.primary { background: #0f766e; color: #fff; box-shadow: 0 2px 4px rgba(15, 118, 110, .2); }
.primary:hover { background: #0d6560; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(15, 118, 110, .3); }
.secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.secondary:hover { background: #e2e8f0; }

/* PLACEHOLDER_MORE_CSS */

/* Tables */
.table { display: grid; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.tr { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 120px; }
.files-table .tr { grid-template-columns: 2fr 120px 220px 220px 220px; }
.clients-table .tr { grid-template-columns: 2fr 100px 70px 80px 70px 140px 180px; }
.client-periods-table .tr { grid-template-columns: 100px 80px 160px 1fr; }
.users-table .tr { grid-template-columns: 1fr 1fr 100px 90px 2fr; }
.logs-table .tr { grid-template-columns: 170px 150px 120px 150px 1fr; }
.backups-table .tr { grid-template-columns: 2fr 100px 180px 100px; }
.dashboard-table .tr { grid-template-columns: 2fr 1fr 180px; }
.tr > div { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.tr.head { background: #f8fafc; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.empty, .muted { color: #94a3b8; font-style: italic; }
.compact-text { margin: 2px 0 0; color: #94a3b8; font-size: 12px; line-height: 1.4; }
.error { color: #dc2626; background: #fef2f2; padding: 10px 14px; border-radius: 8px; border: 1px solid #fecaca; }

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 11px 12px;
  text-align: left;
}
.data-table th { background: #f8fafc; color: #64748b; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.data-table tr:hover td { background: #f8fafc; }

/* Title Row */
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.title-row.compact { margin-bottom: 12px; }
.actions-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions-inline form { margin: 0; }

/* Vouchers */
.voucher-list { display: grid; gap: 14px; }
.voucher-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  transition: box-shadow .2s;
}
.voucher-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.voucher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 13px;
}
.voucher-head strong { color: #0f766e; margin-right: 12px; }
.voucher-head span { margin-right: 10px; }
.summary { margin: 10px 0 12px; font-weight: 600; color: #1e293b; }
.ai-note {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fdfa, #ecfeff);
  border: 1px solid #99f6e4;
  color: #115e59;
  line-height: 1.6;
  font-size: 13px;
}
.status {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.voucher-actions { display: flex; gap: 8px; align-items: center; }

/* Entry Table */
.entry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.entry-table th, .entry-table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 9px 10px;
  text-align: left;
}
.entry-table th { background: #f8fafc; color: #64748b; font-size: 12px; }
.entry-table.editable input, .entry-table.editable select { width: 100%; min-width: 90px; }
.num { text-align: right !important; }
.strong-num { font-weight: 700; color: #0f766e; }

/* Risk */
.risk-list { display: grid; gap: 12px; }
.risk-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 14px 18px;
}
.risk-item.high { border-left-color: #dc2626; }
.risk-item.medium { border-left-color: #d97706; }
.risk-item.low { border-left-color: #0284c7; }
.risk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.high .risk-badge { background: #fef2f2; color: #dc2626; }
.medium .risk-badge { background: #fffbeb; color: #d97706; }
.low .risk-badge { background: #eff6ff; color: #0284c7; }
.suggestion { margin-bottom: 0; color: #475569; }

/* Activity */
.activity-list { display: grid; gap: 2px; }
.activity-item {
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 0 12px;
}
.activity-item:last-child { border-bottom: none; }
.activity-item p { margin: 4px 0; color: #64748b; font-size: 13px; }
.activity-item span { color: #94a3b8; font-size: 12px; }

/* Misc */
.toggle-row { display: flex; align-items: center; gap: 10px; }
.link-button { border: 0; background: transparent; color: #0f766e; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.danger-text { color: #dc2626; }
.small {
  padding: 5px 10px;
  font-size: 12px;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
  border-radius: 6px;
}
.small:hover { background: #ccfbf1; }
.danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.danger:hover { background: #fee2e2; }
.notice { border-radius: 8px; margin-bottom: 18px; padding: 12px 14px; }
.notice.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reset-form { display: flex; align-items: center; gap: 6px; }
.reset-form input { width: 120px; padding: 5px 8px; font-size: 12px; }
.mapping-fields { display: grid; grid-template-columns: 180px 1fr; gap: 12px; margin: 12px 0; }
.form-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; margin-bottom: 16px; }
.voucher-form { display: grid; gap: 16px; }
.form-actions { display: flex; gap: 10px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.priority-input { width: 72px; min-width: 72px; }
.compact-report { min-width: 320px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th, .report-table td { border-bottom: 1px solid #e5e7eb; padding: 10px 12px; text-align: left; }
.report-table th { background: #f8fafc; color: #475569; font-weight: 600; }
.summary-block p { margin: 6px 0; font-size: 13px; }
.summary-block strong { color: #334155; }

/* Responsive */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  nav { display: none; }
  .page { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .layout { flex-direction: column; }
  .form { min-width: auto; }
}
