:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #eff6ff;
  --teal: #0d9488;
  --green: #16a34a; --green-soft: #dcfce7;
  --amber: #d97706; --amber-soft: #fef3c7;
  --red: #dc2626; --red-soft: #fee2e2;
  --violet: #7c3aed; --violet-soft: #ede9fe;
  --blue-soft: #dbeafe;
  --gray-soft: #f1f5f9;
  --side: #0b1733;
  --side-2: #13224a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font: "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: linear-gradient(180deg, var(--side), #0a1430);
  color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 15px; display: block; letter-spacing: .2px; }
.brand span { font-size: 11px; color: #94a3b8; }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav .group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #cbd5e1;
  font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a .badge-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.side-user { border-top: 1px solid #1e2b52; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { color: #fff; display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { font-size: 11px; color: #94a3b8; }
.side-user button { background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 6px; }
.side-user button:hover { color: #fff; background: var(--side-2); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 24px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; }
.topbar .crumbs { color: var(--muted); font-size: 13px; }
.topbar .crumbs b { color: var(--ink); }
.content { padding: 22px 24px 40px; max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------- avatar ---------- */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--brand); flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid #fff; margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- card ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- stat tiles ---------- */
.stat { padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.stat .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ico.blue { background: var(--blue-soft); color: var(--brand); }
.ico.green { background: var(--green-soft); color: var(--green); }
.ico.amber { background: var(--amber-soft); color: var(--amber); }
.ico.red { background: var(--red-soft); color: var(--red); }
.ico.violet { background: var(--violet-soft); color: var(--violet); }
.ico.teal { background: #ccfbf1; color: var(--teal); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font: 500 13px var(--font); cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--panel-2); border-color: #94a3b8; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: var(--red-soft); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 28px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--brand-soft); color: var(--brand); border-color: #93c5fd; z-index: 1; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.sm svg.i { width: 14px; height: 14px; }

/* ---------- forms ---------- */
input, select, textarea {
  font: 13.5px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 10px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; min-height: 64px; }
input:disabled, select:disabled, textarea:disabled { background: var(--gray-soft); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field label .req { color: var(--red); }
.field .help { font-size: 11.5px; color: var(--muted); }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; max-height: 150px; overflow: auto; }
.check-list label { display: flex; gap: 6px; align-items: center; font-weight: 500; font-size: 13px; cursor: pointer; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 150px; height: 34px; padding: 5px 10px; }
.toolbar input[type=search] { min-width: 240px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 9px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover { background: #f8fbff; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.row-overdue { background: #fff5f5; }
.tbl tr.row-overdue:hover { background: #ffecec; }
.tbl tr.row-urgent { background: #fffbeb; }
.tbl tfoot td { font-weight: 700; background: var(--panel-2); border-top: 2px solid var(--line-2); }
.tbl .sub { color: var(--muted); font-size: 12px; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.tbl.sheet td { white-space: nowrap; }
.tbl.sheet td.wrap { white-space: normal; min-width: 200px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty svg.i { width: 34px; height: 34px; stroke-width: 1.5; margin-bottom: 6px; color: #94a3b8; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.badge.blue { background: var(--blue-soft); color: #1d4ed8; }
.badge.amber { background: var(--amber-soft); color: #b45309; }
.badge.violet { background: var(--violet-soft); color: #6d28d9; }
.badge.green { background: var(--green-soft); color: #15803d; }
.badge.red { background: var(--red-soft); color: #b91c1c; }
.badge.gray { background: var(--gray-soft); color: #475569; }
.badge.teal { background: #ccfbf1; color: #0f766e; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--gray-soft); color: var(--ink-2); font-size: 11.5px; margin: 1px 2px 1px 0; }
.deadline { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.deadline svg.i { width: 13px; height: 13px; }
.deadline.overdue { background: var(--red); color: #fff; animation: pulse 1.6s infinite; }
.deadline.urgent { background: var(--red-soft); color: var(--red); }
.deadline.soon { background: var(--amber-soft); color: #b45309; }
.deadline.ok { background: var(--gray-soft); color: var(--ink-2); }
.deadline.done, .deadline.none { background: transparent; color: var(--muted); font-weight: 500; padding: 0; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); } }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #cbd5e1; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 12px 14px; font: 600 13px var(--font); color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--gray-soft); color: var(--ink-2); border-radius: 10px; padding: 0 7px; font-size: 11px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: #eaeef5; border-radius: 12px; display: flex; flex-direction: column; min-height: 300px; }
.kcol-head { padding: 12px 12px 8px; display: flex; align-items: center; gap: 8px; font-weight: 650; }
.kcol-head .count { margin-left: auto; background: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.kcol-body { padding: 4px 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 9px; transition: background .15s; border-radius: 0 0 12px 12px; }
.kcol-body.drag-over { background: #dbe6f7; }
.kcol .bar { height: 3px; border-radius: 3px; margin: 0 12px; }
.kcard { background: #fff; border-radius: 10px; padding: 11px 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); cursor: grab; border: 1px solid transparent; border-left: 3px solid transparent; }
.kcard:hover { border-color: #93c5fd; }
.kcard.overdue { border-left-color: var(--red); }
.kcard.urgent { border-left-color: #f87171; }
.kcard.soon { border-left-color: var(--amber); }
.kcard.dragging { opacity: .5; }
.kcard .no { font-weight: 700; font-size: 13.5px; }
.kcard .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kcard .foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; z-index: 100; overflow-y: auto; animation: fade .12s;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: pop .15s; }
.modal.lg { max-width: 920px; } .modal.xl { max-width: 1240px; } .modal.sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-head h3 { flex: 1; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  min-width: 260px; max-width: 420px; background: #0f172a; color: #fff; padding: 11px 14px; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25); display: flex; gap: 10px; align-items: flex-start; animation: pop .15s; font-size: 13.5px;
}
.toast.error { background: #7f1d1d; } .toast.success { background: #14532d; }

/* ---------- misc ---------- */
.info-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.info-list .k { font-size: 12px; color: var(--muted); }
.info-list .v { font-weight: 550; margin-top: 2px; word-break: break-word; }
.hint-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; background: #fef9c3; color: #854d0e; border-radius: 6px;
  padding: 1px 7px; cursor: pointer; margin-top: 3px; border: 0; font-family: var(--font);
}
.hint-chip svg.i { width: 12px; height: 12px; }
.inline-edit { background: none; border: 1px dashed transparent; border-radius: 6px; padding: 2px 6px; cursor: pointer; font: inherit; color: inherit; text-align: right; width: 100%; }
.inline-edit:hover { border-color: var(--line-2); background: #fff; }
.cell-best { background: #ecfdf5 !important; }
.cell-selected { outline: 2px solid var(--green); outline-offset: -2px; }
.matrix-cell { cursor: pointer; min-width: 130px; }
.matrix-cell:hover { background: var(--brand-soft) !important; }
.summary-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.summary-box > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.summary-box .k { font-size: 12px; color: var(--muted); }
.summary-box .v { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.summary-box .v.big { color: var(--brand); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.timeline .when { color: var(--muted); font-size: 12px; }
.changes { font-size: 12px; margin-top: 4px; color: var(--ink-2); }
.changes code { background: var(--gray-soft); padding: 0 4px; border-radius: 4px; }
.changes .old { color: var(--red); text-decoration: line-through; }
.changes .new { color: var(--green); font-weight: 600; }
.ai-box { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-left: 3px solid var(--violet); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-top: 8px; max-height: 360px; overflow: auto; }
.steps { display: flex; gap: 0; align-items: center; flex-wrap: wrap; }
.steps .st { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.steps .st .n { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 11px; background: #fff; }
.steps .st.done { color: var(--green); } .steps .st.done .n { background: var(--green); border-color: var(--green); color: #fff; }
.steps .st.cur { color: var(--brand); } .steps .st.cur .n { border-color: var(--brand); color: var(--brand); }
.steps .ln { width: 36px; height: 2px; background: var(--line-2); margin: 0 8px; }
.progress { height: 6px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.alert.warn { background: var(--amber-soft); color: #92400e; }
.alert.info { background: var(--brand-soft); color: #1e40af; }
.alert.danger { background: var(--red-soft); color: #991b1b; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- chart ---------- */
.chart { width: 100%; }
.chart .bar-rect { fill: var(--brand); }
.chart .bar-rect:hover { fill: var(--brand-2); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart-tip { position: fixed; pointer-events: none; background: #0f172a; color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; z-index: 300; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.hbar { display: grid; grid-template-columns: 150px 1fr 60px; gap: 10px; align-items: center; font-size: 12.5px; margin: 7px 0; }
.hbar .track { height: 10px; background: var(--gray-soft); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 5px; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: radial-gradient(1200px 600px at 10% 10%, #1d4ed8 0%, #0b1733 55%); color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h1 { font-size: 34px; line-height: 1.2; margin-top: 40px; }
.login-art p { color: #bfdbfe; max-width: 460px; font-size: 15px; }
.login-art ul { list-style: none; padding: 0; margin: 26px 0 0; color: #dbeafe; }
.login-art li { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.login-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -250px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4 { grid-column: span 2; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .content { padding: 16px; }
  .summary-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .grid.cols-6, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .info-list { grid-template-columns: 1fr; }
  .toolbar input[type=search] { min-width: 0; width: 100%; }
}

/* ---- bảng song ngữ + chọn cột ---- */
.tbl .h-vi { display: block; }
.tbl .h-en { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.tbl .col-hidden { display: none; }
.tbl-tools { position: relative; display: flex; justify-content: flex-end; padding: 6px 12px 0; }
.tbl-tools .btn .h-en { color: var(--muted); font-size: 11.5px; }
.tbl-tools .count { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 0 6px; }
.col-pop { position: absolute; right: 12px; top: 38px; z-index: 40; width: 300px; max-height: 420px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.col-pop-head { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.col-pop-list { overflow: auto; padding: 6px 4px; }
.col-pop-list label { display: flex; gap: 8px; align-items: center; padding: 5px 10px; cursor: pointer; font-size: 13px; border-radius: 6px; }
.col-pop-list label:hover { background: var(--panel-2); }
.col-pop-list small { display: block; color: var(--muted); font-size: 11px; }
.col-pop-foot { display: flex; gap: 6px; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--line); }
.raw-grid td:first-child { white-space: nowrap; font-weight: 600; }
.raw-grid td { padding: 5px 8px; }
