/* ===== AI Content Agent — giao diện theo nhận diện SDN: navy + vàng gold + xanh dương, nền sáng ===== */
:root {
  --navy: #0B1F5C; --navy2: #102A7A; --blue: #1D4ED8; --blue2: #3B82F6; --gold: #FFC20E; --gold2: #F59E0B;
  --bg: #F4F7FC;
  --bg2: #EAF0FA;
  --panel: #FFFFFF;
  --panel-solid: #FFFFFF;
  --panel2: #F6F8FD;
  --soft: #F1F5FD;
  --line: #E3E9F4;
  --line2: #D3DCEC;
  --ink: #0F1B3D;
  --ink2: #34416A;
  --muted: #6B7699;
  --accent: #1D4ED8;
  --accent2: #F59E0B;
  --accent3: #16A34A;
  --grad: linear-gradient(135deg, #1D4ED8 0%, #0B1F5C 100%);
  --grad-gold: linear-gradient(135deg, #FFC20E 0%, #F59E0B 100%);
  --ok: #16A34A; --ok-bg: #E8F7EE;
  --warn: #B45309; --warn-bg: #FFF5DB;
  --err: #DC2626; --err-bg: #FDECEC;
  --info-bg: #EAF1FF;
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 8px 24px rgba(15, 27, 61, .06);
  --shadow-lg: 0 12px 40px rgba(11, 31, 92, .12);
  --radius: 16px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.55;
  background-image: radial-gradient(1100px 520px at 90% -12%, rgba(29, 78, 216, .09), transparent 60%),
                    radial-gradient(800px 420px at 10% 110%, rgba(255, 194, 14, .08), transparent 60%);
  background-attachment: fixed; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--navy); font-weight: 800; }
h2 { font-size: 17px; margin: 0; letter-spacing: -.01em; color: var(--navy); }
h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: var(--navy); font-weight: 700; }
h4 { font-size: 12px; margin: 18px 0 8px; color: var(--blue); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
p { margin: 6px 0; }
code { background: var(--soft); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: var(--navy); word-break: break-all; }
ul { padding-left: 18px; margin: 6px 0; }
li { margin: 3px 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .accent { color: var(--blue); }
.text-ok { color: var(--ok); } .text-err { color: var(--err); } .text-warn { color: var(--warn); }
.pre { white-space: pre-wrap; word-break: break-word; }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt { margin-top: 14px; } .mb { margin-bottom: 10px; } .center { text-align: center; } .ml-auto { margin-left: auto; }
.w80 { width: 80px !important; } .w140 { width: 140px !important; } .w300 { width: 300px !important; } .w-auto { width: auto !important; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

/* ===== Orb — đại diện của agent ===== */
.orb { display: inline-block; border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #FFE07A 10%, #3B82F6 36%, #1D4ED8 58%, #0B1F5C 100%);
  box-shadow: 0 4px 16px rgba(29, 78, 216, .35), inset 0 0 10px rgba(255, 255, 255, .35); }
.orb::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(29, 78, 216, .25); }
.orb.xs { width: 22px; height: 22px; } .orb.sm { width: 30px; height: 30px; } .orb.md { width: 44px; height: 44px; }
.orb.lg { width: 64px; height: 64px; } .orb.xl { width: 84px; height: 84px; }
.orb.busy { animation: breathe 1.6s ease-in-out infinite; background: radial-gradient(circle at 32% 28%, #fff 0%, #FFE07A 14%, #FFC20E 34%, #1D4ED8 70%, #0B1F5C 100%); }
.orb.busy::after { animation: ripple 1.6s ease-out infinite; border-color: rgba(245, 158, 11, .6); }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 28px rgba(255, 194, 14, .55); } }
@keyframes ripple { from { inset: -2px; opacity: 1; } to { inset: -16px; opacity: 0; } }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.idle { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.busy { background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: blink 1s infinite; }
.dot.err { background: var(--err); box-shadow: 0 0 8px var(--err); } .dot.off { background: #B6BFD6; }
@keyframes blink { 50% { opacity: .35; } }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: blink 1s infinite; }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 256px; flex: none; background: linear-gradient(180deg, #0B1F5C 0%, #0A1A4D 60%, #081540 100%); padding: 18px 12px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; color: #E8EEFF;
  box-shadow: 4px 0 24px rgba(11, 31, 92, .12); }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 14px; color: #fff; }
.brand b { display: block; font-size: 14.5px; color: #fff; } .brand small { color: #9FB0E0; font-size: 11.5px; }
.agent-mini { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; color: #fff;
  padding: 10px 12px; margin: 0 4px 12px; }
.am-name { font-weight: 600; color: #fff; } .am-state { font-size: 11.5px; color: #A9B8E6; line-height: 1.3; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7F93CF; padding: 14px 10px 4px; font-weight: 700; }
.sidebar nav a { color: #C9D4F5; padding: 8px 10px; border-radius: 10px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.sidebar nav a i { font-style: normal; width: 16px; text-align: center; color: #7F93CF; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(255, 194, 14, .2), rgba(255, 194, 14, .03)); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold); }
.sidebar nav a.active i { color: var(--gold); }
.pill { margin-left: auto; background: var(--gold); color: var(--navy); border-radius: 999px; font-size: 10.5px; padding: 0 7px; font-weight: 600; }
.pill.warn { background: #F97316; color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 6px 0; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.sidebar-foot a { color: #A9B8E6; } .sidebar-foot a:hover { color: #fff; }
.mode { padding: 7px 10px; border-radius: 8px; border: 1px solid; }
.mode-test { background: rgba(255, 194, 14, .14); color: #FFD45C; border-color: rgba(255, 194, 14, .35); }
.mode-live { background: rgba(34, 197, 94, .15); color: #86EFAC; border-color: rgba(34, 197, 94, .35); }
.mode-demo { background: rgba(255, 255, 255, .08); color: #C9D4F5; border-color: rgba(255, 255, 255, .2); }
.main { flex: 1; padding: 26px 32px 70px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-3-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 0; min-width: 0; }
@media (max-width: 1100px) { .grid-3-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .layout { flex-direction: column; } .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 18px 14px; } .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ===== Card ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card.working { display: flex; gap: 12px; align-items: center; background: var(--info-bg); border-color: #C7D7FB; color: var(--navy); }
.card.proposal { border-color: #FFD45C; box-shadow: 0 0 0 3px rgba(255, 194, 14, .18), var(--shadow); }
.card.insight { border-color: #C7D7FB; background: linear-gradient(160deg, #EEF4FF, var(--panel) 55%); }
.link-card { display: block; color: var(--ink); font-weight: 500; } .link-card:hover { border-color: var(--accent); }

/* ===== Buttons & forms ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: #fff;
  color: var(--navy); padding: 8px 15px; border-radius: 11px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; transition: .15s; }
.btn:hover { background: var(--soft); color: var(--navy); border-color: #B9C7E6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(29, 78, 216, .3); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.12); border-color: transparent; color: #fff; background: var(--grad); }
.btn-accent { background: var(--grad-gold); border-color: transparent; color: var(--navy); font-weight: 700; box-shadow: 0 6px 18px rgba(245, 158, 11, .3); }
.btn-accent:hover { filter: brightness(1.05); background: var(--grad-gold); color: var(--navy); border-color: transparent; }
.btn-danger { color: var(--err); border-color: #F5C2C2; background: #fff; }
.btn-danger:hover { background: var(--err-bg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-group form { margin: 0; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; }
.link-btn:hover { color: var(--err); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; } .actions form { margin: 0; }
input, textarea, select { font: inherit; padding: 10px 13px; border: 1px solid var(--line2); border-radius: 11px; background: #fff; width: 100%;
  color: var(--ink); transition: .15s; }
input::placeholder, textarea::placeholder { color: #9AA5C3; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29, 78, 216, .12); }
input:disabled, textarea:disabled, select:disabled { opacity: .65; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; margin: 12px 0 6px; color: var(--ink2); font-size: 13px; }
.form > label:first-of-type { margin-top: 4px; }
.form label.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; }
.form .btn-block, .form > .btn { margin-top: 14px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(rgba(255,255,255,0), #fff 40%); padding-top: 18px; }
.row-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.row-form input, .row-form select { width: auto; }
.field { margin-bottom: 8px; } .field label { margin-top: 14px; }
form.card.form > .btn-block:only-child { margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border: none; } .kv span { color: var(--muted); }

/* ===== Chips (gợi ý bấm chọn) ===== */
.chips, .choice { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; align-items: center; }
.chips.scroll { max-height: 92px; overflow-y: auto; }
.chips-label { font-size: 11.5px; color: var(--muted); margin-right: 2px; }
.chip { border: 1px solid var(--line2); background: #fff; color: var(--ink2); padding: 4px 11px; border-radius: 999px; font: inherit;
  font-size: 12.5px; cursor: pointer; transition: .12s; display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0 !important; }
.chip:hover { border-color: var(--blue); color: var(--blue); background: #EEF4FF; }
.chip.on, .chip:has(input:checked) { border-color: var(--blue); background: var(--blue); color: #fff; }
.choice .chip input { display: none; }
.chip.added { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.08); } }

/* ===== Badges & tags ===== */
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--soft); color: var(--ink2); letter-spacing: .01em; white-space: nowrap; }
.b-draft, .b-rewriting { background: var(--warn-bg); color: #A16207; }
.b-scheduled { background: var(--info-bg); color: var(--blue); }
.b-published { background: var(--ok-bg); color: #15803D; }
.b-failed { background: var(--err-bg); color: var(--err); }
.b-rejected { background: #EEF1F7; color: #6B7699; }
.t-queued, .t-running { background: #FFF5DB; color: #A16207; }
.t-done { background: var(--ok-bg); color: #15803D; } .t-error { background: var(--err-bg); color: var(--err); }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 6px; background: #EEF4FF; color: var(--blue); border: 1px solid #D6E2FB; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tip { display: inline-flex; width: 15px; height: 15px; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 10px;
  align-items: center; justify-content: center; cursor: help; }

/* ===== Flash ===== */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: var(--ok-bg); color: #166534; border-color: #BBE5C9; }
.flash-error { background: var(--err-bg); color: #991B1B; border-color: #F5C2C2; }
.flash-warn { background: var(--warn-bg); color: #92400E; border-color: #FBE3A3; }

/* ===== Hero ===== */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: center; padding: 24px;
  border-radius: 20px; border: 1px solid var(--line); margin-bottom: 18px;
  background: linear-gradient(120deg, #0B1F5C 0%, #13308F 55%, #1D4ED8 100%); color: #fff; border: none; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 194, 14, .35), transparent 65%); pointer-events: none; }
.hero h1, .hero h2, .hero h3 { color: #fff; } .hero .muted { color: #B9C7EE; } .hero a { color: var(--gold); }
.hero-left { display: flex; gap: 20px; align-items: center; }
.hero h1 { font-size: 30px; margin: 2px 0 6px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 700; }
.hero-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #DCE5FF; }
.hero-cmd { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.hero-cmd input { padding: 13px 16px; border-radius: 12px; background: #fff; font-size: 14.5px; border-color: transparent; }
.hero .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #E8EEFF; }
.hero .chip:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.hero .btn-primary { background: var(--grad-gold); color: var(--navy); }
.hero-cmd .quick { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; } }

.onboarding .steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line2); color: var(--ink); }
.step b { width: 26px; height: 26px; border-radius: 50%; background: #EEF4FF; color: var(--blue); display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; border: 1px solid var(--line2); }
.step small { color: var(--muted); }
.step:hover { border-color: var(--accent); }
.step.done { border-style: solid; border-color: rgba(34, 197, 94, .35); opacity: .7; }
.step.done b { background: var(--ok); color: #fff; border-color: var(--ok); font-size: 0; }
.step.done b::after { content: "✓"; font-size: 13px; }
@media (max-width: 820px) { .onboarding .steps4 { grid-template-columns: 1fr 1fr; } }

/* ===== KPI ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue), var(--gold)); }
.kpi-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.kpi-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; color: var(--navy); }
.kpi-spark { opacity: .95; }
.kpi-delta { font-size: 11.5px; }
.small-kpis .kpi-value { font-size: 20px; }
.delta { font-weight: 600; padding: 1px 6px; border-radius: 6px; font-size: 11.5px; }
.delta.up { color: #15803D; background: var(--ok-bg); } .delta.down { color: var(--err); background: var(--err-bg); }
.delta.flat { color: var(--muted); }

/* ===== Charts ===== */
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.chart .dot { opacity: 0; transition: .1s; } .chart:hover .dot { opacity: 1; }
.ring-text { fill: var(--ink); font-weight: 700; font-size: 15px; font-family: inherit; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.l1::before { background: #1D4ED8; } .l2::before { background: #F5A300; } .l3::before { background: #16A34A; }
.bar { height: 8px; background: #E8EEF8; border-radius: 99px; overflow: hidden; }
.bar div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue2)); border-radius: 99px; transition: width .6s; }
.bar.thin { height: 5px; margin: 6px 0; }
.progress-row { margin-bottom: 12px; }
.pr-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.cell-bar { position: relative; min-width: 90px; height: 20px; background: #EEF2F9; border-radius: 5px; overflow: hidden; }
.cell-bar div { position: absolute; inset: 0 auto 0 0; background: rgba(29, 78, 216, .22); }
.cell-bar span { position: relative; padding-left: 6px; font-size: 12px; line-height: 20px; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fn-step { position: relative; background: #F1F5FD; border-radius: 10px; overflow: hidden; }
.fn-bar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(29, 78, 216, .28), rgba(255, 194, 14, .3)); }
.fn-text { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; }
.fn-text span { flex: 1; } .fn-text b { font-size: 15px; }

/* ===== Insight / recs ===== */
.insight-summary { font-size: 15px; color: var(--ink); line-height: 1.65; }
.recs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rec { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; }
.rec.big { padding: 13px 14px; }
.prio { font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; flex: none; margin-top: 2px; }
.p-cao { background: var(--err-bg); color: var(--err); } .p-trung-bình { background: var(--warn-bg); color: #A16207; }
.p-thấp { background: #EEF1F7; color: #6B7699; }
.callout { background: var(--info-bg); border: 1px solid #C7D7FB; border-radius: 10px; padding: 11px 14px; }

/* ===== Feed ===== */
.feed { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; font-size: 12.5px; }
.feed.tall { max-height: 620px; }
.feed-item { display: flex; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.feed-item.new { animation: slidein .5s; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); background: #FFF5DB; } }
.ft { color: #9AA5C3; font-variant-numeric: tabular-nums; flex: none; width: 54px; }
.fstep { color: var(--blue); font-weight: 600; margin-right: 4px; }
.s-error .fstep, .s-provider_error .fstep { color: var(--err); } .s-done .fstep { color: var(--ok); }
.s-save_draft .fstep, .s-save_report .fstep, .s-save_strategy .fstep { color: #B45309; }

/* ===== Agent stats ===== */
.agent-stats { display: flex; gap: 18px; align-items: center; justify-content: space-around; flex-wrap: wrap; margin-bottom: 10px; }
.agent-stats > div:not(.as-list) { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.agent-stats small { color: var(--muted); font-size: 11.5px; text-align: center; }
.as-list { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink2); }
.routine { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.routine:last-child { border: none; } .routine.off { opacity: .5; }
.mini-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line);
  color: var(--ink2); font-size: 13px; margin: 0; }
.mini-row:last-child { border: none; }

/* ===== Post card ===== */
.post-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 12px; padding: 13px; color: var(--ink); margin-bottom: 10px; transition: .15s; }
.post-card:hover { border-color: #B9C9F2; transform: translateY(-2px); color: var(--ink); box-shadow: var(--shadow-lg); }
.pc-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .pc-time { margin-left: auto; }
.pc-title { font-weight: 700; color: var(--navy); } .pc-body { color: var(--muted); white-space: pre-wrap; font-size: 13px; }
.pc-metrics { display: flex; gap: 12px; font-size: 12px; color: var(--ink2); }
.empty-state { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.es-icon { font-size: 30px; } .es-title { font-weight: 600; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.table.compact th, .table.compact td { padding: 6px 8px; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: #F3F7FF; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; display: flex; gap: 6px; align-items: center; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }

/* ===== Strategy ===== */
.big-text { font-size: 15px; font-weight: 600; }
.kpi-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kt { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.kt small { color: var(--muted); } .kt b { font-size: 20px; color: var(--navy); }
.pillars { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pillar { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pl-top { display: flex; justify-content: space-between; } .pl-pct { color: var(--blue); font-weight: 800; }
.stat-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat-box small { color: var(--muted); }
.exp { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.checklist { list-style: none; padding: 0; } .checklist li::before { content: "☐ "; color: var(--blue); }

/* ===== Reports ===== */
.reports-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .reports-layout { grid-template-columns: 1fr; } }
.report-list { padding: 8px; position: sticky; top: 20px; max-height: 80vh; overflow-y: auto; }
.rl-item { display: flex; flex-direction: column; padding: 10px; border-radius: 9px; color: var(--ink); }
.rl-item:hover { background: var(--soft); color: var(--navy); } .rl-item.active { background: #EAF1FF; box-shadow: inset 3px 0 0 var(--gold); }
.report-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.report-head h2 { font-size: 22px; margin-top: 4px; }
.score { display: flex; flex-direction: column; align-items: center; gap: 4px; } .score small { color: var(--muted); font-size: 11px; }
.report-summary { font-size: 15.5px; line-height: 1.7; margin: 14px 0 18px; }
.hl { border-radius: 12px; padding: 12px 16px; border: 1px solid var(--line); margin-bottom: 12px; }
.hl h4 { margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.hl.good { background: #F0FAF3; border-color: #BBE5C9; }
.hl.bad { background: #FFF4F4; border-color: #F5C2C2; }
.insight-box { background: #EEF4FF; border-color: #C7D7FB; }

/* ===== Performance ===== */
.lead { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lead.done { opacity: .5; } .lead form { margin: 0; }
.metrics6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; text-align: center; margin-bottom: 10px; }
.metrics6 b { display: block; font-size: 20px; } .metrics6 span { font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .metrics6 { grid-template-columns: repeat(3, 1fr); } }

/* ===== Post detail ===== */
.fb-preview { background: #f0f2f5; color: #1c1e21; border-color: #dfe3ea; }
.fb-preview .muted { color: #65676b; } .fb-preview .accent { color: #1b74e4; }
.fbp-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); flex: none; }
.preview-img { width: 100%; border-radius: 8px; margin-top: 10px; }
.link-preview { margin-top: 10px; padding: 10px; background: #e4e6eb; border-radius: 8px; font-size: 12.5px; word-break: break-all; }
.revision summary { cursor: pointer; padding: 6px 0; font-size: 13px; color: var(--ink2); }
.revision .pre { background: var(--panel2); padding: 10px; border-radius: 8px; font-size: 13px; }

/* ===== Calendar ===== */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.cal-head { background: var(--panel2); padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; }
.cal-day { background: var(--panel-solid); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day.other { background: #F8FAFE; } .cal-day.other .cal-date { color: #B6BFD6; }
.cal-day.today .cal-date { background: var(--gold); color: var(--navy); border-radius: 999px; width: 24px; text-align: center; }
.cal-date { font-size: 12px; font-weight: 600; }
.cal-item { font-size: 11px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.c-draft, .c-rewriting { background: var(--warn-bg); color: #A16207; } .c-scheduled { background: var(--info-bg); color: var(--blue); }
.c-published { background: var(--ok-bg); color: #15803D; } .c-failed { background: var(--err-bg); color: var(--err); }

/* ===== Brand / AI / Channels ===== */
.ai-fill { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: center;
  background: linear-gradient(120deg, #EAF1FF, #fff 60%); border-color: #C7D7FB; }
.af-left { display: flex; gap: 14px; align-items: center; } .af-left h3 { margin: 0; }
.af-form { display: flex; gap: 8px; align-items: stretch; }
@media (max-width: 900px) { .ai-fill { grid-template-columns: 1fr; } }
.sug-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; gap: 3px; padding: 13px; border: 1px solid var(--line2); border-radius: 12px; color: var(--ink);
  background: #fff; transition: .15s; }
.preset:hover { border-color: var(--blue); background: #F3F7FF; color: var(--navy); }
.preset.rec { border-color: #FFD45C; box-shadow: 0 0 0 3px rgba(255, 194, 14, .15); }
.guide-box { background: var(--info-bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.guide { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; margin: 10px 0; }
.guide summary { cursor: pointer; font-weight: 600; color: var(--blue); font-size: 13px; }
.guide ol { margin: 8px 0 4px; padding-left: 20px; } .guide li { margin: 5px 0; }
.prov-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .prov-title h3 { margin: 0; }
.channels .soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.channel.soon { display: flex; align-items: center; gap: 10px; opacity: .6; margin: 0; }
.ch-icon { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
  background: var(--navy); color: #fff; flex: none; }
.ch-icon.fb { background: #1877f2; } .ch-icon.ig { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.ch-icon.tt { background: #111; border: 1px solid #333; } .ch-icon.zl { background: #0068ff; } .ch-icon.yt { background: #ff0033; }
.ch-icon.li { background: #0a66c2; }
.connected-row { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mode-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; background: var(--panel2);
  border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fb-steps { display: flex; flex-direction: column; gap: 16px; }
.step-row { display: flex; gap: 12px; }
.step-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; }
.step-body { flex: 1; min-width: 0; }
.pages-pick { margin-top: 16px; padding: 16px; border: 1px solid var(--accent); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.pages-pick h4 { margin: 0 0 4px; }
.page-option { border-radius: 10px !important; padding: 9px 12px !important; }
.page-option input { display: inline-block !important; }
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; } .profile-head h3 { margin: 0; }
.autonomy { display: flex; flex-direction: column; gap: 8px; }
.auto-opt { flex-direction: row !important; align-items: flex-start !important; gap: 10px !important; padding: 12px; border: 1px solid var(--line2);
  border-radius: 10px; cursor: pointer; margin: 0 !important; }
.auto-opt:has(input:checked) { border-color: var(--blue); background: #EEF4FF; }
.auto-opt div { display: flex; flex-direction: column; gap: 2px; } .auto-opt small { color: var(--muted); font-weight: 400; }
.routine-edit { padding: 10px 0; border-bottom: 1px solid var(--line); }
.routine-edit .row-form { margin: 6px 0 0 26px; color: var(--muted); }
.link-list { display: flex; flex-direction: column; gap: 8px; }

/* ===== Auth ===== */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; width: 380px;
  display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg); }
.auth-card .orb { align-self: center; margin-bottom: 6px; } .auth-card h2 { font-size: 22px; }

.scroll-box { max-height: 420px; overflow-y: auto; }
.chart-note { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ===== Tự điều chỉnh ===== */
.tune-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  border: 1px dashed var(--line2); margin-bottom: 14px; flex-wrap: wrap; }
.tune-banner.on { border-style: solid; border-color: #C7D7FB; background: #EEF4FF; }
.tune-banner form { margin: 0; }
.tune-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 700px) { .tune-grid { grid-template-columns: 1fr; } }
.big-check { font-size: 14.5px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; }
.adj { padding: 11px 0; border-bottom: 1px solid var(--line); }
.adj:last-child { border: none; }
.adj.reverted { opacity: .5; } .adj.reverted .adj-sum { text-decoration: line-through; }
.adj-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.adj-sum { font-weight: 500; margin: 3px 0; }
.adj form { margin: 0; }

/* ===== Chờ phản hồi / dừng / tạm dừng ===== */
.t-cancelled { background: #EEF1F7; color: #6B7699; }



.wait-timer { font-variant-numeric: tabular-nums; font-size: 12px; color: #92400E; background: #FFF1C7;
  padding: 1px 8px; border-radius: 999px; }
.inline-form { display: inline; margin: 0 0 0 6px; }
.strat-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--panel2); border-radius: 10px; margin-bottom: 14px; }
.strat-controls form { margin: 0; }
.paused-card { border-color: #FBE3A3; background: linear-gradient(160deg, #FFF8E6, var(--panel) 55%); }

/* ===== v3: nghiên cứu, trả lời khách, ảnh AI, sự kiện ===== */
.onboarding .steps4 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .onboarding .steps4 { grid-template-columns: 1fr 1fr; } }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.comp { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: flex; flex-direction: column; gap: 5px; }
.comp-name { font-weight: 800; font-size: 15px; color: var(--navy); }
.comp ul { margin: 2px 0; padding-left: 16px; }
.ideas { display: flex; flex-direction: column; gap: 6px; }
.idea { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel2); margin: 0; }
.comp-edit summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
.comp-edit form { margin-top: 8px; }
.tall-box { max-height: 640px; }
.lead-card { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.lead-card.done { opacity: .6; }
.lc-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lc-msg { font-size: 14px; }
.lc-reply { font-size: 13px; color: var(--navy); padding-left: 10px; border-left: 3px solid var(--gold); }
.lc-form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.lc-done { margin: 0; }
.import-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid #C7D7FB;
  background: #EEF4FF; border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.big-idea { padding: 16px 18px; border-radius: 14px; background: linear-gradient(120deg, #0B1F5C, #1D4ED8); color: #fff;
  border: none; margin-bottom: 12px; box-shadow: var(--shadow-lg); }
.big-idea .muted, .big-idea .label { color: #B9C7EE; }
.bi-text { font-size: 19px; font-weight: 800; line-height: 1.35; color: var(--gold); }
.funnel-mix { display: flex; gap: 4px; border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.fm { padding: 10px 12px; display: flex; flex-direction: column; min-width: 70px; }
.fm b { font-size: 17px; } .fm span { font-size: 11.5px; opacity: .85; }
.fm.a { background: #0B1F5C; color: #fff; } .fm.c { background: #1D4ED8; color: #fff; } .fm.v { background: var(--gold); color: var(--navy); }
.cal-event { font-size: 10.5px; color: #92400E; background: #FFF1C7; border-radius: 5px; padding: 1px 5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.badge.ev { background: #FFF1C7; color: #92400E; }

/* ===== Giọng nói ===== */






.voice-hint { margin-top: 8px; padding: 7px 12px; border-radius: 10px; background: #EEF4FF; border: 1px solid #C7D7FB; color: var(--navy); }

.speak-btn:hover, .speak-btn.on { color: var(--blue); }

.voice-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--panel2); }
.voice-box h4 { margin: 0 0 6px; }
.speed-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; font-size: 13px; font-weight: 500; }
.speed-row input[type=range] { flex: 0 1 260px; padding: 0; }
.pc-img { width: 100%; height: 170px; object-fit: cover; border-radius: 12px; margin: 8px 0 4px; display: block; background: var(--soft); }
.diag { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.diag .table { margin: 10px 0; width: 100%; }
.diag .table th { text-align: left; }
.visual-row { display: flex; gap: 14px; align-items: flex-start; margin: 6px 0 12px; }
.visual-row.wrap { flex-wrap: wrap; }
.thumb { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); }
.mini-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-left: 4px; }
.prompt-preview { white-space: pre-wrap; font-size: 12px; background: #fff; padding: 10px; border-radius: 8px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }

/* ===== Trò chuyện (giao diện mới) ===== */
.main:has(.chat2) { padding-top: 18px; padding-bottom: 18px; }
.chat2 { display: flex; flex-direction: column; height: calc(100vh - 36px); min-height: 520px; background: #fff; border: 1px solid var(--line);
  border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.chat2-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; flex-wrap: wrap;
  background: linear-gradient(110deg, #0B1F5C 0%, #13308F 60%, #1D4ED8 100%); color: #fff; position: relative; overflow: hidden; }
.chat2-head::after { content: ""; position: absolute; right: -60px; top: -90px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 194, 14, .35), transparent 65%); pointer-events: none; }
.ch-who { display: flex; gap: 12px; align-items: center; position: relative; z-index: 1; }
.ch-name { font-weight: 800; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.ch-role { font-weight: 600; font-size: 11px; color: var(--navy); background: var(--gold); padding: 1px 8px; border-radius: 999px; }
.ch-status { font-size: 12px; color: #C9D6FF; display: flex; gap: 6px; align-items: center; }
.ch-tools { display: flex; gap: 8px; align-items: center; position: relative; z-index: 1; flex-wrap: wrap; }
.ch-tools form { margin: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.tgl { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #E3EAFF; cursor: pointer; user-select: none;
  padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); }
.tgl input { display: none; }
.tgl-ui { width: 28px; height: 16px; border-radius: 999px; background: rgba(255, 255, 255, .3); position: relative; transition: .2s; flex: none; }
.tgl-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: .2s; }
.tgl input:checked + .tgl-ui { background: var(--gold); }
.tgl input:checked + .tgl-ui::after { left: 14px; background: var(--navy); }

.chat-body { flex: 1; overflow-y: auto; padding: 22px 26px 10px; display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(circle at 1px 1px, #E6ECF7 1px, transparent 0) 0 0 / 22px 22px, #F7F9FE; scroll-behavior: smooth; }
.day-sep { display: flex; justify-content: center; margin: 6px 0; }
.day-sep span { font-size: 11.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; animation: msgin .25s ease-out; }
@keyframes msgin { from { opacity: 0; transform: translateY(6px); } }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg.user .msg-col { align-items: flex-end; }
.bubble { padding: 11px 15px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 27, 61, .05); line-height: 1.6; overflow-wrap: anywhere; }
.msg.agent .bubble { border-bottom-left-radius: 6px; }
.msg.user .bubble { background: linear-gradient(135deg, #1D4ED8, #0B1F5C); color: #fff; border: none; border-bottom-right-radius: 6px;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .25); }
.msg.user .bubble a { color: var(--gold); }
.bubble p:first-child { margin-top: 0; } .bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 20px; }
.bubble strong, .bubble b { color: var(--navy); } .msg.user .bubble strong, .msg.user .bubble b { color: #fff; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { font-size: 14.5px; margin: 8px 0 4px; color: var(--navy); text-transform: none; letter-spacing: 0; }
.bubble table { border-collapse: collapse; margin: 8px 0; font-size: 13px; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.bubble th { background: #EEF4FF; color: var(--navy); }
.bubble code { background: #EEF4FF; }
.msg-meta { font-size: 11px; color: #9AA5C3; display: flex; gap: 10px; align-items: center; padding: 0 6px; opacity: .85; }
.msg:hover .msg-meta { opacity: 1; }
.speak-btn, .copy-btn { background: none; border: 0; color: #8C97B8; cursor: pointer; font: inherit; font-size: 11px; padding: 0; }
.speak-btn:hover, .copy-btn:hover, .speak-btn.on { color: var(--blue); }
.speak-btn.on::after { content: " đang đọc…"; }
.copy-btn.done { color: var(--ok); }
.msg .orb.sm { margin-bottom: 20px; }

.bubble.waiting { display: flex; flex-direction: column; gap: 6px; min-width: 300px; background: #fff; border: 1px dashed #C7D7FB; }
.bubble.waiting form { margin: 0; }
.wait-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wait-step { color: var(--blue); font-weight: 500; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; background: #EEF4FF; border-radius: 999px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; background: var(--blue2); } .typing span:nth-child(3) { animation-delay: .3s; background: var(--gold2); }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

.chat-welcome { margin: auto; text-align: center; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 0; }
.chat-welcome h2 { font-size: 22px; font-weight: 800; }
.welcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 10px; }
.wcard { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); transition: .15s; }
.wcard span { font-size: 20px; } .wcard b { color: var(--navy); } .wcard small { color: var(--muted); }
.wcard:hover { border-color: #B9C9F2; transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.chat-input { border-top: 1px solid var(--line); padding: 10px 18px 10px; background: #fff; }
.chat-input .chips.quick { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; scrollbar-width: none; }
.chat-input .chips.quick::-webkit-scrollbar { display: none; }
.chat-input .chips.quick .chip { white-space: nowrap; background: #F3F7FF; border-color: #DCE6FA; color: var(--navy); }
.chat-input .chips.quick .chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.chat-send { display: flex; gap: 8px; align-items: flex-end; background: #F4F7FC; border: 1px solid var(--line2); border-radius: 22px; padding: 6px;
  transition: .15s; }
.chat-send:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29, 78, 216, .1); background: #fff; }
.chat-send textarea { border: none; background: transparent; box-shadow: none !important; resize: none; padding: 9px 6px; max-height: 180px;
  min-height: 40px; line-height: 1.5; }
.chat-send textarea:focus { box-shadow: none; }
.mic-btn, .send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none; transition: .15s; }
.mic-btn { background: #fff; color: var(--blue); border: 1px solid var(--line2); }
.mic-btn:hover { background: #EEF4FF; }
.mic-btn.rec { background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; border-color: transparent; animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }
.send-btn { background: var(--grad-gold); color: var(--navy); box-shadow: 0 6px 16px rgba(245, 158, 11, .35); }
.send-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.send-btn:disabled { opacity: 1; cursor: default; background: #E3E9F4; color: var(--muted); box-shadow: none; transform: none; }
.send-btn .i-wait { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #B6BFD6; border-top-color: var(--blue); animation: spin .8s linear infinite; }
.send-btn.is-waiting .i-send { display: none; } .send-btn.is-waiting .i-wait { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.chat-foot { font-size: 11px; text-align: center; margin-top: 6px; }
@media (max-width: 820px) { .chat2 { height: calc(100vh - 120px); border-radius: 16px; } .msg { max-width: 92%; } .welcome-grid { grid-template-columns: 1fr; }
  .chat-body { padding: 14px; } }

/* ===== Chiến lược gọn: tóm tắt + tab + accordion ===== */
.s-summary { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.s-idea { padding: 14px 18px; border-radius: 14px; background: linear-gradient(120deg, #0B1F5C, #1D4ED8); color: #fff; box-shadow: var(--shadow-lg); }
.s-idea .label { color: #B9C7EE; }
.s-idea .bi-text { font-size: 18px; }
.s-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.s-facts > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-facts small { color: var(--muted); font-size: 11.5px; }
.s-facts b { color: var(--navy); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 900px) { .s-facts { grid-template-columns: 1fr 1fr; } }
.stabs > input { display: none; }
.stab-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.stab-nav label { padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 3px solid transparent;
  margin-bottom: -1px; border-radius: 8px 8px 0 0; user-select: none; transition: .12s; }
.stab-nav label:hover { color: var(--navy); background: var(--soft); }
.stab-panel { display: none; animation: msgin .2s ease-out; }
.stabs > input:nth-of-type(1):checked ~ .stab-panels > .stab-panel:nth-of-type(1) { display: block; }
.stabs > input:nth-of-type(1):checked ~ .stab-nav label:nth-of-type(1) { color: var(--navy); border-bottom-color: var(--gold); background: #FFFBEA; }
.stabs > input:nth-of-type(2):checked ~ .stab-panels > .stab-panel:nth-of-type(2) { display: block; }
.stabs > input:nth-of-type(2):checked ~ .stab-nav label:nth-of-type(2) { color: var(--navy); border-bottom-color: var(--gold); background: #FFFBEA; }
.stabs > input:nth-of-type(3):checked ~ .stab-panels > .stab-panel:nth-of-type(3) { display: block; }
.stabs > input:nth-of-type(3):checked ~ .stab-nav label:nth-of-type(3) { color: var(--navy); border-bottom-color: var(--gold); background: #FFFBEA; }
.stabs > input:nth-of-type(4):checked ~ .stab-panels > .stab-panel:nth-of-type(4) { display: block; }
.stabs > input:nth-of-type(4):checked ~ .stab-nav label:nth-of-type(4) { color: var(--navy); border-bottom-color: var(--gold); background: #FFFBEA; }
.stabs > input:nth-of-type(5):checked ~ .stab-panels > .stab-panel:nth-of-type(5) { display: block; }
.stabs > input:nth-of-type(5):checked ~ .stab-nav label:nth-of-type(5) { color: var(--navy); border-bottom-color: var(--gold); background: #FFFBEA; }
.stabs > input:nth-of-type(6):checked ~ .stab-panels > .stab-panel:nth-of-type(6) { display: block; }
.stabs > input:nth-of-type(6):checked ~ .stab-nav label:nth-of-type(6) { color: var(--navy); border-bottom-color: var(--gold); background: #FFFBEA; }

.s-block { padding: 10px 0; border-bottom: 1px dashed var(--line); } .s-block:last-child { border: none; }
.s-block p { margin: 4px 0 0; }
.pl-list { display: flex; flex-direction: column; gap: 6px; }
.pl-row { border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.pl-row summary { display: grid; grid-template-columns: minmax(0, 1fr) 140px 48px; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
.pl-row summary::-webkit-details-marker { display: none; }
.pl-row[open] summary { border-bottom: 1px dashed var(--line); }
.pl-name { font-weight: 700; color: var(--navy); }
.pl-bar { margin: 0; }
.pl-row .pl-pct { text-align: right; }
.pl-body { padding: 10px 14px 12px; }
.season-list { display: flex; flex-direction: column; gap: 6px; }
.season { display: grid; grid-template-columns: 90px 180px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel2); }
@media (max-width: 800px) { .season { grid-template-columns: 1fr; } }
.risk-list li::marker { content: "⚠️ "; }
.s-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--panel2);
  border: 1px solid var(--line); margin-bottom: 14px; }
.s-toolbar form { margin: 0; }
.tune-chip { font-size: 12.5px; color: var(--muted); } .tune-chip.on b { color: var(--ok); }
.menu-more { position: relative; }
.menu-more > summary { list-style: none; } .menu-more > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; width: 260px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px; }
.menu-pop form { display: flex; flex-direction: column; gap: 6px; }
.s-plan { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #FFFBEA; border: 1px solid #FBE3A3; }
.acc { padding: 0; }
.acc > summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; cursor: pointer; list-style: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary h3 { margin: 0; }
.acc-ic { color: var(--muted); transition: .2s; } .acc[open] .acc-ic { transform: rotate(180deg); }
.acc > form, .acc > .mini-row { margin: 0 20px; }
.acc > form { padding-bottom: 18px; }
.acc[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acc > .mini-row:last-child { margin-bottom: 14px; }
.more-adj summary { cursor: pointer; color: var(--blue); padding: 8px 0; }

/* ===== Nghiên cứu thị trường gọn ===== */
.r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.r-head h2 { font-size: 20px; margin-top: 2px; }
.eyebrow-dark { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); font-weight: 700; }
.r-hist { max-width: 260px; font-size: 12.5px; padding: 7px 10px; }
.r-summary { font-size: 15px; line-height: 1.7; margin: 12px 0; color: var(--ink); }
.r-diff { padding: 12px 16px; border-radius: 14px; background: linear-gradient(120deg, #0B1F5C, #1D4ED8); color: #fff; margin-bottom: 16px; box-shadow: var(--shadow-lg); }
.r-diff .label { color: var(--gold); font-weight: 700; } .r-diff div { font-size: 15px; font-weight: 600; }
.comp-row summary { grid-template-columns: 170px minmax(0, 1fr) auto; }
.cr-pos { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-count { display: flex; gap: 4px; }
.cnt { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.cnt.good { background: var(--ok-bg); color: #15803D; } .cnt.bad { background: var(--err-bg); color: var(--err); }
.cr-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; font-size: 13px; }
.cr-meta small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.sw { border-radius: 10px; padding: 8px 12px; } .sw.good { background: #F0FAF3; } .sw.bad { background: #FFF4F4; }
.sw ul { margin: 4px 0 0; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.opp-grid .hl { margin: 0; }
.idea-n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 11.5px;
  align-items: center; justify-content: center; margin-right: 10px; flex: none; }
.idea span { display: flex; align-items: center; }
.r-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.comp-item { border-bottom: 1px solid var(--line); }
.comp-item:last-of-type { border-bottom: none; }
.comp-item > summary { display: flex; gap: 8px; align-items: center; padding: 10px 2px; cursor: pointer; list-style: none; }
.comp-item > summary::-webkit-details-marker { display: none; }
.ci-name { font-weight: 700; color: var(--navy); }
.ci-edit { margin-left: auto; font-size: 12px; color: var(--blue); }
.comp-item[open] .ci-edit { color: var(--muted); }
.comp-item > form { padding: 0 2px 12px; }
.add-comp { margin-top: 12px; }
.add-comp > summary { list-style: none; } .add-comp > summary::-webkit-details-marker { display: none; }
.add-comp[open] > summary { margin-bottom: 4px; background: var(--soft); }
.ev-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ev-date { font-weight: 800; color: var(--navy); background: #FFF1C7; border-radius: 8px; text-align: center; padding: 3px 0; font-size: 12px; }
.ev-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-edit { white-space: nowrap; }
.ci-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-item > summary .tag { white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.note-line { font-size: 12.5px; color: #92400E; background: var(--warn-bg); border: 1px solid #FBE3A3; border-radius: 10px; padding: 7px 12px; margin-bottom: 14px; }

/* ===== Lịch nội dung (giao diện mới) ===== */
.cal-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title { font-size: 28px; margin-top: 2px; }
.cal-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--navy); color: #fff; }
.nav-pill { display: inline-flex; background: #fff; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.nav-pill a { padding: 7px 13px; color: var(--navy); font-weight: 600; font-size: 13px; border-right: 1px solid var(--line); }
.nav-pill a:last-child { border-right: none; } .nav-pill a:hover { background: var(--soft); }
.cal-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cs { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.cs::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.cs b { font-size: 22px; color: var(--navy); font-weight: 800; } .cs span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cs.published::before { background: #16A34A; } .cs.scheduled::before { background: #1D4ED8; } .cs.draft::before { background: #F59E0B; }
.cs.failed::before { background: #DC2626; } .cs.event::before { background: #FFC20E; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-card { padding: 14px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mg-head { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: center; padding: 4px 0 6px; }
.mg-head.weekend { color: var(--blue); }
.mg-day { min-height: 116px; border-radius: 12px; background: #FAFBFE; border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px;
  transition: .15s; min-width: 0; }
.mg-day:hover { border-color: #C7D7FB; background: #fff; box-shadow: var(--shadow); }
.mg-day.weekend { background: #F5F8FF; }
.mg-day.other { opacity: .45; }
.mg-day.today { background: #FFFBEA; border-color: #FFD45C; box-shadow: 0 0 0 2px rgba(255, 194, 14, .25); }
.mg-top { display: flex; justify-content: space-between; align-items: center; }
.mg-date { font-size: 12.5px; font-weight: 700; color: var(--navy); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.mg-day.today .mg-date { background: var(--gold); color: var(--navy); }
.mg-more, .mg-more-link { font-size: 11px; color: var(--blue); font-weight: 600; }
.mg-more { padding-left: 4px; }
.cal-ev { font-size: 10.5px; font-weight: 600; color: #92400E; background: linear-gradient(90deg, #FFF1C7, #FFF8E1); border-radius: 6px; padding: 2px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-post { display: flex; gap: 5px; align-items: center; font-size: 11px; padding: 3px 6px 3px 7px; border-radius: 7px; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--muted); color: var(--ink); min-width: 0; transition: .12s; }
.cal-post:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.cp-time { font-weight: 700; color: var(--navy); flex: none; font-variant-numeric: tabular-nums; }
.cp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-post.st-published { border-left-color: #16A34A; } .cal-post.st-scheduled { border-left-color: #1D4ED8; background: #F3F7FF; }
.cal-post.st-draft, .cal-post.st-rewriting { border-left-color: #F59E0B; border-style: dashed solid dashed solid; border-left-style: solid; }
.cal-post.st-failed { border-left-color: #DC2626; background: #FFF4F4; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; padding: 0 4px; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-dot.published { background: #16A34A; } .lg-dot.scheduled { background: #1D4ED8; } .lg-dot.draft { background: #F59E0B; }
.lg-dot.failed { background: #DC2626; } .lg-dot.event { background: #FFC20E; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-col { background: #FAFBFE; border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 420px; min-width: 0; }
.wk-col.weekend { background: #F5F8FF; }
.wk-col.today { background: #FFFBEA; border-color: #FFD45C; }
.wk-head { display: flex; flex-direction: column; align-items: center; padding: 4px 0 8px; border-bottom: 1px dashed var(--line); margin-bottom: 2px; }
.wk-head span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.wk-head b { font-size: 20px; color: var(--navy); }
.wk-col.today .wk-head b { background: var(--gold); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.wk-empty { font-size: 11px; color: #B6BFD6; text-align: center; padding: 14px 0; }
.cal-post.big { flex-direction: column; align-items: stretch; gap: 3px; padding: 6px; font-size: 12px; }
.cal-post.big img { width: 100%; height: 74px; object-fit: cover; border-radius: 6px; }
.cal-post.big .cp-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.35; }
.cp-status { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.agenda { position: sticky; top: 18px; padding: 16px; }
.agenda h3 { margin-bottom: 8px; }
.ag-day { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ag-day:last-of-type { border-bottom: none; }
.ag-date { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--soft); border-radius: 10px; padding: 4px 0; height: 46px; }
.ag-date b { font-size: 17px; color: var(--navy); line-height: 1; } .ag-date span { font-size: 10px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.ag-day.today .ag-date { background: var(--gold); } .ag-day.today .ag-date span { color: var(--navy); }
.ag-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; justify-content: center; }
.ag-empty { font-size: 12px; color: #B6BFD6; }

/* ===== Hồ sơ thương hiệu gọn ===== */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1150px) { .brand-layout { grid-template-columns: 1fr; } }
.brand-card { padding: 16px 20px 0; }
.brand-card .stab-panel { padding-bottom: 6px; }
.brand-card .stab-panel > .form { padding: 0; }
.tab-count { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #EEF1F7; color: var(--muted); margin-left: 4px; }
.tab-count.full { background: var(--ok-bg); color: #15803D; }
.ok-dot { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--ok-bg); color: #15803D; font-size: 10px;
  align-items: center; justify-content: center; margin-left: 6px; vertical-align: 1px; }
.brand-card .field label { flex-direction: row; align-items: center; }
.brand-card .grid2 .field { margin-bottom: 0; }
.brand-save { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0 14px;
  margin-top: 8px; border-top: 1px solid var(--line); background: linear-gradient(rgba(255,255,255,.85), #fff 30%); }
.ai-mini .af-left { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.ai-mini .af-left h3 { margin: 0 0 2px; }
.ai-mini { background: linear-gradient(150deg, #EAF1FF, #fff 60%); border-color: #C7D7FB; }
.prog-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 34px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: 13px; cursor: pointer; margin: 0; }
.prog-row:hover span:first-child { color: var(--blue); }
.prog-row .bar { margin: 0; } .prog-row b { text-align: right; color: var(--navy); font-size: 12.5px; }
.prog-total { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.prog-total b { font-size: 26px; color: var(--navy); font-weight: 800; }
.brand-card .chips { max-height: 66px; overflow: hidden; position: relative; transition: max-height .25s; }
.brand-card .field:focus-within .chips, .brand-card .field:hover .chips { max-height: 400px; }
.brand-card .field { margin-bottom: 14px; }
.brand-card .field label { margin: 6px 0 6px; }
.brand-card .stab-nav { flex-wrap: nowrap; overflow-x: auto; }
.brand-card .stab-nav label { white-space: nowrap; }
/* Tách rõ từng ô trong hồ sơ thương hiệu */
.brand-card .stab-panel > .field, .brand-card .stab-panel > .grid2, .brand-card .stab-panel > details.guide {
  padding: 16px 0 18px; margin: 0; border-bottom: 1px solid var(--line); }
.brand-card .stab-panel > :last-child { border-bottom: none; }
.brand-card .stab-panel > .grid2 { gap: 28px; }
.brand-card .stab-panel > .grid2 > .field { margin: 0; padding: 0; }
.brand-card .field label { margin: 0 0 8px; font-weight: 700; color: var(--navy); font-size: 13.5px; }
.brand-card .field .chips { margin-top: 10px; }
.brand-card .stab-panel > details.guide { background: none; border-left: none; border-right: none; border-top: none; border-radius: 0; padding-left: 0; padding-right: 0; }
/* Tách rõ từng ô trong tab Hình ảnh */
#visual > .grid2, #visual > .field { padding: 16px 0 18px; margin: 0; border-bottom: 1px solid var(--line); }
#visual > .grid2 { gap: 28px; }
#visual > .grid2 > .field { margin: 0; padding: 0; }
#visual .field label { margin: 0 0 8px; font-weight: 700; color: var(--navy); font-size: 13.5px; display: block; }
#visual .field .chips { margin-top: 10px; }
#visual > p.muted { margin-bottom: 4px; }
#visual > h4 { margin: 0; padding: 18px 0 10px; color: var(--navy); font-size: 13.5px; text-transform: none; letter-spacing: 0; font-weight: 700; }
#visual > .visual-row { padding-bottom: 18px; margin: 0; border-bottom: 1px solid var(--line); }
#visual > label.check { padding: 12px 0; margin: 0; border-bottom: 1px solid var(--line); }
#visual > details.guide { margin-top: 14px; }
#visual .row-form { margin-top: 10px; }
#visual > .grid2 > .field:nth-child(n+3) { padding-top: 16px; border-top: 1px solid var(--line); }
.main:has(.hero) { max-width: none; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; } .post-grid .post-card { margin: 0; }

/* ===== Kho kiến thức ===== */
.kb-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kb-tabs > .stab-nav { margin-bottom: 16px; }
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1150px) { .kb-layout { grid-template-columns: 1fr; } }
.kb-search { display: flex; gap: 8px; }
.kb-hit { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; background: var(--panel2); }
.kb-hit-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; } .kb-hit-head a { margin-left: auto; }
.kb-doc { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.kb-doc:last-child { border-bottom: none; }
.kb-doc.off { opacity: .5; }
.kb-doc form { margin: 0; }
.kb-icon { font-size: 22px; width: 38px; height: 38px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; flex: none; }
.kb-main { flex: 1; min-width: 0; }
.kb-title { font-weight: 700; color: var(--navy); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-tabs .stab-nav { margin-bottom: 4px; }
.add-tabs .form label { margin-top: 10px; }
.kb-tips { padding-left: 18px; } .kb-tips li { margin: 6px 0; }
.lesson { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lesson:last-child { border-bottom: none; }
.lesson.off { opacity: .5; }
.lesson form { margin: 0; }
.lesson-edit { flex: 1; min-width: 0; }
.lesson-edit input { border-color: transparent; background: transparent; padding: 6px 8px; font-weight: 500; }
.lesson-edit input:hover { border-color: var(--line2); background: #fff; }
.nowrap { white-space: nowrap; }

.kb-kind-new { margin-top: 6px; }
.kb-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.kb-kinds .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; }
.kb-kinds .tag-own { background: #FFF6E0; border-color: #F5D98A; color: #8A5A00; }
.kb-kinds form { margin: 0; display: inline; }
.kb-kinds button { border: none; background: none; cursor: pointer; color: inherit; opacity: .55; font-size: 11px; padding: 0 0 0 2px; }
.kb-kinds button:hover { opacity: 1; color: var(--red, #D33); }

/* Sao lưu / khôi phục (3.9) */
.auth-body { flex-direction: column; gap: 16px; padding: 24px 0; }
.auth-restore { padding: 22px 32px; gap: 10px; box-shadow: var(--shadow); }
.auth-restore h3 { font-size: 16px; margin: 0; }
.auth-restore input[type=file] { font-size: 13px; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .bk-grid { grid-template-columns: 1fr; } }
.bk-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--panel2); }
.bk-box h4 { margin: 0 0 6px; }
.bk-list { margin-top: 12px; max-height: 260px; overflow-y: auto; }
.bk-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bk-row:last-child { border-bottom: none; }
.bk-row .tag { white-space: nowrap; }
.bk-row a { margin-left: auto; white-space: nowrap; }

/* ===== Thông báo (3.10) ===== */
.notif { margin-left: auto; position: relative; z-index: 60; }
.notif-bell { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
.notif-bell:hover { transform: translateY(-1px); }
.notif-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #0B1F5C; }
.notif-count[hidden] { display: none; }
.notif-panel { position: fixed; left: 268px; top: 70px; width: 380px; color: var(--text); max-height: 70vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.link-btn { border: none; background: none; color: var(--blue); cursor: pointer; font-size: 12px; padding: 0; }
.notif-list { overflow-y: auto; }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.notif-item:hover { background: var(--soft); }
.notif-item.unread { background: #F2F6FF; box-shadow: inset 3px 0 0 var(--blue); }
.notif-item.k-error.unread { background: #FFF4F4; box-shadow: inset 3px 0 0 #E5484D; }
.ni-title { font-weight: 600; color: var(--navy); font-size: 13.5px; }
.ni-body { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ni-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 10px; width: 340px; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-left: 4px solid var(--blue);
  transform: translateY(14px); opacity: 0; transition: all .25s ease; flex-wrap: wrap; }
.toast.show { transform: none; opacity: 1; }
.toast-ok { border-left-color: #22A06B; } .toast-error { border-left-color: #E5484D; } .toast-lead { border-left-color: #F5A524; }
.toast-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.toast-main b { color: var(--navy); } .toast-main span { color: var(--muted); font-size: 12.5px; }
.toast-go { flex-basis: 100%; order: 3; font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.toast-x { border: none; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.msg-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.act-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--panel); color: var(--blue); border: 1px solid #C9D8F7; text-decoration: none; box-shadow: var(--shadow); }
.act-btn:hover { background: #EEF4FF; }
@media (max-width: 700px) { .notif-panel { width: calc(100vw - 30px); } .toasts { width: calc(100vw - 30px); right: 15px; } }

/* ===== Trung tâm điều hành gọn (3.10) ===== */
.dash-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 18px; border-radius: 20px;
  background: linear-gradient(120deg, #0B1F5C, #1D4ED8 70%, #3B6CF0); color: #fff; box-shadow: var(--shadow-lg); }
.dh-who { display: flex; align-items: center; gap: 14px; flex: 1 1 300px; min-width: 0; }
.dash-hero h1 { font-size: 21px; margin: 0 0 3px; color: #fff; }
.dash-hero .hero-status { color: rgba(255, 255, 255, .85); font-size: 13.5px; }
.dash-hero .hero-status .muted { color: rgba(255, 255, 255, .65); }
.dh-cmd { display: flex; gap: 8px; flex: 1 1 380px; }
.dh-cmd input { flex: 1; min-width: 0; border-radius: 12px; border: none; padding: 11px 14px; font-size: 14px; }
.dh-cmd .btn-primary { background: #FFC20E; color: #0B1F5C; border: none; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.dash-grid > .card { margin-bottom: 0; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.funnel.compact { gap: 6px; } .funnel.compact .fn-text { padding: 7px 11px; font-size: 13px; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px;
  background: #FFC20E; color: #0B1F5C; font-size: 12px; font-weight: 700; vertical-align: 2px; }
.title-list { display: flex; flex-direction: column; }
.tl-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 14px; }
.tl-row:last-child { border-bottom: none; }
a.tl-row:hover { background: var(--soft); border-radius: 8px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: #FFC20E; flex: none; }
.tl-row.bad .tl-dot { background: #E5484D; } .tl-row.bad .tl-meta { color: #C62828; font-weight: 600; }
.tl-ico { width: 18px; text-align: center; flex: none; }
.tl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-weight: 500; }
.tl-meta { flex: none; font-size: 12px; color: var(--muted); }
.bar.ok div { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-c { font-size: 26px; font-weight: 700; fill: var(--navy); } .donut-s { font-size: 12px; fill: var(--muted); }
.donut-legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.donut-legend div { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 8px; align-items: center; }
.donut-legend i { width: 11px; height: 11px; border-radius: 3px; }
.donut-legend small { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.chart.cols .val { font-weight: 600; fill: var(--navy); }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 8px; }
.dash-more summary { cursor: pointer; list-style: none; } .dash-more summary::-webkit-details-marker { display: none; }
.dash-more summary::before { content: "▸ "; color: var(--muted); } .dash-more[open] summary::before { content: "▾ "; }
.dash-more .feed { max-height: 320px; overflow-y: auto; }

/* ===== Bảng kế hoạch (Content Calendar) ===== */
.plan-wrap { overflow-x: auto; }
.plan-table { min-width: 1100px; font-size: 13px; }
.plan-table td { vertical-align: top; }
.plan-table th { white-space: nowrap; background: #EEF3FC; position: sticky; top: 0; }
.plan-idea { font-weight: 600; color: var(--navy); }
.plan-cap { max-width: 340px; }
.plan-cap summary { cursor: pointer; color: var(--text); list-style: none; } .plan-cap summary::-webkit-details-marker { display: none; }
.plan-cap .pre { margin-top: 6px; font-size: 12.5px; background: var(--panel2); padding: 8px 10px; border-radius: 8px; }
.plan-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.st-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #EEF2F7; color: #475569; }
.st-badge.st-published { background: #DCFCE7; color: #166534; } .st-badge.st-scheduled { background: #DBEAFE; color: #1E40AF; }
.st-badge.st-draft, .st-badge.st-rewriting { background: #FEF3C7; color: #92400E; } .st-badge.st-failed { background: #FEE2E2; color: #991B1B; }

/* ===== Chiến lược dễ hiểu (3.10) ===== */
.sx-hero { padding: 18px 20px; border-radius: 16px; background: linear-gradient(120deg, #0B1F5C, #1D4ED8); color: #fff; margin-bottom: 14px; }
.sx-idea { font-size: 20px; font-weight: 700; line-height: 1.35; color: #FFC20E; margin-bottom: 6px; }
.sx-sum { margin: 0; font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .92); }
.sx-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.sx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .sx-grid { grid-template-columns: 1fr; } }
.sx-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--panel2); }
.sx-h { font-weight: 700; color: var(--navy); margin-bottom: 10px; font-size: 14px; }
.sx-h2 { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.sx-goal { margin-bottom: 11px; }
.sx-gl { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.sx-gl b { white-space: nowrap; color: var(--navy); } .sx-gl small { color: var(--muted); font-weight: 500; }
.sx-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.sx-big { display: flex; align-items: baseline; gap: 8px; } .sx-big b { font-size: 34px; color: var(--navy); line-height: 1; } .sx-big span { color: var(--muted); }
.sx-times { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sx-times span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #EEF4FF; color: var(--blue); }
.funnel-mix.sm .fm { padding: 7px 9px; min-width: 0; } .funnel-mix.sm .fm b { font-size: 14px; }
.donut-wrap.sm { gap: 12px; } .donut-wrap.sm .donut-legend { min-width: 0; font-size: 12.5px; gap: 5px; }
.sx-detail-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 4px 0 8px; }
.sx-why { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; } @media (max-width: 900px) { .sx-why { grid-template-columns: 1fr; } }
.pl-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.angle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.angle { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.angle span { color: var(--muted); font-size: 12px; }
.series-list { display: flex; flex-direction: column; gap: 8px; }
.series { border-left: 3px solid #FFC20E; padding: 6px 12px; background: #FFFBEB; border-radius: 0 10px 10px 0; }
.phase-list { display: flex; flex-direction: column; gap: 12px; }
.phase { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ph-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.ph-no { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.ph-mix { display: flex; height: 22px; border-radius: 8px; overflow: hidden; gap: 2px; }
.ph-mix div { display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; min-width: 26px; }
.ph-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); }
.ph-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.next-steps { border: 1px solid #F5D98A; background: #FFFBEB; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.ns-h { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.ns-list { display: flex; flex-direction: column; }
.ns-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #F0D99A; }
.ns-item:last-child { border-bottom: none; }
.ns-no { width: 24px; height: 24px; border-radius: 50%; background: #FFC20E; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.ns-item.done .ns-no { background: #16A34A; color: #fff; } .ns-item.done .ns-t b { color: var(--muted); }
.ns-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ns-t small { color: var(--muted); font-size: 12px; }
.ns-item form { margin: 0; }
.strat-layout { display: flex; flex-direction: column; gap: 0; }
.strat-layout > .col:last-child { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.strat-layout > .col:last-child > .card { margin-bottom: 0; }
.sx-list { margin: 4px 0 0; padding-left: 18px; } .sx-list li { margin: 3px 0; }
.plan-table { min-width: 980px; }
.plan-table .tag { display: inline-block; white-space: nowrap; }
.plan-table td:first-child, .plan-table th:first-child { width: 34px; }
.plan-table td:last-child { white-space: nowrap; }
.plan-cap { max-width: 280px; }

.agent-mini { align-items: center; }
@media (max-width: 700px) { .notif-panel { left: 10px; top: 60px; } }
.sidebar { z-index: 50; }
.notif-head b { color: var(--navy); } .notif-panel { color: var(--text); }
.dh-stop { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); padding: 3px 10px; }
.act-btn.ghost { color: var(--muted); border-color: var(--line); } button.act-btn { cursor: pointer; font-family: inherit; }
.fail-card { display: flex; align-items: center; gap: 16px; justify-content: space-between; border-left: 4px solid #E5484D; background: #FFF7F7; } .fail-card form { margin: 0; flex: none; }
/* hàng trụ cột trong tab Chủ đề (sửa bố cục 3.11) */
.pl-row summary { grid-template-columns: 12px minmax(0, 1fr) minmax(90px, 200px) 46px 14px; gap: 14px; padding: 11px 14px; }
.pl-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.pl-desc { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row[open] .pl-desc { white-space: normal; }
.pl-row .pl-pct { font-size: 15px; }
.pl-chev { color: var(--muted); font-size: 18px; transition: transform .15s; }
.pl-row[open] .pl-chev { transform: rotate(90deg); }
.pl-body { padding: 10px 14px 12px 40px; display: flex; flex-direction: column; gap: 8px; }
.lib-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 6px; }
.lib-pick form { margin: 0; }
.lib-item { width: 100%; border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--panel2); cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; text-align: left; font-family: inherit; position: relative; }
.lib-item:hover { border-color: var(--blue); } .lib-item.on { border-color: #16A34A; }
.lib-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.lib-item span { font-size: 11px; padding: 4px 6px; line-height: 1.3; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-item em { position: absolute; top: 4px; left: 4px; font-size: 10px; font-style: normal; background: rgba(11,31,92,.75); color: #fff; padding: 1px 6px; border-radius: 999px; }

/* ===== Kho tài nguyên (3.11) ===== */
.ast-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ast-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; display: flex; align-items: baseline; gap: 8px; box-shadow: var(--shadow); }
.ast-stats b { font-size: 22px; color: var(--navy); } .ast-stats span { color: var(--muted); font-size: 13px; }
.ast-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.ast-top > .card, .ast-side > .card { margin-bottom: 0; } .ast-side { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1000px) { .ast-top { grid-template-columns: 1fr; } }
.dropzone { border: 2px dashed #B9C8EA; border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; background: #F6F9FF;
  display: flex; flex-direction: column; gap: 4px; align-items: center; }
.dropzone:hover { border-color: var(--blue); background: #EEF4FF; }
.dropzone input { display: none; } .dropzone span { font-weight: 600; color: var(--blue); } .dropzone small { color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } @media (max-width: 800px) { .grid3 { grid-template-columns: 1fr; } }
.ast-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.ast-filter input[name=q] { flex: 1 1 320px; } .ast-filter select { width: auto; }
.ast-layout.with-sel { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ast-layout.with-sel { grid-template-columns: 1fr; } }
.ast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ast-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: inherit; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.ast-card:hover { transform: translateY(-2px); border-color: #B9C8EA; } .ast-card.on { border: 2px solid var(--blue); } .ast-card.off { opacity: .45; }
.ast-img { position: relative; aspect-ratio: 1; background: var(--soft); } .ast-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ast-badge { position: absolute; left: 8px; top: 8px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(11,31,92,.78); color: #fff; }
.ast-badge.wait { background: #F5A300; color: #0B1F5C; } .ast-badge.bad { background: #E5484D; }
.ast-meta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.ast-meta b { font-size: 13px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ast-meta span { font-size: 11.5px; color: var(--muted); }
.ast-detail { position: sticky; top: 16px; } .ast-big { width: 100%; border-radius: 12px; margin-bottom: 6px; max-height: 320px; object-fit: contain; background: var(--soft); }
.ast-detail form { margin: 0; } .ast-empty { padding: 40px 20px; }

/* ===== Kho tài nguyên v2 (3.12) — gọn, hiện đại ===== */
.noscroll { overflow: hidden; }
.ar-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ar-head h1 { margin: 0 0 4px; font-size: 28px; } .ar-head p { margin: 0; }
.ar-actions { display: flex; gap: 8px; } .ar-actions form { margin: 0; }
.ar-types { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ar-types a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--text); background: var(--panel); border: 1px solid var(--line); font-size: 14px; font-weight: 500; transition: all .12s; }
.ar-types a:hover { border-color: #B9C8EA; }
.ar-types a i { font-style: normal; } .ar-types a b { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--soft); padding: 1px 8px; border-radius: 999px; }
.ar-types a.on { background: var(--navy); color: #fff; border-color: var(--navy); } .ar-types a.on b { background: rgba(255,255,255,.18); color: #fff; }
.ar-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.ar-search { flex: 1 1 340px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; color: var(--muted); }
.ar-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.ar-search input { border: none !important; box-shadow: none !important; background: transparent; padding: 10px 0; flex: 1; min-width: 0; outline: none; }
.ar-tools select { width: auto; border-radius: 12px; padding: 9px 12px; background-color: var(--panel); }
.ar-clear { font-size: 13px; color: var(--muted); text-decoration: none; padding: 0 6px; } .ar-clear:hover { color: var(--err); }
.ar-note { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #8A5A00; background: #FFF8E6; border: 1px solid #F5DFA3;
  padding: 9px 14px; border-radius: 12px; margin-bottom: 16px; }
.spin { width: 14px; height: 14px; border: 2px solid #F5C451; border-top-color: transparent; border-radius: 50%; animation: arspin .8s linear infinite; }
@keyframes arspin { to { transform: rotate(360deg); } }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ar-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: 16px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.ar-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(11,31,92,.12); }
.ar-card.on { outline: 3px solid var(--blue); outline-offset: -1px; } .ar-card.off { opacity: .45; }
.ar-thumb { position: relative; aspect-ratio: 4 / 3; background: #EEF2F8; overflow: hidden; }
.ar-thumb img, .ar-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.ar-card:hover .ar-thumb img { transform: scale(1.04); }
.ar-play { position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; border-radius: 50%; background: rgba(11,31,92,.65); color: #fff;
  display: grid; place-items: center; font-size: 14px; padding-left: 3px; }
.ar-ico { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.ar-ico i { font-style: normal; font-size: 38px; } .ar-ico b { font-size: 11px; letter-spacing: .08em; color: #fff; background: var(--navy); padding: 2px 8px; border-radius: 6px; }
.t-document .ar-thumb { background: linear-gradient(135deg, #EAF1FF, #DCE7FF); } .t-design .ar-thumb { background: linear-gradient(135deg, #FCE7F6, #F5D0EE); }
.t-audio .ar-thumb { background: linear-gradient(135deg, #E8FBF1, #CFF3DF); } .t-other .ar-thumb { background: linear-gradient(135deg, #F1F3F7, #E3E7EE); }
.ar-badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--navy); backdrop-filter: blur(4px); }
.ar-badge.wait { background: #FFC20E; }
.ar-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ar-info b { font-size: 13.5px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ar-info span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-empty { text-align: center; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ar-empty div { font-size: 42px; } .ar-empty b { font-size: 17px; color: var(--navy); } .ar-empty span { max-width: 460px; }
.ar-empty.big { border: 2px dashed #C6D3EE; border-radius: 20px; background: var(--panel); cursor: pointer; padding: 70px 20px; }
.ar-empty.big:hover { border-color: var(--blue); }
/* ngăn chi tiết */
.ar-scrim { position: fixed; inset: 0; background: rgba(11,31,92,.25); z-index: 80; }
.ar-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); z-index: 81; overflow-y: auto;
  box-shadow: -18px 0 40px rgba(11,31,92,.18); padding: 18px 20px 30px; animation: arslide .2s ease; }
@keyframes arslide { from { transform: translateX(30px); opacity: 0; } }
.ar-dhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ar-type-chip { font-size: 12px; font-weight: 600; background: var(--soft); padding: 4px 10px; border-radius: 999px; color: var(--navy); }
.ar-x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: none; background: var(--soft); color: var(--text);
  cursor: pointer; text-decoration: none; font-size: 14px; } .ar-x:hover { background: #E1E7F2; }
.ar-preview { border-radius: 14px; overflow: hidden; background: #EEF2F8; margin-bottom: 12px; }
.ar-preview img, .ar-preview video { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.ar-preview audio { width: 100%; margin: 16px 0; } .ar-preview .ar-ico.lg { height: 180px; } .ar-preview .ar-ico.lg i { font-size: 56px; }
.ar-facts { margin: 0 0 12px; display: grid; gap: 6px; font-size: 13px; }
.ar-facts div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; } .ar-facts dt { color: var(--muted); } .ar-facts dd { margin: 0; word-break: break-word; }
.ar-dbtns { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.ar-dbtns form { margin: 0; }
.ar-form small, .ar-mbox small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
/* cửa sổ tải lên */
.ar-modal { position: fixed; inset: 0; background: rgba(11,31,92,.35); z-index: 90; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.ar-modal[hidden] { display: none; }
.ar-mbox { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--panel); border-radius: 20px; padding: 20px 22px;
  box-shadow: 0 30px 70px rgba(11,31,92,.3); animation: arpop .18s ease; }
@keyframes arpop { from { transform: scale(.97); opacity: 0; } }
.ar-mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; } .ar-mhead h3 { margin: 0; }
.ar-drop { border: 2px dashed #B9C8EA; border-radius: 16px; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; cursor: pointer; background: #F6F9FF; transition: all .15s; }
.ar-drop:hover, .ar-drop.over { border-color: var(--blue); background: #EAF1FF; }
.ar-drop-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 20px; margin-bottom: 6px; }
.ar-drop b { color: var(--navy); } .ar-drop span { font-size: 12.5px; color: var(--muted); }
.ar-files { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; margin: 10px 0; }
.ar-frow { display: grid; grid-template-columns: 24px 1fr auto 26px; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.ar-frow i { font-style: normal; } .ar-frow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ar-frow small { color: var(--muted); }
.ar-frow button { border: none; background: none; cursor: pointer; color: var(--muted); }
.ar-progress { position: relative; height: 26px; border-radius: 8px; background: var(--soft); overflow: hidden; margin: 6px 0; }
.ar-progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #1D4ED8, #3B82F6); transition: width .2s; }
.ar-progress span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 26px; color: var(--navy); font-weight: 600; mix-blend-mode: multiply; }
.ar-mfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ar-cats { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.ar-cats summary { cursor: pointer; color: var(--muted); }
/* điền thông tin tệp (3.13) */
.req { color: var(--err); }
.ar-hint { font-size: 12.5px; background: #EEF4FF; color: var(--navy); padding: 8px 12px; border-radius: 10px; }
.ar-form .chips, .ar-fill .chips { margin-top: 6px; } .ar-form .chips .chip, .ar-fill .chips .chip { font-size: 11.5px; padding: 3px 9px; }
.ar-note .ml-auto { margin-left: auto; }
.ar-fill { display: flex; flex-direction: column; gap: 14px; }
.ar-fill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ar-fill-head h2 { margin: 0 0 4px; font-size: 20px; } .ar-fill-head p { margin: 0; max-width: 720px; }
.ar-fill-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
@media (max-width: 800px) { .ar-fill-row { grid-template-columns: 1fr; } }
.ar-fill-thumb { display: flex; flex-direction: column; gap: 8px; }
.ar-fill-thumb img, .ar-fill-thumb video, .ar-fill-thumb .ar-ico { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #EEF2F8; }
.ar-fill-thumb small { color: var(--muted); font-size: 11.5px; word-break: break-all; }
.ar-fill-fields { gap: 10px; }
.ar-fill-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 20px rgba(11,31,92,.08); }
.lb { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.lb small { font-weight: 400; color: var(--muted); font-size: 12px; margin: 0; } .lb .req { margin-left: -3px; }
.mf { display: grid; grid-template-columns: 1fr; gap: 12px; }
.mf-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; } .mf-wide .mf-full { grid-column: 1 / -1; }
@media (max-width: 800px) { .mf-wide { grid-template-columns: 1fr; } }
.mf .chips { margin-top: 5px; gap: 4px; } .mf .chips-label:empty { display: none; }
.ar-fill-row { grid-template-columns: 160px minmax(0, 1fr); }

/* ===== Báo cáo trực quan (3.14) ===== */
.rp { display: flex; flex-direction: column; gap: 16px; } .rp > .card, .rp .dash-grid { margin-bottom: 0; }
.rp-hero { display: flex; align-items: center; gap: 20px; padding: 20px 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(120deg, #0B1F5C, #1D4ED8 75%, #3B6CF0); box-shadow: var(--shadow-lg); }
.rp-hero-txt { flex: 1; min-width: 0; }
.rp-period { font-size: 12.5px; color: rgba(255,255,255,.7); margin-bottom: 4px; }
.rp-hero h2 { margin: 0 0 8px; color: #fff; font-size: 22px; }
.rp-headline { margin: 0; font-size: 17px; line-height: 1.45; color: #FFE07A; font-weight: 600; }
.rp-score { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.rp-score small { color: rgba(255,255,255,.75); font-size: 12px; } .rp-score text { fill: #fff !important; }
.rp-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rp-post { position: relative; display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none;
  color: inherit; background: var(--panel2); transition: transform .12s; } .rp-post:hover { transform: translateY(-2px); }
.rp-post.weak { background: #FFF7F7; border-color: #F5C2C2; }
.rp-rank { position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%; background: #FFC20E; color: var(--navy);
  font-weight: 800; font-size: 12px; display: grid; place-items: center; box-shadow: var(--shadow); } .weak .rp-rank { background: #E5484D; color: #fff; }
.rp-pimg { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex: none; background: #EEF2F8; display: grid; place-items: center; font-size: 22px; }
.rp-pimg img { width: 100%; height: 100%; object-fit: cover; }
.rp-pbody { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rp-pbody b { font-size: 13px; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-pm { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rp-pm .ok { color: #16A34A; font-weight: 700; } .rp-pm .bad { color: #DC2626; font-weight: 700; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hb-l small { color: var(--muted); }
.hb-bar { height: 12px; border-radius: 6px; background: var(--soft); overflow: hidden; } .hb-bar i { display: block; height: 100%; border-radius: 6px; }
.hb b { text-align: right; color: var(--navy); }
.dash-grid.even { grid-template-columns: 1fr 1fr; } @media (max-width: 900px) { .dash-grid.even { grid-template-columns: 1fr; } }
.rp-list h3 { margin: 0 0 10px; font-size: 15px; }
.rp-li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.rp-li:last-child { border-bottom: none; }
.rp-li i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 12px; }
.rp-list.good .rp-li i { background: #DCFCE7; color: #16A34A; } .rp-list.bad .rp-li i { background: #FEE2E2; color: #DC2626; }
.rp-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rp-act { border: 1px solid var(--line); border-top: 4px solid #94A3B8; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--panel2); }
.rp-act.p-cao { border-top-color: #E5484D; } .rp-act.p-trung-bình { border-top-color: #F5A300; } .rp-act.p-thấp { border-top-color: #16A34A; }
.rp-act-top { display: flex; align-items: center; gap: 8px; }
.rp-no { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.rp-act b { color: var(--navy); font-size: 14.5px; line-height: 1.35; }
.rp-impact { font-size: 12.5px; color: #16A34A; font-weight: 600; }
.rp-act details summary { cursor: pointer; font-size: 12px; color: var(--muted); } .rp-act details p { margin: 4px 0 0; }
.rp-more summary { cursor: pointer; list-style: none; } .rp-more summary::-webkit-details-marker { display: none; }
.rp-more summary::before { content: "▸ "; color: var(--muted); } .rp-more[open] summary::before { content: "▾ "; }

/* biểu đồ cao bằng cột phễu (3.14.2) */
.stats-row { align-items: stretch; }
.stats-row > .card { margin-bottom: 0; }
.chart-card { display: flex; flex-direction: column; }
.chart-card .chart-box { flex: 1; display: flex; align-items: center; min-height: 0; }
.chart-card .chart-box svg { width: 100%; height: auto; max-height: 100%; }
.stats-row + * { margin-top: 18px; }

/* Quy trình làm việc của agent (3.14.3) */
.flow { padding: 20px 22px 18px; margin-bottom: 22px; }
.flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 6px; }
.flow-head h3 { margin: 0 0 3px; font-size: 16px; color: var(--navy); }
.flow-head p { margin: 0; font-size: 13px; }
.flow-prog { display: flex; align-items: center; gap: 10px; flex: none; font-size: 13px; font-weight: 700; color: var(--navy); }
.flow-prog i { width: 120px; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; display: block; }
.flow-prog b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--blue2)); }
.flow.is-ready .flow-prog b { background: linear-gradient(90deg, var(--ok), #4ADE80); }
.flow-label { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.flow-label em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.fl-num { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 11px; }

.flow-track { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
.fs { position: relative; text-align: center; padding: 0 6px; }
.fs::before { content: ""; position: absolute; top: 21px; left: calc(-50% + 26px); right: calc(50% + 26px); height: 2px;
  background: var(--line2); border-radius: 2px; }
.fs:first-child::before { display: none; }
.fs a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink);
  padding: 0 4px 6px; border-radius: 12px; }
.fs-dot { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 19px;
  background: var(--panel); border: 2px solid var(--line2); margin-bottom: 4px; transition: transform .15s, box-shadow .15s; }
.fs a:hover .fs-dot { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(29, 78, 216, .18); }
.fs b { font-size: 13.5px; font-weight: 650; color: var(--navy); line-height: 1.25; }
.fs small { font-size: 12px; color: var(--muted); line-height: 1.35; max-width: 170px; }

/* trạng thái bước chuẩn bị */
.fs.done .fs-dot { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 18px; font-weight: 800; }
.fs.done + .fs::before { background: var(--ok); }
.fs.done b { color: var(--ink2); }
.fs.cur .fs-dot { border-color: var(--blue); background: var(--info-bg); box-shadow: 0 0 0 5px rgba(29, 78, 216, .12); }
.fs.todo .fs-dot { filter: grayscale(1); opacity: .55; }
.fs.todo b { color: var(--muted); }
.fs-go { margin-top: 4px; font-size: 12px; font-weight: 700; color: #fff; background: var(--blue); padding: 4px 10px; border-radius: 99px; }

/* vòng vận hành */
.loop { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 6px 12px; }
.loop .fs::before { top: 37px; background: repeating-linear-gradient(90deg, var(--blue2) 0 6px, transparent 6px 11px); opacity: .5; }
.loop .fs::after { content: "›"; position: absolute; top: 25px; left: -6px; font-size: 18px; color: var(--blue2); opacity: .7; }
.loop .fs:first-child::after { display: none; }
.loop .fs-dot { border-color: #C9D8F7; }
.loop .fs.you .fs-dot { border-color: var(--gold2); background: #FFF8E6; }
.fs-who { margin-top: 3px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--info-bg); color: var(--blue); }
.fs.you .fs-who { background: var(--warn-bg); color: var(--warn); }
.fs-badge { position: absolute; top: -5px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--err);
  color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.flow-demo { margin: 12px 0 0; text-align: right; } .flow-demo .link-btn { font-size: 12.5px; }

@media (max-width: 900px) {
  .flow-track { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .fs::before, .loop .fs::after { display: none; }
  .flow-head { flex-direction: column; }
}

/* đọc website đối thủ (3.16) */
.web-badge { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.web-badge.ok { background: var(--ok-bg); color: var(--ok); }
.web-badge.bad { background: var(--warn-bg); color: var(--warn); }
.web-read { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.web-pages { margin: 6px 0 4px; padding-left: 18px; font-size: 13px; }
.web-pages li { margin: 2px 0; } .web-pages a { color: var(--blue); text-decoration: none; word-break: break-all; }
.web-read .inline-form { margin-top: 4px; }

/* Kênh đăng (3.17) */
.chan-card h3 { margin-bottom: 8px; }
.chan-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.chan-row:first-of-type { border-top: 0; }
.chan-st { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.chan-st.ok { color: var(--ok); font-weight: 600; } .chan-st.bad { color: var(--err); font-weight: 600; }
.chan-row .inline-form { margin: 0 0 0 8px; } .chan-row .inline-form.ml-auto { margin-left: auto; }
.chan-err { margin: -2px 0 6px 34px; }
.ch-icon.sm { width: 26px; height: 26px; font-size: 11px; border-radius: 7px; }
.switch-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; color: var(--ink2); }
.steps-list { margin: 6px 0 10px; padding-left: 20px; line-height: 1.6; }

/* Tách kênh (3.18) */
.ch-tabs { display: flex; gap: 6px; margin: -4px 0 14px; flex-wrap: wrap; }
.ch-tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 6px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--ink2); background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: all .12s; }
.ch-tab:hover { border-color: var(--line2); }
.ch-dot, .ch-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; font-size: 10.5px; font-weight: 800;
  color: #fff; background: var(--navy); }
.ch-badge { min-width: 20px; height: 20px; font-size: 10px; }
.t-facebook .ch-dot, .ch-badge.t-facebook { background: #1877F2; }
.t-instagram .ch-dot, .ch-badge.t-instagram { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.t-linkedin .ch-dot, .ch-badge.t-linkedin { background: #0A66C2; }
.ch-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(11, 31, 92, .18); }
.ch-tab.on .ch-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.ch-compare { margin-top: 18px; }
.kpis-1 { grid-template-columns: minmax(0, 260px); }
.empty-ch p { margin: 12px 0 0; }
.ch-tabs-sm { margin: 0 0 14px; } .ch-tabs-sm .ch-tab { font-size: 12.5px; padding: 4px 12px 4px 4px; }
.pc-chans { display: flex; gap: 4px; margin: 8px 0 2px; }
.ch-badge.plan { opacity: .45; filter: grayscale(.3); outline: 1px dashed currentColor; }
.cp-chans { display: inline-flex; gap: 2px; margin-left: auto; flex: none; }
.cp-chans .cd { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #1877F2; }
.cp-chans .cd.t-instagram { background: #DD2A7B; } .cp-chans .cd.t-linkedin { background: #0A66C2; }
.cp-chans .cd.plan { opacity: .4; }
.rp-chans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rp-ch { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel2); }
.rp-ch-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .rp-ch-head .muted { margin-left: auto; }
.rp-ch-nums { display: flex; gap: 16px; } .rp-ch-nums span { display: flex; flex-direction: column; }
.rp-ch-nums b { font-size: 18px; color: var(--navy); } .rp-ch-nums small { font-size: 11.5px; color: var(--muted); }
.rp-ch-v { margin: 10px 0 0; font-size: 13.5px; } .rp-ch-a { margin: 4px 0 0; font-size: 13px; color: var(--blue); font-weight: 600; }
.rp-chb { position: absolute; top: 6px; right: 6px; } .rp-post { position: relative; }
.ch-vs td, .ch-vs th { white-space: nowrap; } .ch-vs { margin-bottom: 8px; }

/* sửa: hàng đối thủ trong báo cáo nghiên cứu bị dồn tên vào cột 12px (3.18.1) */
.pl-row.comp-row summary { grid-template-columns: minmax(150px, 280px) minmax(0, 1fr) auto; }
.pl-row.comp-row .pl-name { overflow-wrap: anywhere; line-height: 1.35; }
@media (max-width: 760px) {
  .pl-row.comp-row summary { grid-template-columns: minmax(0, 1fr) auto; }
  .pl-row.comp-row .cr-pos { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
}
@media (max-width: 1320px) { .bd-grid { grid-template-columns: minmax(0, 1fr); } }
.bd-table td:first-child { min-width: 110px; }

/* ===== Rà soát bố cục (3.18.1) ===== */
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .sidebar { padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
  .sidebar .brand { padding: 4px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
  .sidebar .agent-mini { grid-column: 1 / -1; margin: 0; }
  .sidebar nav, .sidebar .sidebar-foot { display: none; grid-column: 1 / -1; }
  body.nav-open .sidebar nav, body.nav-open .sidebar .sidebar-foot { display: flex; }
  .card table.table:not(.table-wrap table):not(.scroll-box table) { display: block; overflow-x: auto; }
  .section-head { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 560px) {
  .kpi-spark { display: none; }
  .stab-nav { flex-wrap: nowrap; overflow-x: auto; }
  .stab-nav label { white-space: nowrap; }
}
@media (max-width: 820px) {
  .grid2, .grid3, .grid-3-2, .brand-layout, .kb-layout, .cal-layout, .dash-grid, .reports-layout, .sx-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .main > *, .grid2 > *, .grid3 > *, .grid-3-2 > *, .brand-layout > *, .kb-layout > *, .dash-grid > *, .col > * { min-width: 0; }
  .card { max-width: 100%; }
}
