/* ============ Design tokens ============ */
:root {
  --brand: #1677ff;
  --brand-strong: #0f66ea;
  --brand-deep: #0a3f9e;
  --brand-50: #eef5ff;
  --brand-100: #dcebff;
  --brand-200: #b8d7ff;
  --ink: #172033;
  --ink-2: #35425a;
  --muted: #78859a;
  --muted-2: #98a4b7;
  --line: #e8eef7;
  --line-strong: #dae2ee;
  --bg: #f4f7fb;
  --card: #ffffff;
  --green: #00a870;
  --green-soft: #e9f9f2;
  --orange: #f68a1e;
  --orange-soft: #fff4e6;
  --red: #eb4d4d;
  --red-soft: #fff0f0;
  --purple: #7b61ff;
  --purple-soft: #f1efff;
  --cyan: #00a6a6;
  --shadow-xs: 0 1px 2px rgba(20, 34, 58, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 34, 58, 0.04), 0 12px 28px rgba(20, 34, 58, 0.035);
  --shadow-md: 0 12px 40px rgba(20, 34, 58, 0.1);
  --shadow-blue: 0 8px 20px rgba(22, 119, 255, 0.22);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --font: "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
  --font-number: "SF Pro Display", "DIN Alternate", "Inter", "Arial Narrow", sans-serif;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-overlay { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
.icon { flex: 0 0 auto; }
::selection { background: rgba(22, 119, 255, 0.18); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e4; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b4c1d4; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid rgba(22, 119, 255, 0.55); outline-offset: 2px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2b86ff 0%, var(--brand) 55%, #0f6df2 100%);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(22, 119, 255, 0.32); }
.btn-secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { border-color: #b9cdf0; color: var(--brand); background: #fbfdff; }
.btn-soft { background: var(--brand-50); color: var(--brand-strong); }
.btn-soft:hover { background: #e4f0ff; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: #f3f6fb; color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 8px 18px rgba(235, 77, 77, 0.22); }
.btn-danger-soft { background: var(--red-soft); color: #d63c3c; }
.btn-white { background: #fff; color: var(--brand-deep); box-shadow: 0 5px 16px rgba(9, 47, 111, 0.16); }
.btn-white:hover { background: #f7fbff; }
.btn-glass { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.22); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.22); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-xs { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-spinner {
  width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: transparent; color: #64738a; transition: background 0.18s, color 0.18s;
}
.icon-btn:hover { background: #f1f5fa; color: var(--ink); }
.icon-btn.is-active { background: var(--brand-50); color: var(--brand); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.link-btn {
  border: 0; background: none; color: var(--brand); font-size: 12.5px; font-weight: 600;
  padding: 4px 0; display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { color: var(--brand-strong); }
.link-btn.muted { color: var(--muted); }
.link-btn.danger { color: var(--red); }

/* ============ Forms ============ */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 4px;
}
.field-label .required { color: var(--red); }
.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input::placeholder, .textarea::placeholder { color: #adb7c6; }
.input:hover, .select:hover, .textarea:hover { border-color: #c7d3e3; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}
.textarea { height: auto; min-height: 96px; padding: 11px 12px; resize: vertical; line-height: 1.65; }
.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2378859a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.input-sm, .select-sm { height: 34px; font-size: 12.5px; border-radius: 8px; }
.input-group { position: relative; }
.input-group .input { padding-left: 36px; }
.input-group .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-affix { position: relative; }
.input-affix .input { padding-right: 40px; }
.input-affix .affix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.field-help { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 13px;
  display: flex; align-items: center; gap: 8px;
}
.form-section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--brand); }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

.switch {
  position: relative; display: inline-flex; width: 38px; height: 22px; padding: 0;
  border: 0; border-radius: 20px; background: #dce3ee; transition: background 0.2s; flex: 0 0 auto;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 34, 58, 0.18);
  transition: transform 0.2s;
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

.checkbox {
  width: 17px; height: 17px; border: 1.5px solid #c6d2e2; border-radius: 5px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.checkbox[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.checkbox[aria-checked="true"]::after { content: "✓"; font-size: 11px; line-height: 1; font-weight: 700; }
.checkbox[data-indeterminate="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.checkbox[data-indeterminate="true"]::after { content: "—"; font-size: 12px; line-height: 1; }

/* ============ Badges & avatars ============ */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.green { color: #07875d; background: var(--green-soft); }
.status-badge.blue { color: #0f6bda; background: var(--brand-50); }
.status-badge.orange { color: #c87510; background: var(--orange-soft); }
.status-badge.gray { color: #69788e; background: #f1f4f8; }
.status-badge.red { color: #d63c3c; background: var(--red-soft); }
.status-badge.purple { color: #6650de; background: var(--purple-soft); }
.status-badge.lg { height: 28px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.soft-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; background: #f3f6fa; color: #69788e; font-size: 11px; font-weight: 600;
}
.level-badge {
  display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 5px;
  font-size: 10px; font-weight: 700; color: #748399; background: #f1f4f8; letter-spacing: 0.2px;
}
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: #f4f7fb; color: #69788e; font-size: 11px; }
.env-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  border: 1px solid #dbe9df; border-radius: 6px; background: #f4fbf7; color: #19875d; font-size: 10.5px; font-weight: 600;
}
.env-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #21b47a; box-shadow: 0 0 0 3px rgba(33, 180, 122, 0.12); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border-radius: 50%; color: #fff; font-weight: 600; letter-spacing: 0.2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  user-select: none;
}
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { margin-left: -7px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more { background: #e9eef6 !important; color: #65758b !important; font-weight: 700; }
.avatar-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(22, 119, 255, 0.18); }

/* ============ Progress ============ */
.progress-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.progress-track { flex: 1; height: 6px; border-radius: 6px; background: #edf1f7; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4b9bff, var(--brand)); transition: width 0.5s ease; }
.progress-label { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.progress-track.sm { height: 4px; }

/* ============ Toast ============ */
#toast-root { position: fixed; top: 78px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; min-width: 250px; max-width: 380px;
  padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff;
  box-shadow: 0 10px 30px rgba(20, 34, 58, 0.14); color: var(--ink-2); font-size: 13px; line-height: 1.5;
  opacity: 0; transform: translateX(18px); transition: opacity 0.22s, transform 0.22s;
  pointer-events: auto;
}
.toast.is-visible { opacity: 1; transform: translateX(0); }
.toast-icon { display: flex; margin-top: 1px; }
.toast-success .toast-icon { color: var(--green); }
.toast-error .toast-icon { color: var(--red); }
.toast-info .toast-icon { color: var(--brand); }

/* ============ Modal & drawer ============ */
.modal-layer, .drawer-layer {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.modal-layer.is-open, .drawer-layer.is-open { opacity: 1; pointer-events: auto; }
.modal-backdrop, .drawer-backdrop {
  position: absolute; inset: 0; background: rgba(16, 29, 49, 0.48); backdrop-filter: blur(4px);
}
.modal-card {
  position: relative; z-index: 1; width: 100%; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(11, 25, 48, 0.24);
  transform: translateY(14px) scale(0.985); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-layer.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-sm { max-width: 448px; }
.modal-md { max-width: 590px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 940px; }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 22px 24px 18px; border-bottom: 1px solid #f0f3f8;
}
.modal-header h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.modal-header p { margin-top: 5px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.modal-header-side { display: flex; align-items: center; gap: 8px; }
.modal-close { margin: -5px -7px 0 0; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 16px 24px; border-top: 1px solid #f0f3f8; background: #fcfdff;
}
.modal-footer .footer-left { margin-right: auto; }

.drawer-layer { justify-content: flex-end; padding: 0; }
.drawer {
  position: relative; z-index: 1; height: 100%; width: 100%; display: flex; flex-direction: column;
  background: var(--bg); box-shadow: -24px 0 70px rgba(11, 25, 48, 0.22);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-layer.is-open .drawer { transform: translateX(0); }
.drawer-lg { max-width: 680px; }
.drawer-md { max-width: 570px; }
.drawer-sm { max-width: 470px; }
.drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 20px 24px; background: #fff; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 17px; font-weight: 700; }
.drawer-head p { margin-top: 4px; font-size: 12px; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.drawer-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 14px 22px; background: #fff; border-top: 1px solid var(--line);
}
.confirm-content { display: flex; gap: 15px; align-items: flex-start; padding: 2px 0 4px; }
.confirm-icon {
  width: 46px; height: 46px; border-radius: 14px; background: var(--brand-50); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.confirm-icon.danger { background: var(--red-soft); color: var(--red); }
.confirm-icon.orange { background: var(--orange-soft); color: var(--orange); }
.confirm-message { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.65; }
.confirm-description { margin-top: 7px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

/* ============ Empty & skeleton ============ */
.empty-state { padding: 58px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.empty-icon {
  width: 64px; height: 64px; border-radius: 20px; background: #f3f7fc; color: #9aabc0;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.empty-state h3 { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.empty-state p { margin-top: 7px; font-size: 12.5px; line-height: 1.7; color: var(--muted); max-width: 320px; }
.empty-action { margin-top: 18px; }
.page-loading { padding: 24px 32px; }
.skeleton {
  background: linear-gradient(100deg, #edf1f7 15%, #f6f8fb 40%, #edf1f7 65%);
  background-size: 220% 100%; border-radius: 10px; animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position-x: -220%; } }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.skeleton-card { height: 126px; border-radius: var(--radius); }
.skeleton-panel { height: 360px; border-radius: var(--radius); }

/* ============ Login ============ */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(560px, 1.18fr) minmax(420px, 0.82fr);
  background: #fff;
}
.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: 42px clamp(40px, 5.5vw, 86px) 48px;
  background:
    radial-gradient(900px 600px at 12% 18%, rgba(47, 138, 255, 0.5), transparent 62%),
    radial-gradient(560px 480px at 90% 90%, rgba(30, 207, 192, 0.22), transparent 70%),
    linear-gradient(145deg, #071d3b 0%, #0a3472 42%, #0d5bc4 100%);
  display: flex; flex-direction: column;
}
.login-brand::before {
  content: ""; position: absolute; inset: 0; opacity: 0.18; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(110deg, rgba(0, 0, 0, 0.9), transparent 75%);
}
.login-brand::after {
  content: ""; position: absolute; width: 560px; height: 560px; right: -250px; top: -230px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 150px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100%; }
.brand-logo { display: flex; align-items: center; gap: 11px; width: fit-content; }
.brand-logo .logo-mark { width: 38px; height: 38px; border-radius: 11px; }
.brand-logo strong { font-size: 20px; letter-spacing: 1px; font-weight: 700; }
.brand-logo span { font-size: 10px; opacity: 0.55; letter-spacing: 2px; margin-left: 3px; align-self: flex-end; margin-bottom: 3px; }
.login-hero { margin-top: clamp(50px, 8vh, 96px); max-width: 600px; }
.login-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 20px; background: rgba(255, 255, 255, 0.07);
  font-size: 11px; letter-spacing: 1.2px; color: rgba(255, 255, 255, 0.72); backdrop-filter: blur(8px);
}
.login-eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #5ee2b5; box-shadow: 0 0 0 3px rgba(94, 226, 181, 0.14); }
.login-hero h1 {
  margin-top: 22px; font-size: clamp(40px, 3.6vw, 56px); line-height: 1.18; letter-spacing: -1.5px; font-weight: 700;
}
.login-hero h1 em { font-style: normal; color: #8cc4ff; }
.login-hero > p { margin-top: 20px; max-width: 500px; font-size: 15px; line-height: 1.8; color: rgba(255, 255, 255, 0.62); }
.login-features { display: flex; gap: 26px; margin-top: 32px; flex-wrap: wrap; }
.login-feature { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255, 255, 255, 0.74); }
.login-feature .feature-check {
  width: 18px; height: 18px; border-radius: 50%; background: rgba(94, 226, 181, 0.14);
  color: #6fe7bd; display: flex; align-items: center; justify-content: center;
}
.login-preview {
  position: relative; margin-top: auto; padding-top: 46px; max-width: 430px;
}
.preview-glow { position: absolute; inset: 26px -40px 0 10px; background: rgba(56, 148, 255, 0.22); filter: blur(36px); border-radius: 50%; }
.preview-card {
  position: relative; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(20px); padding: 19px 21px 17px;
  box-shadow: 0 26px 60px rgba(3, 19, 46, 0.32);
}
.preview-top { display: flex; justify-content: space-between; align-items: center; }
.preview-top span { font-size: 11px; color: rgba(255, 255, 255, 0.62); letter-spacing: 0.8px; }
.preview-status { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(57, 218, 159, 0.14); color: #71edc0; font-size: 10px; }
.preview-status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.preview-label { margin-top: 18px; font-size: 11px; color: rgba(255, 255, 255, 0.55); }
.preview-amount { margin-top: 4px; font-family: var(--font-number); font-size: 34px; font-weight: 600; letter-spacing: -0.5px; }
.preview-amount small { font-size: 14px; opacity: 0.7; margin-right: 4px; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.preview-grid span { display: block; font-size: 10px; color: rgba(255, 255, 255, 0.48); }
.preview-grid strong { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; font-family: var(--font-number); color: rgba(255, 255, 255, 0.88); }
.preview-float {
  position: absolute; right: -28px; bottom: 34px; display: flex; align-items: center; gap: 8px;
  padding: 10px 13px; border: 1px solid rgba(255, 255, 255, 0.17); border-radius: 11px;
  background: rgba(8, 38, 87, 0.72); backdrop-filter: blur(16px); box-shadow: 0 14px 32px rgba(3, 19, 46, 0.26);
  font-size: 10.5px; color: rgba(255, 255, 255, 0.78);
}
.preview-float .float-icon { width: 26px; height: 26px; border-radius: 8px; background: rgba(94, 226, 181, 0.16); color: #6fe7bd; display: flex; align-items: center; justify-content: center; }
.login-foot { margin-top: 30px; font-size: 10.5px; color: rgba(255, 255, 255, 0.35); display: flex; gap: 18px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(36px, 6vw, 90px); background: #fff; }
.login-card { width: 100%; max-width: 392px; margin: 0 auto; }
.login-mobile-logo { display: none; }
.login-card h2 { font-size: 28px; letter-spacing: -0.6px; font-weight: 700; }
.login-card .login-sub { margin-top: 9px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.login-form { margin-top: 30px; display: flex; flex-direction: column; gap: 17px; }
.login-input { height: 48px; border-radius: 11px; font-size: 14px; }
.login-password-wrap { position: relative; }
.login-password-wrap .input { padding-right: 44px; }
.password-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; }
.login-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.remember { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.login-submit { height: 48px; font-size: 14.5px; border-radius: 11px; margin-top: 3px; }
.demo-box { margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--line-strong); }
.demo-title { font-size: 11.5px; color: var(--muted); margin-bottom: 11px; display: flex; align-items: center; gap: 8px; }
.demo-title::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.demo-accounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo-account {
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; padding: 9px 6px;
  text-align: center; transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.demo-account:hover { border-color: var(--brand-200); background: var(--brand-50); transform: translateY(-1px); }
.demo-account strong { display: block; font-size: 12px; color: var(--ink-2); }
.demo-account span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted-2); }
.login-legal { margin-top: 25px; font-size: 10.5px; line-height: 1.7; color: #a2adbd; text-align: center; }
.login-legal a { color: #77859a; }
.login-error {
  display: none; padding: 10px 12px; border: 1px solid #ffd5d5; border-radius: 8px;
  background: #fff7f7; color: #d13d3d; font-size: 12px; line-height: 1.5;
}
.login-error.is-visible { display: block; }

.logo-mark {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(145deg, #2e8bff, #0b5fe0); box-shadow: 0 6px 14px rgba(22, 119, 255, 0.25);
  overflow: hidden;
}
.logo-mark::before {
  content: ""; position: absolute; width: 19px; height: 7px; border: 1.6px solid rgba(255, 255, 255, 0.95);
  border-radius: 4px; transform: rotate(-35deg);
}
.logo-mark::after {
  content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff;
  right: 8px; bottom: 8px;
}

/* ============ App shell ============ */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 232px;
  display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line);
}
.sidebar-head { height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 20px; flex: 0 0 auto; }
.sidebar-head .brand-logo strong { font-size: 18px; letter-spacing: 0.4px; }
.sidebar-head .brand-logo span { display: none; }
.sidebar-workspace {
  margin: 4px 13px 13px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fd); display: flex; align-items: center; gap: 9px;
}
.workspace-icon {
  width: 30px; height: 30px; border-radius: 8px; background: #eaf3ff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.workspace-text { min-width: 0; flex: 1; }
.workspace-text strong { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-text span { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.workspace-chevron { color: #a5b1c1; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 2px 12px 18px; }
.nav-section { margin-bottom: 18px; }
.nav-section-label { padding: 0 10px; margin-bottom: 6px; font-size: 10px; font-weight: 600; letter-spacing: 1.1px; color: #a0abbd; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 11px;
  border-radius: 9px; color: #5a687d; font-size: 13px; font-weight: 500; margin-bottom: 2px;
  transition: background 0.16s, color 0.16s;
}
.nav-item:hover { background: #f5f8fc; color: var(--ink-2); }
.nav-item.active { background: #ebf4ff; color: var(--brand-strong); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 11px; width: 3px; height: 18px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ffefe3; color: #d77a15; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-badge { background: #d9eaff; color: var(--brand-strong); }
.nav-item .nav-arrow { margin-left: auto; color: #b3bdcc; }
.sidebar-foot { padding: 10px 13px 16px; border-top: 1px solid #f0f3f8; }
.sidebar-help {
  display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 9px;
  font-size: 12px; color: var(--muted); width: 100%; border: 0; background: transparent; text-align: left;
}
.sidebar-help:hover { background: #f5f8fc; color: var(--ink-2); }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 9px 8px 2px; margin-top: 3px; }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-info strong { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { display: block; font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.sidebar-version { padding: 10px 9px 0; font-size: 9.5px; color: #bdc6d3; letter-spacing: 0.3px; }

.main-area { margin-left: 232px; min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 18px;
  padding: 0 28px; background: rgba(255, 255, 255, 0.88); border-bottom: 1px solid rgba(232, 238, 247, 0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.mobile-menu { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.breadcrumb strong { color: var(--ink-2); font-weight: 600; }
.breadcrumb .crumb-sep { color: #c2cad6; }
.topbar-right { display: flex; align-items: center; gap: 5px; }
.topbar-divider { width: 1px; height: 20px; background: var(--line); margin: 0 7px; }
.topbar-search { position: relative; width: 250px; margin-right: 8px; }
.topbar-search .input { height: 34px; border-color: transparent; background: #f5f7fb; font-size: 12px; border-radius: 9px; padding-left: 34px; }
.topbar-search .input:focus { background: #fff; border-color: var(--brand-200); }
.topbar-search .input-icon { left: 11px; }
.search-shortcut {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 9.5px; color: #9ba7b9;
  border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 4px; background: #fff;
}
.search-pop {
  position: absolute; top: 42px; left: 0; right: -40px; z-index: 60; padding: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(20, 34, 58, 0.16); max-height: 420px; overflow: auto;
}
.search-pop:empty { display: none; }
.search-group-label { padding: 8px 9px 4px; font-size: 9.5px; font-weight: 700; color: #9aa7ba; letter-spacing: 0.8px; }
.search-result { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.search-result:hover { background: #f5f9ff; }
.search-result-main { min-width: 0; flex: 1; }
.search-result-main strong { display: block; font-size: 12px; color: var(--ink-2); }
.search-result-main span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.search-result-end { font-size: 10px; color: var(--muted-2); }
.search-empty { padding: 18px 10px; text-align: center; font-size: 12px; color: var(--muted); }
.bell-wrap { position: relative; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #ff6b4a; border: 1.5px solid #fff; }
.profile-button {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 5px 4px 4px;
  border-radius: 10px; margin-left: 4px;
}
.profile-button:hover { background: #f4f7fb; }
.profile-button .profile-name { text-align: left; }
.profile-button .profile-name strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.profile-button .profile-name span { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 1px; }
.profile-menu {
  position: absolute; top: 56px; right: 24px; width: 230px; z-index: 70; padding: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-5px); pointer-events: none; transition: 0.18s;
}
.profile-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.profile-menu-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid #f2f5f9; margin-bottom: 5px; }
.profile-menu-head strong { display: block; font-size: 12px; }
.profile-menu-head span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.profile-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-size: 12px; color: var(--ink-2); text-align: left; }
.profile-menu-item:hover { background: #f5f8fc; }
.profile-menu-item.danger { color: var(--red); }
.profile-menu-sep { height: 1px; background: #f1f4f8; margin: 5px 2px; }
.topbar-user-mobile { display: none; }
.sidebar-scrim { display: none; }

.page { max-width: 1540px; margin: 0 auto; padding: 26px 30px 50px; animation: fadeUp 0.32s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ============ Page header ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head-main { min-width: 0; }
.page-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; color: #91a0b4; margin-bottom: 7px; text-transform: uppercase; }
.page-head h1 { font-size: 25px; line-height: 1.25; font-weight: 700; letter-spacing: -0.5px; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { margin-top: 8px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; padding-top: 3px; flex-wrap: wrap; justify-content: flex-end; }
.page-back { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-bottom: 11px; }
.page-back:hover { color: var(--brand); }
.month-select-wrap { position: relative; display: flex; align-items: center; }
.month-select-wrap .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.month-select-wrap .select { height: 38px; padding-left: 34px; border-color: var(--line-strong); background-color: #fff; font-size: 12.5px; font-weight: 600; min-width: 126px; border-radius: 10px; }

/* ============ Cards & stats ============ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px 22px; }
.card-hover { transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
.card-hover:hover { box-shadow: var(--shadow-sm); border-color: #dbe7f7; transform: translateY(-1px); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 15px;
  padding: 17px 18px 15px; box-shadow: var(--shadow-xs); min-width: 0;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.1px; }
.stat-icon { width: 31px; height: 31px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.stat-icon.blue { background: var(--brand-50); color: var(--brand); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.orange { background: var(--orange-soft); color: var(--orange); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon.cyan { background: #e8faf9; color: var(--cyan); }
.stat-value { margin-top: 10px; font-family: var(--font-number); font-size: 27px; line-height: 1.12; font-weight: 650; letter-spacing: -0.6px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value .unit { font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; min-height: 18px; font-size: 10.5px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: #07875d; }
.delta.down { color: #d45a3a; }
.delta.neutral { color: var(--muted); }
.stat-helper { color: var(--muted-2); font-size: 10px; }
.stat-spark { margin-left: auto; opacity: 0.9; }

/* ============ Dashboard ============ */
.dashboard-head { margin-bottom: 20px; }
.dashboard-greeting h1 { font-size: 26px; }
.dashboard-greeting .page-sub { font-size: 12.5px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 17px; align-items: start; }
.dash-left, .dash-right { display: flex; flex-direction: column; gap: 17px; min-width: 0; }
.hero-card {
  position: relative; overflow: hidden; min-height: 244px; border: 0; color: #fff; border-radius: 19px;
  background: radial-gradient(600px 300px at 85% 10%, rgba(86, 180, 255, 0.55), transparent 65%), linear-gradient(125deg, #0a3d8f 0%, #0e5cc9 52%, #1677ff 100%);
  padding: 24px 26px 20px; box-shadow: 0 14px 34px rgba(16, 91, 204, 0.22);
}
.hero-card::before {
  content: ""; position: absolute; right: -80px; top: -120px; width: 380px; height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255, 255, 255, 0.035), 0 0 0 115px rgba(255, 255, 255, 0.025);
}
.hero-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(to top, #000, transparent); pointer-events: none;
}
.hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.hero-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: 0.7px; color: rgba(255, 255, 255, 0.58); }
.hero-eyebrow .hero-dot { width: 5px; height: 5px; border-radius: 50%; background: #6fe7bd; box-shadow: 0 0 0 4px rgba(111, 231, 189, 0.12); }
.hero-status { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 7px; background: rgba(255, 255, 255, 0.1); color: #d6eaff; font-size: 10.5px; font-weight: 600; backdrop-filter: blur(8px); }
.hero-title { position: relative; z-index: 1; margin-top: 15px; font-size: 24px; font-weight: 650; letter-spacing: -0.4px; }
.hero-desc { position: relative; z-index: 1; margin-top: 7px; font-size: 12px; line-height: 1.65; color: rgba(255, 255, 255, 0.65); max-width: 460px; }
.hero-main { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 19px; }
.hero-metrics { display: flex; gap: 30px; }
.hero-metric span { display: block; font-size: 10px; color: rgba(255, 255, 255, 0.5); }
.hero-metric strong { display: block; margin-top: 4px; font-family: var(--font-number); font-size: 21px; font-weight: 600; letter-spacing: -0.2px; }
.hero-metric strong small { font-size: 10px; font-weight: 500; opacity: 0.6; margin-left: 2px; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hero-progress { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.progress-ring {
  position: relative; width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#7fe2c4 var(--progress), rgba(255, 255, 255, 0.14) 0);
}
.progress-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #1058b8; }
.progress-ring-value { position: relative; z-index: 1; font-family: var(--font-number); font-size: 17px; font-weight: 650; }
.progress-ring-label { font-size: 9.5px; color: rgba(255, 255, 255, 0.5); line-height: 1.5; }
.progress-ring-label strong { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.82); font-weight: 600; }
.hero-steps { position: relative; z-index: 1; display: flex; gap: 0; margin-top: 20px; padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.hero-step { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.hero-step-dot { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: transparent; }
.hero-step.is-done .hero-step-dot { background: #59dcae; border-color: #59dcae; color: #0a4b2e; }
.hero-step.is-current .hero-step-dot { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14); }
.hero-step span { font-size: 10px; color: rgba(255, 255, 255, 0.48); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-step.is-done span, .hero-step.is-current span { color: rgba(255, 255, 255, 0.84); }
.hero-step:not(:last-child)::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.15); margin: 0 7px; }

.todo-card { padding: 19px 19px 8px; }
.todo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.todo-head h2 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.todo-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff0e3; color: #d07814; font-size: 10px; font-weight: 700; }
.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px; border-top: 1px solid #f2f5f9; cursor: pointer; border-radius: 8px; transition: background 0.16s; }
.todo-item:hover { background: #fafcff; }
.todo-icon { width: 31px; height: 31px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.todo-icon.orange { background: var(--orange-soft); color: var(--orange); }
.todo-icon.blue { background: var(--brand-50); color: var(--brand); }
.todo-icon.purple { background: var(--purple-soft); color: var(--purple); }
.todo-icon.green { background: var(--green-soft); color: var(--green); }
.todo-main { min-width: 0; flex: 1; }
.todo-main strong { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.todo-main span { display: block; margin-top: 3px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.todo-meta { font-size: 9px; color: #a0adbf; white-space: nowrap; padding-top: 3px; }
.todo-foot { border-top: 1px solid #f2f5f9; padding: 9px 0 4px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 0; }
.panel-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.1px; }
.panel-head p { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.panel-body { padding: 16px 20px 20px; }
.panel-action { display: flex; align-items: center; gap: 10px; }
.legend { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend-dot { width: 6px; height: 6px; border-radius: 2px; }
.chart-shell { width: 100%; }
.line-chart { width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #edf1f7; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-axis-label { fill: #98a4b6; font-size: 9.5px; font-family: var(--font); }
.chart-value-label { fill: #65758c; font-size: 9px; font-family: var(--font); font-weight: 600; }
.chart-line { fill: none; stroke: var(--line-color); stroke-width: 2.5; stroke-linecap: round; }
.chart-dot { fill: #fff; stroke: var(--dot-color); stroke-width: 2.2; transition: r 0.15s; }
.chart-dot.is-draft { fill: #fff; stroke-dasharray: 2 2; }
.chart-dot-group:hover .chart-dot { r: 6; }
.sparkline { overflow: visible; }
.bar-chart { width: 100%; height: auto; }

.composition-body { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; border-radius: 50%; flex: 0 0 auto; transform: rotate(-28deg); }
.donut-hole { position: absolute; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(28deg); }
.donut-center-label { font-size: 9px; color: var(--muted); }
.donut-center-value { margin-top: 4px; font-family: var(--font-number); font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }
.composition-legend { flex: 1; min-width: 0; }
.comp-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f4f6fa; }
.comp-row:last-child { border-bottom: 0; }
.comp-dot { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
.comp-name { font-size: 10.5px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-amount { font-family: var(--font-number); font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.comp-percent { width: 34px; text-align: right; font-size: 9px; color: var(--muted-2); }
.recent-table-wrap { overflow-x: auto; }
.recent-table { width: 100%; border-collapse: collapse; }
.recent-table th { padding: 9px 12px; text-align: left; font-size: 9.5px; font-weight: 600; color: #93a0b2; border-bottom: 1px solid #f1f4f8; white-space: nowrap; }
.recent-table th:first-child { padding-left: 20px; }
.recent-table th:last-child { padding-right: 20px; text-align: right; }
.recent-table td { padding: 11px 12px; border-bottom: 1px solid #f5f7fa; font-size: 11.5px; color: var(--ink-2); }
.recent-table td:first-child { padding-left: 20px; }
.recent-table td:last-child { padding-right: 20px; text-align: right; }
.recent-table tr:last-child td { border-bottom: 0; }
.recent-table tbody tr { cursor: pointer; transition: background 0.15s; }
.recent-table tbody tr:hover { background: #f9fbff; }
.recent-period { display: flex; align-items: center; gap: 9px; }
.period-square { width: 30px; height: 30px; border-radius: 8px; background: #f1f6fe; color: var(--brand); display: flex; align-items: center; justify-content: center; font-family: var(--font-number); font-size: 10px; font-weight: 700; }
.recent-title strong { display: block; font-size: 11px; font-weight: 600; }
.recent-title span { display: block; margin-top: 2px; font-size: 9px; color: var(--muted-2); }

/* ============ Tables & list pages ============ */
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 0; margin-bottom: 17px; box-shadow: var(--shadow-xs); }
.summary-cell { padding: 13px 20px; border-right: 1px solid #f0f3f8; min-width: 0; }
.summary-cell:last-child { border-right: 0; }
.summary-cell span { display: block; font-size: 10px; color: var(--muted); }
.summary-cell strong { display: block; margin-top: 5px; font-family: var(--font-number); font-size: 20px; font-weight: 650; letter-spacing: -0.3px; color: var(--ink); }
.summary-cell strong small { font-family: var(--font); font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid #f0f3f8; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tabs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.tab {
  height: 31px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent;
  color: #6a788d; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.16s, color 0.16s;
}
.tab:hover { background: #f5f8fc; color: var(--ink-2); }
.tab.active { background: var(--brand-50); color: var(--brand-strong); font-weight: 600; }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #edf1f7; color: #7c8a9e; font-size: 9px; font-weight: 700; }
.tab.active .tab-count { background: #d8e9ff; color: var(--brand); }
.toolbar-search { position: relative; width: 210px; }
.toolbar-search .input { height: 34px; padding-left: 32px; font-size: 12px; border-radius: 8px; }
.toolbar-search .input-icon { left: 10px; }
.toolbar-select { min-width: 112px; height: 34px; font-size: 12px; border-radius: 8px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th {
  padding: 10px 13px; background: #fafbfd; border-bottom: 1px solid #eef2f8;
  font-size: 10px; font-weight: 600; color: #8b98ab; text-align: left; white-space: nowrap;
}
.data-table th:first-child { padding-left: 20px; }
.data-table th:last-child { padding-right: 20px; text-align: right; }
.data-table td { padding: 13px; border-bottom: 1px solid #f3f6fa; font-size: 12px; color: var(--ink-2); vertical-align: middle; }
.data-table td:first-child { padding-left: 20px; }
.data-table td:last-child { padding-right: 20px; text-align: right; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.14s; }
.data-table tbody tr:hover { background: #f9fbff; }
.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table .num { font-family: var(--font-number); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .num-strong { font-family: var(--font-number); font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.data-table .num-muted { color: var(--muted); }
.cell-main { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.cell-sub { display: block; margin-top: 3px; font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }
.cell-flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-text { min-width: 0; }
.cell-text strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-text span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }
.month-cell { display: flex; align-items: center; gap: 11px; }
.month-badge {
  width: 43px; height: 43px; border-radius: 10px; background: linear-gradient(145deg, #f0f7ff, #e7f1ff);
  color: var(--brand-deep); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto;
  border: 1px solid #dbe9fb;
}
.month-badge strong { font-family: var(--font-number); font-size: 15px; line-height: 1; font-weight: 700; letter-spacing: -0.4px; }
.month-badge span { margin-top: 3px; font-size: 8px; color: #6f8db5; letter-spacing: 0.5px; }
.month-badge.green { background: #effaf5; border-color: #d7f0e5; color: #0b8058; }
.month-badge.green span { color: #5a9c84; }
.batch-name strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.batch-name span { display: block; margin-top: 3px; font-size: 9.5px; color: var(--muted-2); }
.count-cell { display: flex; align-items: center; gap: 7px; }
.count-people { font-family: var(--font-number); font-weight: 650; color: var(--ink-2); }
.count-people small { font-family: var(--font); font-size: 9.5px; color: var(--muted); margin-left: 1px; }
.row-progress { min-width: 90px; }
.row-progress .progress-wrap { gap: 7px; }
.row-progress .progress-label { font-size: 9px; min-width: 24px; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-top: 1px solid #f1f4f8; flex-wrap: wrap; }
.table-info { font-size: 10.5px; color: var(--muted-2); }
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: #6e7e93; font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: #f2f6fc; color: var(--ink-2); }
.page-btn.active { background: var(--brand-50); color: var(--brand-strong); font-weight: 700; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-ellipsis { color: #a5b0c0; font-size: 11px; padding: 0 2px; }
.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.chip-filter {
  display: inline-flex; align-items: center; gap: 5px; height: 31px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #64738a; font-size: 11px;
}
.chip-filter:hover { border-color: #cbd9ec; }
.chip-filter.active { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-strong); font-weight: 600; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ============ Batch detail ============ */
.batch-head { align-items: flex-end; }
.batch-title-line { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.batch-title-line h1 { font-size: 24px; }
.batch-meta { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.batch-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #c6d0de; }
.batch-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 16px; }
.batch-kpi { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px 17px; box-shadow: var(--shadow-xs); }
.batch-kpi span { display: block; font-size: 10px; color: var(--muted); }
.batch-kpi strong { display: block; margin-top: 6px; font-family: var(--font-number); font-size: 22px; font-weight: 650; letter-spacing: -0.4px; }
.batch-kpi strong small { font-family: var(--font); font-size: 10px; color: var(--muted); margin-left: 2px; font-weight: 500; }
.process-panel { display: flex; align-items: center; gap: 20px; padding: 17px 20px; margin-bottom: 16px; }
.process-panel .process-steps { flex: 1; }
.process-meta { flex: 0 0 auto; text-align: right; border-left: 1px solid var(--line); padding-left: 20px; min-width: 132px; }
.process-meta span { display: block; font-size: 9.5px; color: var(--muted); }
.process-meta strong { display: block; margin-top: 4px; font-family: var(--font-number); font-size: 18px; font-weight: 650; }
.process-meta strong small { font-family: var(--font); font-size: 9px; color: var(--muted); font-weight: 500; }
.process-steps { display: flex; align-items: flex-start; gap: 0; }
.process-step { flex: 1; display: flex; align-items: flex-start; gap: 8px; min-width: 0; position: relative; }
.process-step:not(:last-child)::after { content: ""; position: absolute; top: 12px; left: 31px; right: 10px; height: 1px; background: #e8edf5; }
.process-step.is-done:not(:last-child)::after { background: #9fdfc8; }
.step-marker {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid #d7e0ec; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #9aa7ba;
  flex: 0 0 auto; position: relative; z-index: 1;
}
.process-step.is-done .step-marker { background: var(--green); border-color: var(--green); color: #fff; }
.process-step.is-current .step-marker { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.1); }
.step-text { min-width: 0; padding-top: 1px; }
.step-text strong { display: block; font-size: 10.5px; font-weight: 600; color: #8997aa; white-space: nowrap; }
.step-text span { display: block; margin-top: 3px; font-size: 8.5px; color: #aab5c5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.process-step.is-done .step-text strong, .process-step.is-current .step-text strong { color: var(--ink-2); }
.process-step.is-done .step-text span, .process-step.is-current .step-text span { color: var(--muted); }
.batch-toolbar { padding: 12px 17px; }
.batch-toolbar .toolbar-search { width: 190px; }
.selected-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px; background: #f3f8ff;
  border-bottom: 1px solid #e2eefc; font-size: 11px; color: var(--brand-deep);
}
.selected-bar strong { font-weight: 700; }
.batch-check { width: 17px; height: 17px; }
.employee-cell .avatar { width: 32px; height: 32px; font-size: 12px; }
.status-viewed { display: inline-flex; align-items: center; gap: 5px; color: #7c8b9f; font-size: 10.5px; }
.status-viewed.is-viewed { color: #08875e; }

/* ============ Payslip drawer ============ */
.slip-hero {
  position: relative; overflow: hidden; border-radius: 17px; padding: 20px 22px 18px; color: #fff;
  background: radial-gradient(360px 200px at 90% 0, rgba(97, 176, 255, 0.35), transparent 65%), linear-gradient(135deg, #0a2b5d, #0d4b9e 55%, #1468d8);
  box-shadow: 0 12px 30px rgba(13, 69, 145, 0.2);
}
.slip-hero::after {
  content: ""; position: absolute; right: -45px; bottom: -95px; width: 240px; height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.03);
}
.slip-hero-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slip-period { font-size: 11px; color: rgba(255, 255, 255, 0.65); letter-spacing: 0.5px; }
.slip-status { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(89, 220, 174, 0.15); color: #7cedc4; font-size: 9.5px; font-weight: 600; }
.slip-label { position: relative; z-index: 1; margin-top: 18px; font-size: 10px; color: rgba(255, 255, 255, 0.55); }
.slip-net { position: relative; z-index: 1; margin-top: 2px; font-family: var(--font-number); font-size: 36px; font-weight: 650; letter-spacing: -1px; line-height: 1.2; }
.slip-net small { font-size: 16px; font-weight: 500; opacity: 0.7; margin-right: 3px; }
.slip-person { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.slip-person .avatar { border-color: rgba(255, 255, 255, 0.2); }
.slip-person-text strong { display: block; font-size: 12px; font-weight: 600; }
.slip-person-text span { display: block; margin-top: 2px; font-size: 9.5px; color: rgba(255, 255, 255, 0.53); }
.slip-person-end { margin-left: auto; text-align: right; font-size: 9px; color: rgba(255, 255, 255, 0.52); }
.slip-person-end strong { display: block; color: rgba(255, 255, 255, 0.85); font-size: 10px; font-weight: 500; margin-bottom: 2px; }
.slip-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 14px 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.slip-summary > div { background: #fff; padding: 12px 14px; }
.slip-summary span { display: block; font-size: 9.5px; color: var(--muted); }
.slip-summary strong { display: block; margin-top: 5px; font-family: var(--font-number); font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.slip-summary .deduct strong { color: #d45555; }
.slip-section { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.slip-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; border-bottom: 1px solid #f1f4f8; }
.slip-section-head h3 { font-size: 11.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.slip-section-head .section-dot { width: 6px; height: 6px; border-radius: 2px; background: var(--brand); }
.slip-section-head .section-dot.red { background: var(--red); }
.slip-section-head .section-dot.purple { background: var(--purple); }
.slip-section-head span { font-size: 9px; color: var(--muted-2); }
.slip-items { padding: 2px 15px 5px; }
.slip-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f6f8fb; }
.slip-item:last-child { border-bottom: 0; }
.slip-item-name { font-size: 10.5px; color: var(--muted); }
.slip-item-amount { font-family: var(--font-number); font-size: 11.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slip-item-amount.deduct { color: #cf5252; }
.slip-total-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px; background: #fafcff; border-top: 1px solid #eef3fa; }
.slip-total-row span { font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.slip-total-row strong { font-family: var(--font-number); font-size: 14px; font-weight: 650; }
.slip-note { display: flex; gap: 8px; padding: 10px 12px; margin-top: 2px; border-radius: 9px; background: #f7f9fc; color: var(--muted); font-size: 9.5px; line-height: 1.65; }
.slip-note .icon { color: #91a1b5; margin-top: 1px; }
.slip-bank { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; margin-bottom: 12px; }
.slip-bank-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.slip-bank-text { flex: 1; }
.slip-bank-text span { display: block; font-size: 9px; color: var(--muted-2); }
.slip-bank-text strong { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.slip-bank-end { font-size: 9px; color: var(--muted-2); }
.slip-feedback-list { margin: 0 0 12px; }
.feedback-mini { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; margin-bottom: 8px; }
.feedback-mini-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.feedback-mini-top strong { font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.feedback-mini p { margin-top: 6px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.feedback-reply { margin-top: 8px; padding: 8px 10px; background: #f7faf8; border-radius: 7px; font-size: 9.5px; color: #4b6b5e; line-height: 1.6; }
.feedback-reply strong { color: #19875d; }

/* ============ Employees ============ */
.filter-panel { display: flex; align-items: center; gap: 12px; padding: 13px 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px; flex-wrap: wrap; box-shadow: var(--shadow-xs); }
.dept-filter-scroll { display: flex; gap: 5px; flex-wrap: wrap; }
.dept-chip {
  border: 1px solid transparent; background: transparent; color: #6a788d; height: 30px; padding: 0 9px;
  border-radius: 7px; font-size: 11px; display: inline-flex; align-items: center; gap: 5px;
}
.dept-chip:hover { background: #f5f8fc; }
.dept-chip.active { background: var(--brand-50); color: var(--brand-strong); font-weight: 600; }
.employee-cell { display: flex; align-items: center; gap: 10px; }
.employee-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.employee-meta { display: block; margin-top: 2px; font-size: 9px; color: var(--muted-2); }
.dept-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: #5f6f84; }
.dept-dot { width: 6px; height: 6px; border-radius: 2px; flex: 0 0 auto; }
.bank-status { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted); }
.bank-status.missing { color: #d4811a; }
.salary-amount { display: block; font-family: var(--font-number); font-size: 12px; font-weight: 650; }
.salary-amount small { font-size: 9px; color: var(--muted); font-family: var(--font); font-weight: 400; }
.profile-summary { display: flex; gap: 12px; align-items: center; padding: 4px 0 16px; border-bottom: 1px solid #f1f4f8; margin-bottom: 16px; }
.profile-summary h3 { font-size: 16px; font-weight: 700; }
.profile-summary p { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.profile-summary-meta { margin-left: auto; text-align: right; font-size: 9.5px; color: var(--muted); }
.profile-summary-meta strong { display: block; font-family: var(--font-number); font-size: 15px; color: var(--ink); }

/* ============ Analytics ============ */
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr); gap: 17px; margin-bottom: 17px; }
.analytics-bottom { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr); gap: 17px; margin-bottom: 17px; }
.dept-rank-list { padding: 5px 20px 16px; }
.dept-rank-row { padding: 12px 0; border-bottom: 1px solid #f3f6fa; }
.dept-rank-row:last-child { border-bottom: 0; }
.dept-rank-top { display: flex; align-items: center; gap: 9px; }
.rank-index { width: 18px; height: 18px; border-radius: 6px; background: #f2f5f9; color: #8795a8; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-number); font-size: 9px; font-weight: 700; flex: 0 0 auto; }
.rank-index.top { background: #fff1e0; color: #d9851c; }
.dept-rank-name { font-size: 11px; font-weight: 600; color: var(--ink-2); flex: 1; }
.dept-rank-headcount { font-size: 9px; color: var(--muted-2); }
.dept-rank-amount { font-family: var(--font-number); font-size: 11px; font-weight: 650; color: var(--ink); margin-left: 8px; }
.dept-rank-bar { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding-left: 27px; }
.dept-rank-bar .progress-track { height: 5px; }
.dept-rank-bar span { font-size: 8.5px; color: var(--muted-2); min-width: 38px; text-align: right; }
.histogram { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding: 14px 4px 0; }
.histo-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.histo-value { font-family: var(--font-number); font-size: 10px; font-weight: 600; color: var(--ink-2); }
.histo-bar { width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #4b9bff, #1677ff); min-height: 3px; transition: height 0.3s; }
.histo-col:nth-child(2n) .histo-bar { background: linear-gradient(180deg, #86bfff, #4b9bff); }
.histo-label { font-size: 8.5px; color: var(--muted-2); white-space: nowrap; }
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.insight-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.insight-card.blue { background: linear-gradient(145deg, #f7fbff, #eef6ff); border-color: #dceafb; }
.insight-card.green { background: linear-gradient(145deg, #f8fdfb, #eefaf5); border-color: #d9f1e7; }
.insight-card.purple { background: linear-gradient(145deg, #faf9ff, #f3f0ff); border-color: #e6e1ff; }
.insight-label { font-size: 9.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.insight-card strong { display: block; margin-top: 7px; font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.insight-card p { margin-top: 5px; font-size: 9.5px; color: var(--muted); line-height: 1.6; }

/* ============ Settings ============ */
.settings-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 17px; align-items: start; }
.settings-nav { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 7px; position: sticky; top: 80px; }
.settings-nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 38px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: #64738a; font-size: 11.5px; text-align: left; margin-bottom: 2px;
}
.settings-nav button:hover { background: #f5f8fc; color: var(--ink-2); }
.settings-nav button.active { background: var(--brand-50); color: var(--brand-strong); font-weight: 600; }
.settings-nav button .nav-icon { color: #8796aa; }
.settings-nav button.active .nav-icon { color: var(--brand); }
.settings-content { min-width: 0; display: flex; flex-direction: column; gap: 15px; }
.settings-section { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-xs); overflow: hidden; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 15px; border-bottom: 1px solid #f1f4f8; }
.settings-section-head h2 { font-size: 14px; font-weight: 700; }
.settings-section-head p { margin-top: 5px; font-size: 10.5px; line-height: 1.6; color: var(--muted); max-width: 600px; }
.settings-section-body { padding: 19px 20px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid #f2f5f9; background: #fcfdff; }
.rate-table { width: 100%; border-collapse: collapse; }
.rate-table th { padding: 8px 10px; font-size: 9.5px; color: #8f9caf; font-weight: 600; text-align: left; border-bottom: 1px solid #eef2f7; }
.rate-table td { padding: 9px 10px; border-bottom: 1px solid #f4f6fa; font-size: 11px; color: var(--ink-2); }
.rate-table tr:last-child td { border-bottom: 0; }
.rate-input { width: 82px; height: 32px; padding: 0 8px; font-family: var(--font-number); font-size: 11.5px; text-align: right; border: 1px solid var(--line); border-radius: 7px; }
.rate-input:focus { border-color: var(--brand); outline: none; }
.rate-suffix { margin-left: 4px; font-size: 9px; color: var(--muted); }
.items-table .type-chip { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 9px; font-weight: 600; }
.type-chip.income { background: var(--green-soft); color: #07875d; }
.type-chip.deduction { background: var(--red-soft); color: #ce4848; }
.type-chip.required { background: var(--brand-50); color: var(--brand); }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.role-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; }
.role-card-top { display: flex; align-items: center; gap: 9px; }
.role-icon { width: 31px; height: 31px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.role-card strong { font-size: 11.5px; font-weight: 650; }
.role-card p { margin-top: 8px; font-size: 9.5px; line-height: 1.6; color: var(--muted); min-height: 31px; }
.role-card-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid #f3f6fa; font-size: 9px; color: var(--muted-2); }
.permission-grid { width: 100%; border-collapse: collapse; }
.permission-grid th { font-size: 9px; color: #8e9bae; font-weight: 600; text-align: center; padding: 7px 4px; border-bottom: 1px solid #eef2f7; }
.permission-grid th:first-child { text-align: left; padding-left: 10px; width: 26%; }
.permission-grid td { padding: 9px 4px; font-size: 10px; border-bottom: 1px solid #f4f6fa; text-align: center; color: var(--muted); }
.permission-grid td:first-child { text-align: left; padding-left: 10px; color: var(--ink-2); font-weight: 500; }
.permission-grid tr:last-child td { border-bottom: 0; }
.perm-yes { color: #0f9468; }
.perm-no { color: #c2cad6; }
.audit-action { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; color: var(--ink-2); }
.audit-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.audit-log-time { font-family: var(--font-number); font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ============ Feedback ============ */
.feedback-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 16px; }
.feedback-stat { padding: 15px 18px; }
.feedback-stat span { font-size: 10px; color: var(--muted); }
.feedback-stat strong { display: block; margin-top: 6px; font-family: var(--font-number); font-size: 24px; font-weight: 650; }
.feedback-stat strong small { font-family: var(--font); font-size: 10px; color: var(--muted); margin-left: 2px; }
.feedback-list { display: flex; flex-direction: column; gap: 12px; }
.feedback-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 19px; box-shadow: var(--shadow-xs); }
.feedback-card-head { display: flex; align-items: flex-start; gap: 10px; }
.feedback-card-head .avatar { width: 34px; height: 34px; font-size: 12px; }
.feedback-person { flex: 1; min-width: 0; }
.feedback-person strong { display: block; font-size: 12px; font-weight: 650; }
.feedback-person span { display: block; margin-top: 3px; font-size: 9.5px; color: var(--muted-2); }
.feedback-card-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.feedback-body { margin-top: 12px; padding: 11px 13px; background: #f8fafd; border-radius: 9px; font-size: 11.5px; line-height: 1.7; color: #48576c; }
.feedback-body-label { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; font-size: 9px; color: var(--muted-2); font-weight: 600; }
.feedback-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.feedback-time { font-size: 9px; color: var(--muted-2); }
.feedback-reply-box { margin-top: 10px; border-left: 2px solid #bce8d7; padding: 8px 11px; background: #f7fcf9; border-radius: 0 7px 7px 0; font-size: 10px; line-height: 1.65; color: #4f6d60; }
.feedback-reply-box strong { color: #168259; }

/* ============ Employee portal ============ */
.employee-page { max-width: 1240px; }
.employee-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px;
  border-radius: 20px; padding: 26px 28px; color: #fff; margin-bottom: 17px;
  background: radial-gradient(500px 300px at 92% -10%, rgba(109, 190, 255, 0.55), transparent 65%), linear-gradient(125deg, #082b5f 0%, #0d4d9f 48%, #1677ff 100%);
  box-shadow: 0 16px 38px rgba(16, 91, 204, 0.2);
}
.employee-hero::after { content: ""; position: absolute; right: -100px; top: -140px; width: 440px; height: 440px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 50%; box-shadow: 0 0 0 65px rgba(255, 255, 255, 0.03), 0 0 0 130px rgba(255, 255, 255, 0.02); }
.employee-hero-main { position: relative; z-index: 1; }
.employee-hero .eyebrow { font-size: 10.5px; color: rgba(255, 255, 255, 0.55); letter-spacing: 1px; }
.employee-hero h1 { margin-top: 10px; font-size: 24px; font-weight: 650; letter-spacing: -0.4px; }
.employee-hero p { margin-top: 7px; font-size: 11.5px; line-height: 1.7; color: rgba(255, 255, 255, 0.6); }
.employee-hero-meta { display: flex; gap: 23px; margin-top: 20px; }
.employee-hero-meta span { font-size: 9.5px; color: rgba(255, 255, 255, 0.45); }
.employee-hero-meta strong { display: block; margin-top: 4px; font-family: var(--font-number); font-size: 15px; color: rgba(255, 255, 255, 0.9); }
.payslip-preview-card {
  position: relative; z-index: 1; align-self: center; border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(18px);
  padding: 16px 18px;
}
.payslip-preview-card .preview-period { font-size: 9.5px; color: rgba(255, 255, 255, 0.55); display: flex; justify-content: space-between; align-items: center; }
.payslip-preview-card .preview-net { margin-top: 10px; font-family: var(--font-number); font-size: 29px; font-weight: 650; letter-spacing: -0.7px; }
.payslip-preview-card .preview-net small { font-size: 13px; opacity: 0.7; margin-right: 3px; }
.payslip-preview-card .preview-lines { display: flex; gap: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.13); }
.payslip-preview-card .preview-lines span { display: block; font-size: 8.5px; color: rgba(255, 255, 255, 0.42); }
.payslip-preview-card .preview-lines strong { display: block; margin-top: 3px; font-family: var(--font-number); font-size: 10px; font-weight: 500; color: rgba(255, 255, 255, 0.82); }
.payslip-preview-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.employee-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 17px; }
.employee-stat { padding: 15px 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.employee-stat span { font-size: 9.5px; color: var(--muted); }
.employee-stat strong { display: block; margin-top: 6px; font-family: var(--font-number); font-size: 21px; font-weight: 650; letter-spacing: -0.3px; }
.employee-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr); gap: 17px; align-items: start; }
.my-slip-list { display: flex; flex-direction: column; }
.my-slip-row { display: flex; align-items: center; gap: 14px; padding: 15px 19px; border-bottom: 1px solid #f2f5f9; cursor: pointer; transition: background 0.15s; }
.my-slip-row:hover { background: #f9fbff; }
.my-slip-row:last-child { border-bottom: 0; }
.my-slip-month { width: 48px; flex: 0 0 auto; }
.my-slip-month strong { display: block; font-family: var(--font-number); font-size: 18px; font-weight: 650; line-height: 1; letter-spacing: -0.4px; }
.my-slip-month span { display: block; margin-top: 4px; font-size: 8.5px; color: var(--muted-2); }
.my-slip-main { flex: 1; min-width: 0; }
.my-slip-main strong { display: block; font-size: 11.5px; font-weight: 600; }
.my-slip-main span { display: block; margin-top: 3px; font-size: 9px; color: var(--muted-2); }
.my-slip-amount { text-align: right; }
.my-slip-amount strong { display: block; font-family: var(--font-number); font-size: 14px; font-weight: 650; letter-spacing: -0.2px; }
.my-slip-amount span { display: block; margin-top: 3px; font-size: 8.5px; color: var(--muted-2); }
.my-slip-arrow { color: #b2bdcb; margin-left: 3px; }
.my-side-card { padding: 18px 19px; }
.my-side-card h3 { font-size: 13px; font-weight: 700; }
.my-side-card p { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.year-bars { margin-top: 17px; display: flex; flex-direction: column; gap: 13px; }
.year-bar-row span { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-bottom: 5px; }
.year-bar-row b { font-family: var(--font-number); color: var(--ink-2); font-weight: 600; }
.year-bar-track { height: 6px; border-radius: 6px; background: #f0f4f9; overflow: hidden; }
.year-bar-fill { height: 100%; border-radius: 6px; }
.faq-list { margin-top: 5px; }
.faq-item { padding: 11px 0; border-bottom: 1px solid #f2f5f9; }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { color: #a5b1c1; transition: transform 0.2s; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item p { margin-top: 7px; font-size: 9.5px; line-height: 1.7; color: var(--muted); }
.profile-hero { display: flex; align-items: center; gap: 15px; padding: 20px 22px; }
.profile-hero h2 { font-size: 19px; font-weight: 700; }
.profile-hero p { margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.profile-hero-meta { display: flex; gap: 9px; margin-top: 9px; flex-wrap: wrap; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 17px; align-items: start; }
.profile-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.profile-card-head { padding: 16px 19px 12px; border-bottom: 1px solid #f2f5f9; display: flex; justify-content: space-between; align-items: center; }
.profile-card-head h3 { font-size: 13px; font-weight: 700; }
.profile-fields { padding: 4px 19px 12px; }
.profile-field { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #f5f7fb; font-size: 10.5px; }
.profile-field:last-child { border-bottom: 0; }
.profile-field span { color: var(--muted); }
.profile-field strong { font-weight: 600; color: var(--ink-2); text-align: right; }
.salary-structure { padding: 15px 19px 18px; }
.salary-structure-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f5f7fb; font-size: 10.5px; }
.salary-structure-row:last-child { border-bottom: 0; }
.salary-structure-row span { color: var(--muted); }
.salary-structure-row strong { font-family: var(--font-number); font-size: 11px; }
.salary-structure-note { display: flex; gap: 7px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 9px; line-height: 1.6; }

/* ============ Utilities ============ */
.muted { color: var(--muted); }
.small { font-size: 10px; }
.mono { font-family: var(--font-number); font-variant-numeric: tabular-nums; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-brand { color: var(--brand); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.callout { display: flex; gap: 9px; padding: 11px 13px; border-radius: 9px; background: #f6f9fe; border: 1px solid #e5eefb; color: #5a6b83; font-size: 10.5px; line-height: 1.65; }
.callout .icon { color: var(--brand); margin-top: 1px; }
.callout.orange { background: #fffaf3; border-color: #fbe8cf; color: #8e642d; }
.callout.orange .icon { color: var(--orange); }
.callout.green { background: #f5fcf8; border-color: #d9f1e6; color: #39705a; }
.callout.green .icon { color: var(--green); }
.inline-code { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #f2f5f9; font-family: var(--font-number); font-size: 10px; color: #5f7088; }
.mini-note { font-size: 9.5px; color: var(--muted-2); line-height: 1.65; }
.progress-mini { display: inline-flex; align-items: center; gap: 6px; }
.progress-mini .progress-track { width: 54px; flex: 0 0 auto; }
.progress-mini span { font-family: var(--font-number); font-size: 9px; color: var(--muted); }
.tooltip { position: relative; }

/* ============ Responsive ============ */
@media (max-width: 1360px) {
  .page { padding: 24px 24px 44px; }
  .topbar { padding: 0 24px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr) 318px; }
  .hero-metrics { gap: 22px; }
  .stat-value { font-size: 25px; }
}
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-right { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .dash-right .todo-card { grid-row: span 1; }
  .analytics-grid, .analytics-bottom { grid-template-columns: 1fr; }
  .employee-layout { grid-template-columns: 1fr; }
  .employee-hero { grid-template-columns: 1fr 300px; }
  .topbar-search { width: 200px; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 20px 0 60px rgba(10, 23, 43, 0.15); }
  .sidebar.is-open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(15, 27, 46, 0.38); backdrop-filter: blur(2px); display: block; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }
  .topbar-search { width: 220px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 3px; }
  .settings-nav button { width: auto; white-space: nowrap; margin-bottom: 0; }
}
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-cell:nth-child(2) { border-right: 0; }
  .summary-cell:nth-child(-n+2) { border-bottom: 1px solid #f0f3f8; }
  .batch-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-right { grid-template-columns: 1fr; }
  .process-panel { flex-direction: column; align-items: stretch; gap: 14px; }
  .process-meta { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 12px; text-align: left; display: flex; justify-content: space-between; align-items: center; }
  .process-meta strong { margin-top: 0; }
  .process-steps { flex-wrap: wrap; gap: 15px 0; }
  .process-step { flex: 0 0 50%; }
  .process-step::after { display: none; }
  .employee-hero { grid-template-columns: 1fr; }
  .employee-stats { grid-template-columns: repeat(2, 1fr); }
  .employee-hero .payslip-preview-card { max-width: 360px; }
  .profile-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .topbar { padding: 0 18px; }
  .page { padding: 20px 18px 40px; }
  .page-head { flex-direction: column; gap: 13px; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .feedback-stats { grid-template-columns: repeat(3, 1fr); }
  .feedback-stats .feedback-stat { padding: 12px; }
}
@media (max-width: 640px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 24px; }
  .login-mobile-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 42px; color: var(--ink); }
  .login-mobile-logo strong { font-size: 18px; }
  .login-card h2 { font-size: 25px; }
  .demo-accounts { grid-template-columns: 1fr; }
  .demo-account { text-align: left; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; }
  .demo-account span { margin-top: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 21px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-cell { padding: 11px 14px; }
  .page-head h1 { font-size: 22px; }
  .page-actions .btn { flex: 1; }
  .page-actions .month-select-wrap { width: 100%; }
  .page-actions .month-select-wrap .select { width: 100%; }
  .hero-card { padding: 20px 19px 17px; }
  .hero-main { flex-direction: column; align-items: stretch; gap: 16px; }
  .hero-metrics { justify-content: space-between; gap: 10px; }
  .hero-metric strong { font-size: 18px; }
  .hero-progress { justify-content: flex-start; }
  .hero-steps { display: none; }
  .hero-actions { margin-left: 0; }
  .todo-meta { display: none; }
  .dashboard-greeting h1 { font-size: 22px; }
  .composition-body { flex-direction: column; align-items: flex-start; }
  .composition-legend { width: 100%; }
  .table-toolbar { align-items: flex-start; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-search { flex: 1; width: auto; }
  .toolbar-search .input { width: 100%; }
  .topbar-right .env-chip, .topbar-divider, .profile-button .profile-name { display: none; }
  .profile-button { margin-left: 0; }
  .profile-menu { right: 12px; }
  .topbar { height: 58px; gap: 8px; }
  .breadcrumb { font-size: 11px; }
  .page { padding: 16px 13px 34px; }
  .stat-grid { gap: 9px; }
  .stat-card { border-radius: 12px; }
  .stat-label { font-size: 10.5px; }
  .stat-value { font-size: 19px; }
  .dash-right { gap: 13px; }
  .panel-head { padding: 15px 15px 0; }
  .panel-body { padding: 13px 15px 16px; }
  .recent-table th:nth-child(3), .recent-table td:nth-child(3) { display: none; }
  .batch-kpi-grid { gap: 9px; }
  .batch-kpi { padding: 12px 13px; }
  .batch-kpi strong { font-size: 18px; }
  .process-step { flex-basis: 100%; }
  .employee-hero { padding: 21px 18px; }
  .employee-hero-meta { gap: 15px; }
  .employee-stats { gap: 9px; }
  .employee-stat strong { font-size: 17px; }
  .my-slip-row { padding: 13px 14px; gap: 10px; }
  .my-slip-amount strong { font-size: 12.5px; }
  .feedback-stats { grid-template-columns: 1fr; }
  .feedback-card { padding: 14px; }
  .feedback-card-meta { justify-content: flex-start; width: 100%; }
  .feedback-card-head { flex-wrap: wrap; }
  .modal-layer { padding: 10px; align-items: flex-end; }
  .modal-card { max-height: calc(100vh - 20px); border-radius: 18px; }
  .modal-sm, .modal-md, .modal-lg, .modal-xl { max-width: none; }
  .modal-header { padding: 18px 18px 15px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 13px 18px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; }
  .drawer-lg, .drawer-md, .drawer-sm { max-width: 100%; }
  .drawer-head { padding: 16px 16px; }
  .drawer-body { padding: 14px 13px 22px; }
  .drawer-footer { padding: 11px 14px; flex-wrap: wrap; }
  .drawer-footer .btn { flex: 1; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; gap: 13px; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .slip-net { font-size: 31px; }
  .toast { min-width: 230px; max-width: calc(100vw - 32px); }
  #toast-root { top: 68px; right: 16px; left: 16px; align-items: flex-end; }
  .settings-section-head { flex-direction: column; }
  .settings-section-head .btn { align-self: flex-start; }
  .table-footer { padding: 11px 14px; }
  .feedback-card-foot { flex-direction: column; align-items: flex-start; }
  .permission-grid { min-width: 500px; }
  .settings-section-body { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============ Print ============ */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .drawer-layer, .drawer-layer * { visibility: visible; }
  .drawer-layer { position: absolute; inset: 0; display: block; padding: 0; background: #fff; }
  .drawer-backdrop, .drawer-head, .drawer-footer { display: none !important; }
  .drawer { position: absolute; inset: 0; max-width: none; width: 100%; transform: none !important; box-shadow: none; background: #fff; }
  .drawer-body { overflow: visible; padding: 0; }
  .slip-hero { background: #fff !important; color: #111 !important; border: 1px solid #d9e0e9; box-shadow: none; }
  .slip-hero::after { display: none; }
  .slip-period, .slip-label, .slip-person-text span, .slip-person-end, .slip-status { color: #555 !important; }
  .slip-net { color: #111 !important; }
  .slip-person { border-top-color: #ddd; }
  .slip-summary, .slip-section, .slip-bank { break-inside: avoid; }
}

/* ============ Supplemental components ============ */
.boot-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); font-size: 12px; background: #f4f7fb;
}
.boot-screen .logo-mark { width: 42px; height: 42px; border-radius: 12px; }

.input-group .input-icon, .topbar-search .input-icon, .toolbar-search .input-icon,
.settings-section-head .input-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9aa7b9;
  pointer-events: none; display: flex; line-height: 1;
}
.topbar-search .input-icon, .toolbar-search .input-icon { z-index: 1; }
.topbar-search .search-shortcut { z-index: 1; }
.input:disabled, .select:disabled, .textarea:disabled { background: #f7f9fc; color: #8f9caf; cursor: not-allowed; }
.form-error:not([hidden]) {
  margin-top: 13px; padding: 9px 11px; border: 1px solid #ffd7d7; border-radius: 8px;
  background: #fff7f7; color: #cf4141; font-size: 11.5px; line-height: 1.55;
}
.nav-dot-soft { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: #ff9c4a; }
.action-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: #fff0e2; color: #c77515; font-size: 9px; font-weight: 700;
}
.chip-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  margin-left: 2px; padding: 0 4px; border-radius: 8px; background: #f0f3f8; color: #8a98ab; font-size: 9px; font-weight: 600;
}
.dept-chip.active .chip-count { background: #d9eaff; color: var(--brand); }
.filter-panel-end { margin-left: auto; }
.filter-panel .toolbar-search { width: 240px; }

.chart-footnote {
  display: flex; align-items: center; gap: 5px; margin-top: 9px; padding-top: 9px;
  border-top: 1px solid #f4f6fa; font-size: 9px; color: #9ba8ba;
}
.chart-footnote .icon { color: #aab5c4; }
.dept-mini-list { display: flex; flex-direction: column; gap: 10px; }
.dept-mini-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dept-mini-name { font-size: 9.5px; color: var(--muted); width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-mini-row .progress-track { flex: 1; height: 5px; }
.dept-mini-value { width: 42px; text-align: right; font-family: var(--font-number); font-size: 9px; color: var(--ink-2); font-weight: 600; }

.quick-card { padding: 17px 19px 16px; }
.quick-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.quick-card-head h2 { font-size: 14px; font-weight: 700; }
.quick-card-head span { font-size: 9px; color: var(--muted-2); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 64px; padding: 8px 3px; border: 1px solid #edf1f7; border-radius: 10px;
  background: #fbfcfe; color: #6f7f94; font-size: 9px; transition: 0.18s;
}
.quick-action:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand); transform: translateY(-1px); }
.quick-action .icon { color: #7b8ba1; }
.quick-action:hover .icon { color: var(--brand); }

.modal-todo-list { display: flex; flex-direction: column; gap: 3px; }
.modal-todo-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 10px; border-radius: 10px; transition: background 0.15s; }
.modal-todo-item:hover { background: #f7faff; }
.modal-todo-item .icon:last-child { color: #b1bdcc; align-self: center; margin-left: 2px; }
.modal-todo-item .todo-main strong { font-size: 12px; }
.modal-todo-item .todo-main span { font-size: 10px; }

.search-result-icon {
  width: 28px; height: 28px; border-radius: 8px; background: #f0f6ff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice-item { display: flex; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.notice-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.notice-item strong { display: block; font-size: 12px; font-weight: 650; }
.notice-item p { margin-top: 4px; font-size: 10.5px; line-height: 1.65; color: var(--muted); }

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-item { display: flex; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.help-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.help-item strong { display: block; font-size: 11.5px; font-weight: 650; }
.help-item p { margin-top: 4px; font-size: 9.5px; line-height: 1.65; color: var(--muted); }
.legal-copy { display: flex; flex-direction: column; gap: 12px; font-size: 12px; line-height: 1.8; color: #58687d; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; border-top: 1px solid #f1f4f8; }
.info-grid-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f4f6fa; font-size: 10.5px; }
.info-grid-item span { color: var(--muted); }
.info-grid-item strong { color: var(--ink-2); font-weight: 600; text-align: right; }

.check-list { display: flex; flex-direction: column; gap: 9px; }
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border-radius: 10px; border: 1px solid #f3e3c9; background: #fffbf4; }
.check-item.error { border-color: #f7d4d4; background: #fff8f8; }
.check-icon { width: 30px; height: 30px; border-radius: 8px; background: #fff1dc; color: #d38318; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.check-item.error .check-icon { background: #ffeded; color: #d24646; }
.check-item strong { display: block; font-size: 10.5px; font-weight: 650; color: var(--ink-2); }
.check-item p { margin-top: 3px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.check-item .link-btn { margin-left: auto; white-space: nowrap; }
.check-success { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 10px 22px; color: var(--green); }
.check-success h3 { margin-top: 10px; font-size: 14px; color: var(--ink); }
.check-success p { margin-top: 6px; font-size: 10.5px; color: var(--muted); }

.quick-checks { display: flex; flex-direction: column; gap: 7px; margin-top: 17px; }
.quick-check { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #eef2f8; border-radius: 9px; background: #fbfcfe; }
.quick-check-icon { width: 27px; height: 27px; border-radius: 7px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.quick-check div { flex: 1; min-width: 0; }
.quick-check strong { display: block; font-size: 10.5px; font-weight: 600; }
.quick-check div span { display: block; margin-top: 2px; font-size: 9px; color: var(--muted-2); }
.check-ready { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; color: #0e8d64; font-weight: 600; }

.import-layout { display: grid; grid-template-columns: minmax(0, 1fr) 235px; gap: 20px; }
.import-main { min-width: 0; }
.import-side { border-left: 1px solid #f0f3f8; padding-left: 19px; }
.import-side-title { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; }
.import-side-title .icon { color: var(--brand); }
.import-side > p { margin: 7px 0 10px; font-size: 9.5px; line-height: 1.6; color: var(--muted); }
.import-steps { display: flex; flex-direction: column; gap: 13px; margin-top: 20px; }
.import-step { display: flex; gap: 9px; }
.import-step > span { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-family: var(--font-number); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.import-step strong { display: block; font-size: 9.5px; font-weight: 600; }
.import-step p { margin-top: 2px; font-size: 8.5px; line-height: 1.5; color: var(--muted-2); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 156px; margin-top: 15px; padding: 18px; border: 1.5px dashed #cbd9eb; border-radius: 12px;
  background: #fbfdff; text-align: center; transition: 0.18s; cursor: pointer;
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--brand); background: #f2f8ff; }
.dropzone-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 3px; }
.dropzone strong { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.dropzone span { font-size: 9.5px; color: var(--muted-2); }
.import-preview { margin-top: 13px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: #f8fbff; border-bottom: 1px solid #eaf1fa; }
.preview-head strong { display: block; font-size: 10.5px; font-weight: 650; color: var(--ink-2); }
.preview-head span { display: block; margin-top: 2px; font-size: 8.5px; color: var(--muted); }
.preview-table-wrap { max-height: 180px; overflow: auto; }
.preview-table { width: 100%; border-collapse: collapse; }
.preview-table th { padding: 7px 10px; background: #fcfdff; text-align: left; font-size: 8.5px; color: #8d9aab; font-weight: 600; border-bottom: 1px solid #f1f4f8; }
.preview-table td { padding: 7px 10px; font-size: 9.5px; color: var(--ink-2); border-bottom: 1px solid #f5f7fb; }
.preview-table tr:last-child td { border-bottom: 0; }
.preview-more { padding: 6px 10px; font-size: 8.5px; color: var(--muted-2); text-align: center; background: #fcfdff; }

.toggle-list { display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #f3f6fa; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.toggle-row span { display: block; margin-top: 3px; font-size: 9.5px; color: var(--muted); }
.feedback-quote { display: flex; gap: 9px; padding: 12px 13px; background: #f8fafd; border-radius: 9px; font-size: 11.5px; line-height: 1.7; color: #4d5d72; }
.feedback-quote .icon { color: #95a3b6; margin-top: 2px; }

@media (max-width: 1024px) {
  .import-layout { grid-template-columns: 1fr; }
  .import-side { border-left: 0; border-top: 1px solid #f0f3f8; padding-left: 0; padding-top: 16px; }
  .import-steps { display: grid; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .help-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .filter-panel-end { width: 100%; margin-left: 0; }
  .filter-panel .toolbar-search { width: 100%; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .import-steps { grid-template-columns: 1fr; }
}

/* Hero step layout refinement */
.hero-steps { flex: 1 1 auto; min-width: 0; }
.hero-step { flex: 1 1 0; min-width: 0; }
.hero-step > span:last-child { flex: 0 1 auto; min-width: 0; }
.hero-step:not(:last-child)::after { min-width: 9px; }
.hero-progress { flex: 0 0 auto; margin-left: 14px; }
.hero-top .hero-progress { margin-left: 8px; }

/* State and alignment fixes */
[hidden] { display: none !important; }
.toolbar-select { width: 132px; flex: 0 0 auto; }
.row-actions .link-btn + .link-btn { margin-left: 8px; }
.profile-card .profile-menu-item > .icon:last-child { margin-left: auto; color: #b0bccb; }
.comp-name { line-height: 1.35; }

/* Composition layout: give legends room on narrow cards */
.dash-right .composition-body,
.composition-stack { flex-direction: column; align-items: center; gap: 15px; }
.dash-right .composition-legend,
.composition-stack .composition-legend { width: 100%; }
.dash-right .comp-row:last-child,
.composition-stack .comp-row:last-child { border-bottom: 0; }
