/* ============ App shell: header + sidebar + content ============ */
body.app:not(.ready) { opacity: 0; }
body.app { background: linear-gradient(180deg, #eaf2f9 0, #f4f8fb 360px, #f6f9fc 100%) fixed; }

.hdr {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 50;
  display: flex; align-items: center; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.hdr-logo { width: var(--sidebar-w); height: 100%; display: flex; align-items: center; padding: 0 18px; border-right: 1px solid var(--border); flex: none; }
.hdr-logo img { height: 36px; width: auto; }
.hdr-logo .panel-tag {
  margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 99px; background: var(--navy-800); color: #fff;
}
body[data-panel="ca"] .panel-tag { background: var(--green-600); }
.hdr-tabs { display: flex; align-items: center; gap: 6px; padding: 0 14px; flex: 1; min-width: 0; overflow: hidden; }
.tab-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 9px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); border: 1px solid transparent; white-space: nowrap; flex: none;
}
.tab-chip .slash { color: var(--text-3); }
.tab-chip:hover { background: var(--surface-2); color: var(--text); }
.tab-chip.active { background: #fff; border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.tab-chip .x { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; color: var(--text-3); }
.tab-chip .x:hover { background: var(--navy-100); color: var(--text); }
.hdr-right { display: flex; align-items: center; gap: 6px; padding: 0 16px 0 8px; flex: none; }
.h-search {
  display: flex; align-items: center; gap: 8px; height: 34px; width: 250px; padding: 0 11px; margin-right: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text-3);
}
.h-search:hover { border-color: var(--border-strong); background: #fff; }
.h-search span.ph { flex: 1; text-align: left; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { font-size: 10.5px; font-weight: 500; color: var(--text-2); background: #fff; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 16px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red-600); border: 2px solid #fff; }
.menu-toggle { display: none; }

.side {
  position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; padding: 12px 10px 10px; background: rgba(250, 252, 254, 0.96);
  border-right: 1px solid var(--border);
}
.side-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
.nav-label { font-size: 10.5px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); padding: 11px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: 10px; margin-bottom: 1px;
  color: var(--text-2); font-weight: 500; font-size: 13.5px; position: relative;
}
.nav-item .icon { color: var(--text-3); }
.nav-item:hover { background: #eef3f8; color: var(--text); }
.nav-item.active { background: var(--grad-active); color: var(--navy-900); font-weight: 600; }
.nav-item.active .icon { color: var(--navy-800); }
.nav-item .pill { margin-left: auto; font-size: 10.5px; font-weight: 650; padding: 1px 7px; border-radius: 99px; background: var(--navy-100); color: var(--navy-700); }
.nav-item .pill.red { background: var(--red-100); color: #b3302b; }
.nav-item .pill.new { background: var(--green-100); color: var(--green-700); }
.side-foot { padding-top: 10px; border-top: 1px solid var(--border); margin-top: 8px; }
.side-card { border-radius: 12px; padding: 11px 12px; background: linear-gradient(135deg, #eaf6f0, #e6eff9); border: 1px solid #d6e8e0; margin-bottom: 10px; }
.side-card .t { font-size: 12px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.side-card .s { font-size: 11px; color: var(--text-2); margin: 3px 0 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; width: 100%; border: 0; background: none; text-align: left; }
.user-chip:hover { background: #eef3f8; }

.main { margin-left: var(--sidebar-w); padding-top: var(--header-h); min-height: 100vh; }
.content { padding: 18px 22px 30px; max-width: none; margin: 0; }

.page-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-bar p { color: var(--text-2); margin-top: 2px; font-size: 13px; }
.page-bar .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); font-weight: 500; }
.crumbs a:hover { color: var(--green-700); }

/* ============ Cards ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.card.tint { background: linear-gradient(180deg, #f1f8fd 0, #fff 96px); }
.card.tint-green { background: linear-gradient(180deg, #effaf4 0, #fff 96px); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.card-h h2 { font-size: 14.5px; }
.card-h p { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.card-b { padding: 10px 16px 16px; }
.card-b.flush { padding: 0; }
.card-f { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.go { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); border: 1px solid transparent; flex: none; }
.go:hover { background: #fff; border-color: var(--border); color: var(--navy-800); }

/* KPI cards (Panacea style: icon tile, title, big number, tinted footer band) */
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; }
.kpi-top { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px 4px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; border: 1px solid transparent; }
.kpi-ico.green { background: var(--green-50); color: var(--green-600); border-color: var(--green-200); }
.kpi-ico.blue { background: var(--blue-50); color: var(--blue-600); border-color: var(--blue-100); }
.kpi-ico.amber { background: var(--amber-50); color: var(--amber-600); border-color: var(--amber-100); }
.kpi-ico.red { background: var(--red-50); color: var(--red-600); border-color: var(--red-100); }
.kpi-ico.violet { background: var(--violet-50); color: var(--violet-600); border-color: var(--violet-100); }
.kpi-ico.navy { background: var(--navy-50); color: var(--navy-700); border-color: var(--navy-200); }
.kpi-title { font-weight: 600; font-size: 14px; line-height: 1.2; }
.kpi-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.kpi-num { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; padding: 2px 14px 10px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-num small { font-size: 13px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.kpi-foot { margin-top: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 14px; font-size: 11.5px; color: var(--text-2); background: linear-gradient(90deg, #eef6fc, #f7fbfe); border-top: 1px solid #e6eef6; }
.kpi-foot b { font-weight: 650; color: var(--text); }
.kpi.green .kpi-foot { background: linear-gradient(90deg, #ecf8f2, #f6fcf9); border-top-color: #e0f1e8; }
.kpi.amber .kpi-foot { background: linear-gradient(90deg, #fff6e2, #fffbf1); border-top-color: #fbeccb; }
.kpi.red .kpi-foot { background: linear-gradient(90deg, #fff0ee, #fff8f7); border-top-color: #fadcd9; }
.kpi.violet .kpi-foot { background: linear-gradient(90deg, #f1eefd, #f8f6ff); border-top-color: #e7e2fa; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 11.5px; }
.delta.up { color: var(--green-600); } .delta.down { color: var(--red-600); } .delta.flat { color: var(--text-3); }

/* ============ Buttons, inputs, badges ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; font-weight: 550; font-size: 13px;
  color: var(--text); white-space: nowrap; box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-2); border-color: #bccadb; color: var(--text); }
.btn-primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.btn-green { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn-green:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-soft { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); box-shadow: none; }
.btn-soft:hover { background: var(--green-100); color: var(--green-800); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-danger { background: #fff; border-color: #f3c3c0; color: #b3302b; }
.btn-danger:hover { background: var(--red-50); color: #9c2621; border-color: #ecaaa6; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .lbl { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff;
  font-size: 13.5px; box-shadow: var(--shadow-xs);
}
.textarea { height: auto; padding: 9px 11px; min-height: 84px; resize: vertical; }
.select { appearance: none; padding-right: 30px; 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='%237a8a9e' 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 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green-500); box-shadow: var(--ring); outline: none; }
.input-sm { height: 30px; font-size: 12.5px; border-radius: 8px; }
.hint { font-size: 11.5px; color: var(--text-3); }
.search-in { position: relative; }
.search-in .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-in .input { padding-left: 33px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--navy-50); color: var(--navy-700); white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.plain::before { display: none; }
.badge-green { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.badge-red { background: var(--red-50); color: #b3302b; border-color: var(--red-100); }
.badge-amber { background: var(--amber-50); color: #a8630a; border-color: var(--amber-100); }
.badge-blue { background: var(--blue-50); color: #2159ad; border-color: var(--blue-100); }
.badge-violet { background: var(--violet-50); color: #5440c4; border-color: var(--violet-100); }
.badge-gray { background: #f0f3f7; color: var(--text-2); border-color: var(--border); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; background: #fff; border: 1px solid var(--border-strong); font-size: 12px; font-weight: 550; color: var(--text-2); }
.chip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip:hover { border-color: #b4c3d6; }

.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #cdd7e3; border-radius: 99px; transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + i { background: var(--green-500); }
.switch input:checked + i::after { transform: translateX(16px); }
.check { width: 16px; height: 16px; accent-color: var(--green-600); }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; color: #fff; background: var(--navy-700); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sq { border-radius: 10px; }
.av-0 { background: linear-gradient(135deg, #2a5a87, #174269); } .av-1 { background: linear-gradient(135deg, #3da77f, #146c57); }
.av-2 { background: linear-gradient(135deg, #e8920c, #c97200); } .av-3 { background: linear-gradient(135deg, #6f5be8, #4d3cbd); }
.av-4 { background: linear-gradient(135deg, #0e9aa7, #0a7480); } .av-5 { background: linear-gradient(135deg, #e0453f, #b82f2a); }
.av-stack { display: flex; } .av-stack .avatar { border: 2px solid #fff; margin-left: -8px; } .av-stack .avatar:first-child { margin-left: 0; }

.progress { height: 6px; background: #e8eef5; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-500), var(--green-400)); }
.progress.amber > i { background: linear-gradient(90deg, #e8920c, #f5b94a); }
.progress.red > i { background: linear-gradient(90deg, #e0453f, #f27b76); }
.progress.blue > i { background: linear-gradient(90deg, #2f7de1, #6aa3ef); }

.seg { display: inline-flex; padding: 3px; background: #eaf0f6; border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 550; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--navy-900); border-bottom-color: var(--green-500); font-weight: 650; }
.tabs .count { font-size: 11px; background: var(--navy-50); color: var(--navy-700); padding: 0 6px; border-radius: 99px; font-weight: 650; }
.tab-pane { display: none; } .tab-pane.on { display: block; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; }
.table th { text-align: left; font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; background: #f7fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table td { padding: 11px 14px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f8fbfd; }
.table tr[data-href] { cursor: pointer; }
.table .cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-main .t { font-weight: 600; line-height: 1.25; } .table .cell-main .s { font-size: 11.5px; color: var(--text-3); }
.th-sort { cursor: pointer; user-select: none; } .th-sort:hover { color: var(--text); }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.toolbar .search-in { width: 260px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty .icon { margin: 0 auto 10px; color: var(--border-strong); }

/* ============ Lists, timeline, charts ============ */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef2f6; }
.list-row:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; font-weight: 550; }
.tl { position: relative; padding-left: 4px; }
.tl-item { display: grid; grid-template-columns: 62px 18px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; position: relative; }
.tl-item .time { font-size: 12px; color: var(--text-2); font-weight: 550; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); position: relative; justify-self: center; z-index: 1; }
.tl-item::before { content: ""; position: absolute; left: 70px; top: 0; bottom: 0; width: 1px; background: #dde6ef; }
.tl-item:first-child::before { top: 50%; } .tl-item:last-child::before { bottom: 50%; }
.tl-dot.blue { background: var(--blue-600); } .tl-dot.gray { background: #aab8c8; } .tl-dot.red { background: var(--red-600); } .tl-dot.amber { background: var(--amber-600); }
.status-btn { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; display: grid; place-items: center; color: var(--text-3); }
.status-btn.ok { color: var(--green-600); border-color: var(--green-200); background: var(--green-50); }
.status-btn.late { color: var(--red-600); border-color: var(--red-100); background: var(--red-50); }
.status-btn.wait { color: var(--blue-600); border-color: var(--blue-100); background: var(--blue-50); }
.stat-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.stat-row .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid; }
.stat-row .dot.red { border-color: #f3a09c; color: var(--red-600); background: var(--red-50); }
.stat-row .dot.amber { border-color: #f5cc86; color: var(--amber-600); background: var(--amber-50); }
.stat-row .dot.green { border-color: #9ad6b9; color: var(--green-600); background: var(--green-50); }
.stat-row .n { font-weight: 650; font-size: 14px; } .stat-row .d { font-size: 11.5px; }
.insight-box { border-radius: 12px; padding: 12px 14px; background: linear-gradient(135deg, #eaf7f0, #f1f8fd); border: 1px solid #d8ebe1; }
.insight-box h4 { font-size: 12.5px; margin: 0 0 6px; color: var(--green-800); display: flex; align-items: center; gap: 6px; }
.insight-box li { font-size: 12.5px; margin: 3px 0; color: var(--text); }
.insight-box ul { margin: 0; padding-left: 16px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--navy-900); color: #fff; font-size: 11.5px; padding: 5px 9px; border-radius: 8px; transform: translate(-50%, -120%); white-space: nowrap; z-index: 5; }
.bars2 { display: flex; gap: 18px; align-items: flex-end; height: 230px; padding: 0 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bar-col .lbl-top { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 4px; }
.bar-fill { border-radius: 10px 10px 0 0; border-top: 3px solid; }
.bar-fill.red { background: linear-gradient(180deg, rgba(224, 69, 63, 0.18), rgba(224, 69, 63, 0.03)); border-color: #e0453f; }
.bar-fill.violet { background: linear-gradient(180deg, rgba(111, 91, 232, 0.2), rgba(111, 91, 232, 0.03)); border-color: #6f5be8; }
.bar-fill.green { background: linear-gradient(180deg, rgba(31, 138, 108, 0.22), rgba(31, 138, 108, 0.03)); border-color: #1f8a6c; }
.bar-fill.blue { background: linear-gradient(180deg, rgba(47, 125, 225, 0.2), rgba(47, 125, 225, 0.03)); border-color: #2f7de1; }
.bar-foot { text-align: center; margin-top: -10px; position: relative; z-index: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ============ Overlays ============ */
.overlay { position: fixed; inset: 0; background: rgba(7, 28, 51, 0.42); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.15s; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop 0.18s; }
.modal.lg { max-width: 760px; } .modal.sm { max-width: 400px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; }
.modal-b { padding: 6px 18px 16px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.drawer-ov { justify-content: flex-end; padding: 0; }
.drawer { background: #fff; width: 100%; max-width: 480px; height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide 0.2s; }
.drawer.lg { max-width: 640px; }
.drawer .modal-b { flex: 1; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy-900); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 13px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-md); animation: pop 0.18s; min-width: 220px; }
.toast.ok .icon { color: #7ee0b4; } .toast.err .icon { color: #ff9b95; }
.dd { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; z-index: 60; display: none; }
.menu.left { left: 0; right: auto; } .menu.up { top: auto; bottom: calc(100% + 6px); }
.dd.open > .menu { display: block; }
.m-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text); width: 100%; border: 0; background: none; text-align: left; }
.m-item:hover { background: var(--surface-2); color: var(--text); }
.m-item.danger { color: #b3302b; } .m-label { font-size: 10.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px 4px; }
.m-sep { height: 1px; background: var(--border); margin: 5px 0; }
.cmdk { max-width: 580px; align-self: flex-start; margin-top: 12vh; }
.cmd-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmd-input input { flex: 1; border: 0; outline: 0; font-size: 15px; background: none; }
.cmd-list { padding: 6px; max-height: 340px; overflow-y: auto; }
.m-item.hl { background: var(--green-50); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ Misc blocks ============ */
.callout { display: flex; gap: 11px; padding: 11px 14px; border-radius: 12px; font-size: 13px; background: var(--blue-50); border: 1px solid var(--blue-100); color: #1c4a8c; }
.callout.green { background: var(--green-50); border-color: var(--green-100); color: var(--green-800); }
.callout.amber { background: var(--amber-50); border-color: var(--amber-100); color: #8a5207; }
.callout.red { background: var(--red-50); border-color: var(--red-100); color: #a02a25; }
.steps { display: flex; gap: 8px; }
.step { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; display: flex; gap: 10px; align-items: center; background: #fff; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-50); color: var(--navy-700); font-weight: 650; font-size: 12px; flex: none; }
.step.done .n { background: var(--green-500); color: #fff; } .step.cur { border-color: var(--green-400); box-shadow: var(--ring); } .step.cur .n { background: var(--navy-800); color: #fff; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-search { width: 40px; padding: 0; justify-content: center; } .h-search .ph, .h-search .kbd { display: none; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .hdr-logo { width: auto; border-right: 0; padding: 0 8px 0 4px; } .hdr-tabs { display: none; } .hdr-right { margin-left: auto; }
  .menu-toggle { display: grid; margin-left: 8px; }
  .side { transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(7, 28, 51, 0.35); z-index: 35; }
  .main { margin-left: 0; } .content { padding: 14px 14px 26px; }
  .steps { flex-direction: column; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2, .span-3 { grid-column: auto; }
  .kv { grid-template-columns: 110px 1fr; }
  .hdr-logo .panel-tag { display: none; }
}
@media print { .hdr, .side, .no-print, .toasts { display: none !important; } .main { margin: 0; padding: 0; } }

/* clickable names */
a.ent-link { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(13,47,82,.12); cursor: pointer; }
a.ent-link:hover { color: var(--green-600); border-bottom-color: var(--green-600); }
.lk { display: contents; }
.btn.is-done { background: var(--green-50, #e8f5f0); color: var(--green-600); border-color: #bfe3d4; cursor: default; opacity: 1; }
/* notice stepper */
.stepper { display: flex; align-items: flex-start; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 2px; }
.stepper::-webkit-scrollbar { display: none; }
.stepper .st { flex: 1 0 96px; text-align: center; position: relative; padding: 0 4px; }
.stepper .st::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: #dde6ef; z-index: 0; }
.stepper .st:first-child::before { display: none; }
.stepper .st.done::before, .stepper .st.cur::before { background: var(--green-500); }
.stepper .dot { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; background: #fff; border: 2px solid #cdd7e3; color: #8a9aae; font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.stepper .st.done .dot { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.stepper .st.cur .dot { border-color: var(--blue-600, #2f6fd6); color: var(--blue-600, #2f6fd6); box-shadow: 0 0 0 5px rgba(47,111,214,.14); }
.stepper .lb { font-size: 12px; line-height: 1.3; color: var(--text-2); font-weight: 550; }
.stepper .st.cur .lb { color: var(--navy-900); font-weight: 700; }
.stepper .st.done .lb { color: var(--text); }
