:root {
  --navy: #083B73;
  --blue: #1265B0;
  --blue-light: #E8F3FF;
  --bg: #F5F7FA;
  --text: #1C2B3A;
  --muted: #8190A3;
  --border: #E4E9F0;
  --green: #16A34A;
  --red: #DC2626;
  --orange: #D97706;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #083B73, #1671BD); }
.login-card { width: 380px; background: #fff; border-radius: 18px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.22); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; color: var(--navy); }
.login-mark { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 12px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 800; }
.login-sub { color: var(--muted); margin: 6px 0 26px; font-size: 13px; }
.login-tip { margin-top: 20px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.form-error { color: var(--red); font-size: 13px; margin-bottom: 12px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,101,176,.12); }

.btn { border: 0; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; background: #EAF0F6; color: var(--text); transition: .15s; }
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.success { background: var(--green); color: #fff; }
.btn.danger { background: #FEE2E2; color: var(--red); }
.btn.ghost { background: transparent; color: #B9C6D5; border: 1px solid rgba(255,255,255,.18); }
.btn.block { width: 100%; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--navy); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand .login-mark { background: #fff; color: var(--blue); }
.side-title { font-size: 16px; font-weight: 800; }
.side-sub { font-size: 11px; opacity: .6; margin-top: 2px; }
#nav { flex: 1; padding: 14px 0; }
#nav a { display: block; color: rgba(255,255,255,.72); text-decoration: none; padding: 12px 22px; font-size: 14px; border-left: 3px solid transparent; }
#nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
#nav a.active { color: #fff; background: rgba(255,255,255,.1); border-left-color: #7BB3E8; font-weight: 700; }
.side-foot { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.side-user { margin-bottom: 10px; font-size: 13px; }
.role-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.14); }
.main { flex: 1; margin-left: 220px; padding: 0 28px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 18px; }
.topbar h1 { font-size: 20px; }

/* 卡片与表格 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 6px 18px rgba(8,59,115,.05); }
.stat-card .num { font-size: 30px; font-weight: 800; margin-top: 6px; }
.stat-card .lbl { color: var(--muted); font-size: 13px; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-card.clickable { cursor: pointer; transition: .15s; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(8,59,115,.12); }
.card { background: #fff; border-radius: 14px; padding: 20px 22px; margin-bottom: 22px; box-shadow: 0 6px 18px rgba(8,59,115,.05); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 13px; outline: none; background: #fff; }
.toolbar input { min-width: 220px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid #F0F3F7; vertical-align: middle; }
tr:hover td { background: #FAFCFE; }
tr[data-id] { cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #EEF2F7; color: #64748B; }
.status.pending { background: #FEF3C7; color: var(--orange); }
.status.assigned, .status.approved { background: var(--blue-light); color: var(--blue); }
.status.repairing { background: #EDE9FE; color: #7C3AED; }
.status.completed, .status.shipped { background: #DCFCE7; color: var(--green); }
.status.cancelled, .status.rejected { background: #FEE2E2; color: var(--red); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pager button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 趋势图 */
.trend { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, #1671BD, #083B73); border-radius: 6px 6px 0 0; min-height: 4px; }
.trend-lbl { font-size: 11px; color: var(--muted); }
.trend-num { font-size: 12px; font-weight: 700; color: var(--blue); }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(15,30,50,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 560px; max-width: calc(100vw - 40px); max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; }
.modal-close { border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }
.kv + .kv, .modal .field { margin-top: 14px; }

.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #1C2B3A; color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 13px; z-index: 99; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.toast.error { background: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.area-row { display: flex; gap: 8px; flex-wrap: wrap; }
.area-row select { flex: 1; min-width: 90px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 13px; background: #fff; }
.area-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.area-tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; background: var(--blue-light); color: var(--blue); border-radius: 999px; font-size: 12px; }
.area-tag i { font-style: normal; cursor: pointer; opacity: .7; }
.area-tag i:hover { opacity: 1; }
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .side-brand > div, .side-title, .side-sub, #nav a { font-size: 0; }
  #nav a { padding: 14px; text-align: center; }
  #nav a::first-letter { font-size: 14px; }
  .main { margin-left: 64px; }
  .grid-2 { grid-template-columns: 1fr; }
}
