:root {
  --navy: #10253f;
  --navy-2: #173553;
  --teal: #0f766e;
  --teal-light: #e5f5f2;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
  --ink: #132033;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --shadow: 0 18px 45px rgba(15, 23, 42, .12);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); background: var(--canvas); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); background: #f7fafc; }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: clamp(50px, 8vw, 120px); color: white; background: radial-gradient(circle at 75% 20%, rgba(45, 212, 191, .28), transparent 30%), linear-gradient(145deg, #0b1d34 0%, #123e59 56%, #0f766e 100%); }
.login-brand::after { content: ""; position: absolute; right: -140px; bottom: -180px; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.025); }
.login-brand .eyebrow { color: #99f6e4; }
.login-brand h1 { margin: 0; max-width: 700px; font-size: clamp(38px, 4.6vw, 68px); line-height: 1.18; letter-spacing: -.04em; }
.login-lead { max-width: 680px; margin: 24px 0 0; color: #d7e7f0; font-size: 17px; line-height: 1.9; }
.brand-points { display: flex; flex-wrap: wrap; gap: 12px; position: relative; z-index: 1; }
.brand-points span { padding: 9px 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 13px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; color: white; background: linear-gradient(135deg, #14b8a6, #0f766e); border-radius: 13px; font-weight: 900; box-shadow: 0 8px 20px rgba(15,118,110,.26); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 17px; font-size: 23px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(420px, 100%); padding: 42px; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 32px; }
.login-card > .muted { margin: 8px 0 30px; }
label { display: grid; gap: 8px; margin: 16px 0; font-size: 14px; font-weight: 700; color: #334155; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.form-error { min-height: 20px; margin: 10px 0; color: var(--red); font-size: 13px; }
.security-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; }
.primary-button, .secondary-button, .icon-button { border: 0; border-radius: 10px; font-weight: 700; }
.primary-button { min-height: 42px; padding: 10px 18px; color: white; background: var(--teal); box-shadow: 0 7px 16px rgba(15,118,110,.18); }
.primary-button:hover { background: #0b625c; }
.secondary-button { min-height: 40px; padding: 9px 15px; color: #334155; background: white; border: 1px solid var(--line); }
.secondary-button:hover { background: #f8fafc; }
.wide { width: 100%; }
.icon-button { width: 38px; height: 38px; color: #475569; background: transparent; font-size: 20px; }
.icon-button:hover { background: #edf2f7; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; color: #dbe7f3; background: var(--navy); }
.sidebar-head { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-head strong { display: block; color: white; font-size: 15px; }
.sidebar-head small, .sidebar-foot small { display: block; margin-top: 3px; color: #89a1b9; font-size: 11px; }
#main-nav { flex: 1; overflow-y: auto; padding: 18px 12px; }
.nav-group { margin: 16px 10px 7px; color: #7890a8; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 43px; margin: 3px 0; padding: 9px 12px; color: #c7d5e4; background: transparent; border: 0; border-radius: 10px; text-align: left; }
.nav-item:hover { color: white; background: rgba(255,255,255,.07); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(20,184,166,.28), rgba(37,99,235,.12)); box-shadow: inset 3px 0 #2dd4bf; }
.nav-icon { width: 28px; color: #93c5fd; font-size: 12px; font-weight: 900; letter-spacing: .05em; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin: 12px; padding: 14px; background: rgba(255,255,255,.05); border-radius: 12px; }
.sidebar-foot strong { font-size: 12px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52,211,153,.1); }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-left, .topbar-actions, .user-chip { display: flex; align-items: center; gap: 12px; }
.topbar h2 { margin: 0; font-size: 22px; }
.user-chip { position: relative; padding: 6px 10px 6px 6px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: left; }
.user-chip:hover { background: #f8fafc; border-color: var(--line); }
.user-chip > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--navy-2); border-radius: 10px; font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.user-menu { position: absolute; top: 72px; right: 28px; z-index: 30; width: 160px; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.user-menu button { width: 100%; padding: 10px; background: transparent; border: 0; border-radius: 8px; text-align: left; }
.user-menu button:hover { background: #f1f5f9; }
.danger-text { color: var(--red); }
.content { min-height: calc(100vh - 84px); padding: 28px 30px 50px; }

.hero-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 24px 26px; overflow: hidden; color: white; background: linear-gradient(120deg, #123754, #0f766e); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(15,61,82,.14); }
.hero-strip h3 { margin: 0 0 8px; font-size: 24px; }
.hero-strip p { margin: 0; color: #cde8e4; line-height: 1.7; }
.hero-badge { flex: 0 0 auto; padding: 12px 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(255,255,255,.1); font-size: 13px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 7px 20px rgba(15,23,42,.035); }
.metric-card { padding: 19px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--teal); background: var(--teal-light); border-radius: 10px; font-size: 11px; font-weight: 900; }
.metric-value { margin: 16px 0 6px; font-size: 29px; font-weight: 850; letter-spacing: -.03em; }
.metric-foot { color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px,.55fr); gap: 18px; margin-top: 18px; }
.panel { padding: 22px; }
.panel-head, .page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head { margin-bottom: 18px; }
.panel h3 { margin: 0; font-size: 17px; }
.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.module-card { min-height: 112px; padding: 16px; color: var(--ink); background: #f8fafc; border: 1px solid var(--line); border-radius: 13px; text-align: left; }
.module-card:hover { border-color: #9bd7cf; background: #f1fbf9; transform: translateY(-1px); }
.module-card strong { display: block; margin-bottom: 7px; }
.module-card small { color: var(--muted); line-height: 1.55; }
.progress-list { display: grid; gap: 15px; }
.progress-row header { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 13px; }
.progress-row progress { width: 100%; height: 8px; overflow: hidden; appearance: none; border: 0; border-radius: 999px; background: #edf2f7; }
.progress-row progress::-webkit-progress-bar { background: #edf2f7; border-radius: 999px; }
.progress-row progress::-webkit-progress-value { background: linear-gradient(90deg,#14b8a6,#2563eb); border-radius: 999px; }
.progress-row progress::-moz-progress-bar { background: linear-gradient(90deg,#14b8a6,#2563eb); border-radius: 999px; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-header h3 { margin: 0 0 7px; font-size: 25px; }
.page-header p { margin: 0; color: var(--muted); line-height: 1.6; }
.table-panel { padding: 0; overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.table-toolbar input { max-width: 280px; min-height: 39px; }
.button-row { display: flex; gap: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 13px 15px; color: #475569; background: #f8fafc; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
td { padding: 14px 15px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
tbody tr:hover { background: #fbfdfd; }
.empty-state { display: grid; place-items: center; min-height: 280px; padding: 45px; text-align: center; }
.empty-state .empty-icon { display: grid; place-items: center; width: 58px; height: 58px; color: var(--teal); background: var(--teal-light); border-radius: 18px; font-weight: 900; }
.empty-state h4 { margin: 16px 0 7px; }
.empty-state p { max-width: 440px; margin: 0; color: var(--muted); line-height: 1.7; }
.status-pill, .role-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill { color: #08776b; background: #e4f7f3; }
.status-pill.off { color: #9f1239; background: #fff1f2; }
.role-pill { margin: 2px 3px 2px 0; color: #1d4ed8; background: #eff6ff; }
.kpi-guides { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-guide { padding: 17px; background: white; border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 12px; }
.kpi-guide strong { display: block; margin-bottom: 6px; }
.kpi-guide small { color: var(--muted); line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(2,12,27,.58); backdrop-filter: blur(4px); }
.modal-card { width: min(700px,100%); max-height: calc(100vh - 48px); overflow-y: auto; background: white; border-radius: 18px; box-shadow: var(--shadow); }
.modal-card > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; background: white; border-bottom: 1px solid var(--line); }
.modal-card h3 { margin: 0; }
.modal-card form { padding: 20px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1/-1; }
.checkbox-grid { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 8px 0 16px; }
.checkbox-option { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-weight: 500; }
.checkbox-option input { width: 16px; min-height: 16px; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: 360px; padding: 13px 18px; color: white; background: #0f766e; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #b91c1c; }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi-guides { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; padding: 45px 30px; }
  .login-brand h1 { font-size: 36px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; width: 256px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-grid; place-items: center; }
  .topbar { padding: 13px 18px; }
  .topbar .secondary-button { display: none; }
  .content { padding: 20px 16px 40px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi-guides { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .login-panel { padding: 18px; }
  .login-card { padding: 28px 22px; }
  .metrics-grid, .module-grid, .kpi-guides, .form-grid { grid-template-columns: 1fr; }
  .hero-strip, .page-header, .table-toolbar { align-items: flex-start; flex-direction: column; }
  .hero-badge { align-self: stretch; }
  .user-chip > span:last-child { display: none; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
}
