/* === COMMAREC CFO AGENT — STYLE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #173767;
  --navy-dark:  #0E213E;
  --navy-mid:   #254f8a;
  --cyan:       #00AFF0;
  --cyan-dark:  #008ABD;
  --cyan-bg:    #E0F5FD;
  --bg:         #F0F3F7;
  --surface:    #FFFFFF;
  --border:     #D0DAE8;
  --border-light: #E5EBF2;
  --text:       #0E213E;
  --muted:      #4A6080;
  --tertiary:   #8090A8;
  --success:    #0A7A5A;
  --success-bg: #E2F5EE;
  --success-border: #B8E0CE;
  --warning:    #B85C00;
  --warning-bg: #FFF3E0;
  --warning-border: #FFD8A8;
  --danger:     #C0392B;
  --danger-bg:  #FCEAEA;
  --danger-border: #F5C0C0;
  --info:       #1864AB;
  --info-bg:    #E8F2FC;
  --radius:     6px;
  --radius-lg:  10px;
  --font: 'Montserrat', -apple-system, sans-serif;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; min-height: 100vh; }
a { color: var(--cyan-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 600; color: var(--navy-dark); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }

/* ── NAV (matches CRM) ─────────────────────────────────────────── */
.nav { background: var(--navy); border-bottom: 3px solid var(--cyan); padding: 0 1.5rem; height: 56px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100; }
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo:hover { text-decoration: none; }
.nav-logo-name { font-size: 14px; font-weight: 700; color: white; letter-spacing: 0.06em; line-height: 1; text-transform: uppercase; }
.nav-logo-name span { color: var(--cyan); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; display: block; margin-top: 2px; }
.nav-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.15); }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.55); padding: 6px 12px; border-radius: 4px; transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.08em; position: relative; }
.nav-link:hover { color: white; background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-link.active { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active::after { content: ''; position: absolute; bottom: -3px; left: 12px; right: 12px; height: 2px; background: var(--cyan); border-radius: 1px; }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-user { font-size: 12px; color: rgba(255,255,255,0.6); }
.nav-user strong { color: white; font-weight: 600; }
.nav-badge { background: var(--cyan); color: var(--navy-dark); font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.nav-logout { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.5); padding: 4px 10px; border: 1px solid rgba(255,255,255,0.18); border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.nav-logout:hover { color: white; border-color: rgba(255,255,255,0.4); text-decoration: none; }

/* ── MAIN ──────────────────────────────────────────────────────── */
.main { max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; font-size: 13px; }
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.flash-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.flash-danger, .flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.flash-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--border); }

/* ── PAGE HEADER ───────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 22px; font-weight: 600; }
.page-header .meta { font-size: 12px; color: var(--muted); }

/* ── KPI CARDS ─────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.kpi-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 14px 16px; }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--navy-dark); line-height: 1.1; }
.kpi-sub { font-size: 11px; color: var(--tertiary); margin-top: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-green { background: var(--success); }
.dot-amber { background: var(--warning); }
.dot-red { background: var(--danger); }

/* ── CARDS ─────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 1rem; }
.section-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 8px; }

/* ── RECOMMENDATIONS ───────────────────────────────────────────── */
.rec { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border-light); margin-bottom: 8px; background: var(--surface); }
.rec-critical { background: var(--danger-bg); border-color: var(--danger-border); }
.rec-high { background: var(--warning-bg); border-color: var(--warning-border); }
.rec-medium { background: var(--info-bg); border-color: var(--border); }
.rec-ok { background: var(--success-bg); border-color: var(--success-border); }
.rec-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.rec-critical .rec-title { color: var(--danger); }
.rec-high .rec-title { color: var(--warning); }
.rec-medium .rec-title { color: var(--info); }
.rec-ok .rec-title { color: var(--success); }
.rec-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── FORMS ─────────────────────────────────────────────────────── */
input, textarea, select { font-family: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: white; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,175,240,0.15); }
input[type="checkbox"] { padding: 0; width: 16px; height: 16px; cursor: pointer; }
label { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 3px; }
.form-field label { font-size: 11px; font-weight: 500; }
.form-field input { font-size: 13px; }

button, .btn { font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; background: var(--surface); color: var(--text); transition: all 0.15s; }
button:hover, .btn:hover { background: var(--bg); }
.btn-primary { background: var(--navy); color: white; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-mid); }
.btn-cyan { background: var(--cyan); color: var(--navy-dark); border-color: var(--cyan); }
.btn-cyan:hover { background: var(--cyan-dark); color: white; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-outline:hover { border-color: var(--muted); color: var(--text); background: var(--bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 4px 8px; font-size: 12px; }
.btn-ghost:hover { color: var(--danger); background: transparent; }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.btn-link { background: transparent; border: none; color: var(--cyan-dark); padding: 2px 6px; font-size: 12px; cursor: pointer; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }

/* ── LAYOUT ────────────────────────────────────────────────────── */
.row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .row { grid-template-columns: 1fr; } }

/* ── TASK LIST ─────────────────────────────────────────────────── */
.task-section { margin-bottom: 1rem; }
.task-section-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 6px; }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.task-row:last-child { border-bottom: none; }
.task-row .task-text { flex: 1; font-size: 13px; }
.task-done .task-text { color: var(--tertiary); text-decoration: line-through; }
.task-actions { display: flex; gap: 4px; align-items: center; opacity: 0.4; transition: opacity 0.15s; }
.task-row:hover .task-actions { opacity: 1; }
.badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-freelo { background: var(--cyan-bg); color: var(--cyan-dark); }

/* ── CHAT ──────────────────────────────────────────────────────── */
.chat-container { border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--surface); padding: 1rem; max-height: 60vh; overflow-y: auto; margin-bottom: 1rem; }
.msg { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--radius-lg); }
.msg-user { background: var(--cyan-bg); margin-left: 60px; }
.msg-assistant { background: var(--bg); margin-right: 60px; border: 1px solid var(--border-light); }
.msg-header { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.msg-author { font-weight: 600; color: var(--navy-dark); }
.msg-body { font-size: 13px; white-space: pre-wrap; line-height: 1.55; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row textarea { flex: 1; resize: vertical; min-height: 70px; }

/* ── UPLOAD ────────────────────────────────────────────────────── */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 2rem; text-align: center; background: var(--surface); transition: all 0.15s; cursor: pointer; }
.dropzone:hover, .dropzone.dragging { border-color: var(--cyan); background: var(--cyan-bg); }
.dropzone-text { font-size: 14px; color: var(--muted); }
.dropzone-hint { font-size: 12px; color: var(--tertiary); margin-top: 4px; }

/* ── HISTORY LIST ──────────────────────────────────────────────── */
.history-item { padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.history-item:last-child { border-bottom: none; }
.history-when { font-size: 11px; color: var(--tertiary); }
.history-name { font-weight: 600; color: var(--navy-dark); margin: 2px 0; }
.history-summary { color: var(--muted); }

/* ── FACT CARDS ────────────────────────────────────────────────── */
.fact-cat-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--cyan-dark); font-weight: 700; margin: 14px 0 8px; }
.fact-item { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); margin-bottom: 6px; display: flex; gap: 10px; align-items: flex-start; }
.fact-text { flex: 1; font-size: 13px; line-height: 1.5; }
.fact-meta { font-size: 11px; color: var(--tertiary); margin-top: 4px; }
.fact-pending { background: var(--warning-bg); border-color: var(--warning-border); }
.fact-actions { display: flex; gap: 4px; }

.helper { background: var(--cyan-bg); border-left: 3px solid var(--cyan); padding: 10px 14px; font-size: 12px; color: var(--navy-dark); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1rem; }
.helper code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* ── BRIEFING CARD ─────────────────────────────────────────────── */
.briefing-card { background: linear-gradient(135deg, #0E213E 0%, #173767 100%); color: white; border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 1.5rem; }
.briefing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.briefing-icon { font-size: 16px; margin-right: 6px; }
.briefing-header strong { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.briefing-meta { font-size: 11px; color: rgba(255,255,255,0.55); margin-left: 12px; }
.briefing-card .btn { background: rgba(255,255,255,0.12); color: white; border-color: rgba(255,255,255,0.2); }
.briefing-card .btn:hover { background: rgba(255,255,255,0.2); }
.briefing-body { font-size: 14px; line-height: 1.65; color: rgba(255,255,255,0.95); white-space: pre-wrap; }
.briefing-placeholder { color: rgba(255,255,255,0.5); font-style: italic; }

/* ── CHARTS GRID ───────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 1.5rem; }
.chart-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 18px; min-height: 280px; display: flex; flex-direction: column; }
.chart-card-wide { grid-column: span 2; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--navy-dark); margin-bottom: 4px; }
.chart-sub { font-size: 11px; color: var(--tertiary); margin-bottom: 10px; }
.chart-card canvas { flex: 1; max-height: 260px !important; }
.chart-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--tertiary); font-size: 13px; text-align: center; padding: 1.5rem; }
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: span 1; }
}

/* ── MARGINS TABLE ─────────────────────────────────────────────── */
.margins-table-wrap { overflow-x: auto; flex: 1; }
.margins-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.margins-table th { text-align: left; padding: 6px 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; border-bottom: 1px solid var(--border-light); }
.margins-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-light); }
.margins-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.margins-table .muted { color: var(--tertiary); }
.margins-table .neg { color: var(--danger); }
.pct-pill { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.pct-neg  { background: var(--danger-bg);  color: var(--danger); }
.pct-low  { background: var(--warning-bg); color: var(--warning); }
.pct-mid  { background: var(--cyan-bg);    color: var(--cyan-dark); }
.pct-high { background: var(--success-bg); color: var(--success); }

/* ── Task summary card on dashboard ────────────────────────────── */
.task-summary-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); margin-top: 1rem; }
.task-summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.task-summary-value { font-size: 14px; color: var(--navy-dark); font-weight: 500; margin-top: 2px; }

/* ── Tasks page ────────────────────────────────────────────────── */
.task-section-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 4px 0 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 8px; }
.task-section-desc { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 600px; }
.task-section-count { font-size: 11px; color: var(--tertiary); white-space: nowrap; padding-top: 2px; }
.task-empty { font-size: 12px; color: var(--tertiary); font-style: italic; padding: 8px 0; }
.task-meta { font-size: 11px; color: var(--tertiary); margin-left: 6px; }

/* ── Klikatelné dashboard karty ────────────────────────────────── */
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 1100px) { .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); } }

.kpi-link, .chart-link { text-decoration: none; color: inherit; display: block; transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; }
.kpi-link:hover, .chart-link:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(23,55,103,0.08); border-color: var(--cyan); }
.chart-link { cursor: pointer; }
.chart-cta { font-size: 11px; color: var(--cyan-dark); font-weight: 500; float: right; opacity: 0.6; }
.chart-link:hover .chart-cta { opacity: 1; }

/* ── Detail page ───────────────────────────────────────────────── */
.detail-breadcrumb { display: flex; align-items: center; gap: 16px; margin-bottom: 1.5rem; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.detail-breadcrumb > a { font-size: 12px; color: var(--muted); text-decoration: none; }
.detail-breadcrumb > a:hover { color: var(--navy-dark); }
.detail-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.detail-tab { font-size: 12px; padding: 6px 12px; border-radius: 16px; background: var(--surface); color: var(--muted); text-decoration: none; border: 1px solid var(--border-light); }
.detail-tab:hover { color: var(--navy-dark); border-color: var(--cyan); }
.detail-tab.active { background: var(--navy-dark); color: white; border-color: var(--navy-dark); }

.detail-header { margin-bottom: 1rem; }
.detail-header h1 { margin-bottom: 4px; }
.detail-subtitle { font-size: 13px; color: var(--muted); max-width: 720px; }

.detail-hero { display: grid; grid-template-columns: 280px 1fr; gap: 16px; margin-bottom: 1.5rem; background: linear-gradient(135deg, #0E213E 0%, #173767 100%); color: white; border-radius: var(--radius-lg); padding: 22px 28px; }
.detail-hero-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.6); font-weight: 600; }
.detail-hero-value { font-size: 32px; font-weight: 600; margin-top: 6px; }
.detail-hero-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; align-content: center; }
.detail-stat-label { font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 2px; }
.detail-stat-value { font-size: 14px; font-weight: 500; }
@media (max-width: 800px) { .detail-hero { grid-template-columns: 1fr; } }

.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-main > .card { margin-bottom: 1rem; }
.detail-chart-card { min-height: 340px; }
.detail-chart-card canvas { max-height: 320px !important; }
.chart-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.detail-narrative-card .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.detail-narrative-card h3 { margin: 0; }
.narrative-meta { font-size: 11px; color: var(--tertiary); margin-bottom: 10px; }
.narrative-body { font-size: 14px; line-height: 1.65; color: var(--navy-dark); white-space: pre-wrap; }
.narrative-placeholder { font-size: 13px; color: var(--muted); font-style: italic; padding: 12px 0; }

.card-h3 { margin-top: 0; margin-bottom: 12px; font-size: 13px; color: var(--navy-dark); }
.card-helper { font-size: 11px; color: var(--muted); margin-bottom: 10px; }

.key-facts { list-style: none; padding: 0; margin: 0; }
.key-facts li { font-size: 13px; line-height: 1.55; padding: 8px 0; border-bottom: 1px solid var(--border-light); color: var(--navy-dark); }
.key-facts li:last-child { border-bottom: none; }

.question-link { display: block; padding: 10px 12px; margin-bottom: 6px; background: var(--bg); border-radius: var(--radius); font-size: 13px; color: var(--navy-dark); text-decoration: none; line-height: 1.4; transition: background 0.12s ease; }
.question-link:hover { background: var(--cyan-bg); color: var(--cyan-dark); }
.question-arrow { color: var(--cyan); font-weight: 600; margin-right: 4px; }

.sidebar-task { font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-light); color: var(--navy-dark); line-height: 1.4; }
.sidebar-task:last-of-type { border-bottom: none; }
.sidebar-task-section { font-size: 10px; text-transform: uppercase; color: var(--tertiary); letter-spacing: 0.04em; margin-right: 6px; font-weight: 600; }

.chat-topic-banner { background: var(--cyan-bg); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--navy-dark); }
.chat-topic-banner a { font-size: 12px; color: var(--cyan-dark); text-decoration: none; }

/* ── Project detail: Reality | Adjusted | Diff ──────────────── */
.dual-view { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 12px; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .dual-view { grid-template-columns: 1fr; } }
.dual-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 18px; }
.dual-reality { border-left: 3px solid #94a3b8; }
.dual-adjusted { border-left: 3px solid var(--cyan); }
.dual-diff { border-left: 3px solid var(--success); }
.dual-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.dual-stat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.dual-stat:last-child { border-bottom: none; }
.dual-stat-name { font-size: 12px; color: var(--muted); }
.dual-stat-value { font-size: 15px; font-weight: 600; color: var(--navy-dark); font-variant-numeric: tabular-nums; }
.dual-stat-value.neg { color: var(--danger); }
.dual-stat-value.pos { color: var(--success); }
.dual-empty { font-size: 12px; color: var(--tertiary); padding: 12px 0; text-align: center; line-height: 1.5; }
.dual-diff-value { font-size: 26px; font-weight: 600; padding: 6px 0; }
.dual-diff-value.pos { color: var(--success); }
.dual-diff-value.neg { color: var(--danger); }
.dual-diff-sub { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.dual-diff-list { border-top: 1px solid var(--border-light); padding-top: 10px; }
.dual-diff-item { font-size: 11px; color: var(--navy-dark); padding: 4px 0; line-height: 1.4; }
.dual-diff-item small { display: block; color: var(--tertiary); margin-top: 1px; }

/* ── Notes (entity context) ───────────────────────────────── */
.note-card { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; background: var(--bg); }
.note-card.note-type-timing { border-left: 3px solid var(--cyan); }
.note-card.note-type-risk { border-left: 3px solid var(--warning); }
.note-card.note-type-escalation { border-left: 3px solid var(--danger); }
.note-card.note-type-dohoda { border-left: 3px solid var(--success); }
.note-card.note-type-context { border-left: 3px solid var(--tertiary); }
.note-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 11px; }
.note-type-badge { background: var(--surface); padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; color: var(--muted); border: 1px solid var(--border-light); }
.note-author { font-weight: 600; color: var(--navy-dark); }
.note-date { color: var(--tertiary); }
.note-body { font-size: 13px; line-height: 1.55; color: var(--navy-dark); white-space: pre-wrap; }
.note-adjustment { margin-top: 8px; padding: 6px 10px; background: var(--cyan-bg); border-radius: var(--radius); font-size: 12px; }
.note-adjustment .adj-label { color: var(--muted); }
.note-adjustment .adj-value { color: var(--cyan-dark); font-weight: 600; margin: 0 6px; font-variant-numeric: tabular-nums; }
.note-adjustment .adj-period { color: var(--muted); font-size: 11px; }

.add-note-details { margin-top: 14px; }
.add-note-details summary { cursor: pointer; padding: 8px 12px; background: var(--bg); border-radius: var(--radius); font-size: 13px; color: var(--cyan-dark); font-weight: 500; }
.add-note-details[open] summary { margin-bottom: 12px; }
.add-note-form { padding: 0 4px; }
.add-note-form .form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.add-note-form label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.add-note-form textarea { min-height: 80px; resize: vertical; }
.form-fieldset { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; }
.form-fieldset legend { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; padding: 0 6px; }
.form-fieldset legend small { font-weight: normal; text-transform: none; letter-spacing: 0; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .form-row-3 { grid-template-columns: 1fr; } }

.card-empty { font-size: 12px; color: var(--muted); font-style: italic; padding: 14px 0; line-height: 1.5; }

/* Klikatelné řádky v margins tabulce */
.margins-table-clickable tr.clickable-row { cursor: pointer; transition: background 0.12s ease; }
.margins-table-clickable tr.clickable-row:hover { background: var(--bg); }
.margins-table-clickable td a { color: var(--cyan-dark); text-decoration: none; }
.margins-table-clickable td a:hover { text-decoration: underline; }

.note-indicator, .note-dot { display: inline-block; font-size: 11px; color: var(--cyan-dark); }

/* ── Projects ──────────────────────────────────────────── */
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1000px) { .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); } }

.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 1rem; }
.filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-right: 4px; font-weight: 600; }
.filter-pill { font-size: 12px; padding: 4px 10px; border-radius: 14px; background: var(--surface); color: var(--muted); text-decoration: none; border: 1px solid var(--border-light); transition: all 0.12s ease; }
.filter-pill:hover { border-color: var(--cyan); color: var(--navy-dark); }
.filter-pill.active { background: var(--navy-dark); color: white; border-color: var(--navy-dark); }

.projects-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.projects-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--border-light); font-weight: 600; }
.projects-table th.num { text-align: right; }
.projects-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.projects-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.projects-table td.muted { color: var(--muted); }
.projects-table td a { color: var(--cyan-dark); text-decoration: none; }
.projects-table td a:hover { text-decoration: underline; }
.projects-table tr:last-child td { border-bottom: none; }
.projects-table tr.clickable-row { cursor: pointer; transition: background 0.12s ease; }
.projects-table tr.clickable-row:hover { background: var(--bg); }

.billing-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.billing-hourly  { background: #e0f2fe; color: #0369a1; }
.billing-retainer{ background: #dcfce7; color: #15803d; }
.billing-fixed   { background: #fef3c7; color: #b45309; }
.billing-resale  { background: #fff7ed; color: #c2410c; }

.status-pill { display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 10px; font-weight: 500; }
.status-pill-active   { background: var(--success-bg); color: var(--success); }
.status-pill-paused   { background: var(--warning-bg); color: var(--warning); }
.status-pill-done     { background: var(--bg); color: var(--muted); }
.status-pill-planned  { background: var(--cyan-bg); color: var(--cyan-dark); }

.project-row.status-done { opacity: 0.55; }
.project-row.status-paused td { color: var(--muted); }

/* Project form */
.project-form .form-row { margin-bottom: 14px; }
.project-form .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.project-form .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.project-form label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 4px; }
.project-form input, .project-form select, .project-form textarea { width: 100%; }
@media (max-width: 700px) {
  .project-form .form-row-2, .project-form .form-row-3 { grid-template-columns: 1fr; }
}

.progress-bar { width: 100%; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #00AFF0, #173767); transition: width 0.3s ease; }

.dot-cyan { background: var(--cyan); }

/* ── Period filter (detail pages) ──────────────────────── */
.detail-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.period-filter { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 280px; }
.period-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.period-select { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 12px; color: var(--navy-dark); cursor: pointer; }
.period-pills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.period-pill { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: var(--surface); color: var(--muted); text-decoration: none; border: 1px solid var(--border-light); transition: all 0.12s ease; }
.period-pill:hover { border-color: var(--cyan); color: var(--navy-dark); }
.period-pill.active { background: var(--navy-dark); color: white; border-color: var(--navy-dark); }
@media (max-width: 700px) {
  .period-filter { align-items: flex-start; min-width: 0; width: 100%; }
  .period-pills { justify-content: flex-start; }
}

/* ── Upload — katalog ───────────────────────────────────── */
.upload-helper { background: var(--cyan-bg); border-left: 3px solid var(--cyan); padding: 12px 16px; font-size: 13px; color: var(--navy-dark); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1rem; line-height: 1.5; }
.section-sub { font-size: 13px; color: var(--muted); margin-top: -6px; margin-bottom: 12px; }

/* Drop zone — velký a viditelný */
.upload-dropzone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 28px 20px; background: var(--surface); transition: all 0.15s ease; }
.upload-dropzone.drag-over { border-color: var(--cyan); background: var(--cyan-bg); }
.dropzone-content { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 0; cursor: pointer; }
.dropzone-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--cyan-bg); color: var(--cyan-dark); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; margin-bottom: 14px; }
.dropzone-title { font-size: 16px; font-weight: 600; color: var(--navy-dark); margin-bottom: 4px; }
.dropzone-sub { font-size: 12px; color: var(--muted); }
.dropzone-files { display: flex; flex-direction: column; gap: 4px; max-width: 600px; margin: 8px auto 0; }
.dropzone-file { background: var(--bg); padding: 8px 14px; border-radius: var(--radius); font-size: 13px; color: var(--navy-dark); }
.dropzone-submit { display: block; margin: 14px auto 0; min-width: 240px; }
.dropzone-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* File catalog */
.file-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.file-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 18px; }
.file-card.file-status-fresh   { border-left: 3px solid var(--success); }
.file-card.file-status-aging   { border-left: 3px solid var(--warning); }
.file-card.file-status-stale   { border-left: 3px solid var(--danger); }
.file-card.file-status-never   { border-left: 3px solid var(--tertiary); background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 30%); }

.file-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.file-card-title { font-size: 14px; font-weight: 600; color: var(--navy-dark); margin-bottom: 2px; }
.file-card-filename { font-size: 11px; font-family: 'SF Mono', Menlo, Consolas, monospace; color: var(--cyan-dark); background: var(--cyan-bg); padding: 1px 6px; border-radius: 3px; display: inline-block; }
.file-card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }

.file-status-pill { font-size: 10px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.file-status-pill.file-status-fresh   { background: var(--success-bg); color: var(--success); }
.file-status-pill.file-status-aging   { background: var(--warning-bg); color: var(--warning); }
.file-status-pill.file-status-stale   { background: var(--danger-bg); color: var(--danger); }
.file-status-pill.file-status-never   { background: var(--bg); color: var(--tertiary); }

.file-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); margin-bottom: 10px; }
.file-meta-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tertiary); margin-bottom: 1px; }
.file-meta-value { font-size: 12px; color: var(--navy-dark); }
.file-meta-value small { color: var(--muted); }

.file-impact-details summary { font-size: 12px; cursor: pointer; color: var(--cyan-dark); padding: 4px 0; }
.file-impact-list { list-style: none; padding: 6px 0 0 0; margin: 0; }
.file-impact-list li { font-size: 11px; padding: 3px 0 3px 14px; position: relative; color: var(--navy-dark); }
.file-impact-list li::before { content: "›"; position: absolute; left: 4px; color: var(--cyan); font-weight: 600; }
.file-detection-hint { font-size: 11px; color: var(--muted); margin-top: 8px; padding: 6px 8px; background: var(--bg); border-radius: 4px; }

/* Per-tile upload */
.file-upload-form { margin: 10px 0 6px; }
.file-upload-btn { display: block; text-align: center; padding: 8px 12px; background: var(--cyan-bg); color: var(--cyan-dark); border-radius: var(--radius); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.12s ease; border: 1px dashed var(--cyan); }
.file-upload-btn:hover { background: var(--cyan); color: white; border-style: solid; }

.file-history-details { margin-top: 8px; }
.file-history-details summary { font-size: 12px; cursor: pointer; color: var(--muted); padding: 4px 0; }
.file-history-list { margin-top: 6px; }
.file-history-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: var(--radius); transition: background 0.12s ease; gap: 10px; }
.file-history-item:hover { background: var(--bg); }
.file-history-info { flex: 1; min-width: 0; }
.file-history-name { font-size: 12px; color: var(--navy-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-history-meta { font-size: 10px; color: var(--tertiary); margin-top: 1px; }
.file-history-download { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--cyan); color: white; border-radius: 50%; text-decoration: none; font-weight: 600; flex-shrink: 0; transition: transform 0.12s ease; }
.file-history-download:hover { transform: scale(1.08); }
.file-history-noblob { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--tertiary); flex-shrink: 0; }

/* Inline edit button v projektech */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--cyan-bg); color: var(--cyan-dark); text-decoration: none; font-size: 14px; transition: all 0.12s ease; }
.btn-icon:hover { background: var(--cyan); color: white; transform: scale(1.08); }

/* Priority badges na upload tile */
.priority-badge { display: inline-block; font-size: 8px; vertical-align: middle; margin-right: 6px; line-height: 1; }
.priority-critical { color: #dc2626; }
.priority-high     { color: #f59e0b; }
.priority-medium   { color: #6366f1; }
.priority-low      { color: #94a3b8; }

/* History table */
.history-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.history-table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--border-light); font-weight: 600; }
.history-table td { padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--border-light); }
.history-table tr:last-child td { border-bottom: none; }
.history-table .nowrap { white-space: nowrap; }
.file-type-badge { font-size: 10px; padding: 2px 8px; background: var(--bg); border-radius: 10px; color: var(--muted); }

/* Confirm preview */
.confirm-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1.5rem; }
.confirm-card { display: flex; gap: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); border-left: 3px solid var(--border); }
.confirm-card.confirm-status-ready    { border-left-color: var(--success); }
.confirm-card.confirm-status-unknown  { border-left-color: var(--warning); }
.confirm-card.confirm-status-skipped  { border-left-color: var(--tertiary); opacity: 0.7; }
.confirm-card.confirm-status-error    { border-left-color: var(--danger); }
.confirm-checkbox { display: flex; align-items: center; padding-top: 2px; }
.confirm-checkbox input { width: 18px; height: 18px; cursor: pointer; }
.confirm-icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--warning-bg); color: var(--warning); font-weight: 700; font-size: 13px; }
.confirm-status-skipped .confirm-icon { background: var(--bg); color: var(--tertiary); }
.confirm-status-error   .confirm-icon { background: var(--danger-bg); color: var(--danger); }
.confirm-body { flex: 1; min-width: 0; }
.confirm-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.confirm-filename { font-weight: 600; color: var(--navy-dark); font-size: 13px; cursor: pointer; }
.confirm-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--success-bg); color: var(--success); white-space: nowrap; }
.confirm-type.confirm-type-unknown { background: var(--warning-bg); color: var(--warning); }
.confirm-type.confirm-type-skipped { background: var(--bg); color: var(--tertiary); }
.confirm-type.confirm-type-error   { background: var(--danger-bg); color: var(--danger); }
.confirm-summary { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.confirm-error { font-size: 12px; color: var(--danger); }
.confirm-impact { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.confirm-impact-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tertiary); margin-right: 4px; font-weight: 600; }
.impact-pill { font-size: 11px; padding: 2px 8px; background: var(--cyan-bg); color: var(--cyan-dark); border-radius: 10px; }
.confirm-actions { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--border-light); flex-wrap: wrap; gap: 10px; }

/* Tighter list styling for chat (force tight even if loose markdown) */
.markdown-body li { margin: 0.15em 0; }
.markdown-body ol li, .markdown-body ul li { padding-left: 4px; }
.markdown-body ol > li::marker { font-weight: 600; color: var(--navy-dark); }

.breadcrumb-sep { color: var(--tertiary); margin: 0 8px; }
.breadcrumb-current { color: var(--navy-dark); font-weight: 500; }

/* ── Chat layout: main + sidebar ───────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; } }

.chat-sidebar { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 14px; max-height: calc(100vh - 200px); overflow-y: auto; position: sticky; top: 90px; }
@media (max-width: 900px) { .chat-sidebar { position: static; max-height: 300px; } }

.chat-sidebar-header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.chat-sidebar-count { background: var(--cyan-bg); color: var(--cyan-dark); padding: 1px 8px; border-radius: 10px; font-size: 10px; }

.recent-q { display: block; padding: 10px 8px; margin: 0 -8px; border-radius: var(--radius); text-decoration: none; color: var(--navy-dark); transition: background 0.12s ease; cursor: pointer; }
.recent-q:hover { background: var(--bg); }
.recent-q-text { font-size: 12px; line-height: 1.45; margin-bottom: 4px; }
.recent-q-meta { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--tertiary); }
.recent-q-reuse { background: none; border: 1px solid var(--border-light); color: var(--cyan-dark); font-size: 10px; padding: 2px 8px; border-radius: 8px; cursor: pointer; transition: all 0.12s ease; }
.recent-q-reuse:hover { background: var(--cyan-bg); border-color: var(--cyan); }
.recent-q-empty { font-size: 12px; color: var(--tertiary); text-align: center; padding: 16px 0; font-style: italic; }

.chat-main { min-width: 0; }
.chat-empty-state { text-align: center; padding: 3rem 0; color: var(--muted); font-size: 13px; }

/* ── Markdown body styling ─────────────────────────────────── */
.markdown-body { font-size: 14px; line-height: 1.6; color: var(--navy-dark); }
.markdown-body p { margin: 0 0 0.75em; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body strong { font-weight: 600; color: var(--navy-dark); }
.markdown-body em { font-style: italic; }
.markdown-body ul, .markdown-body ol { margin: 0.5em 0 0.75em; padding-left: 1.5em; }
.markdown-body li { margin: 0.25em 0; }
.markdown-body li > p { margin: 0; }
.markdown-body h1, .markdown-body h2 { font-size: 16px; font-weight: 600; margin: 1em 0 0.5em; color: var(--navy-dark); }
.markdown-body h3, .markdown-body h4 { font-size: 14px; font-weight: 600; margin: 0.75em 0 0.4em; color: var(--navy-dark); }
.markdown-body code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--navy-dark); }
.markdown-body pre { background: var(--bg); padding: 12px 14px; border-radius: var(--radius); overflow-x: auto; margin: 0.5em 0; }
.markdown-body pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; }
.markdown-body blockquote { border-left: 3px solid var(--cyan); padding-left: 12px; margin: 0.5em 0; color: var(--muted); }
.markdown-body table { border-collapse: collapse; margin: 0.5em 0; font-size: 12px; }
.markdown-body th, .markdown-body td { padding: 6px 10px; border: 1px solid var(--border-light); text-align: left; }
.markdown-body th { background: var(--bg); font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid var(--border-light); margin: 1em 0; }
.markdown-body a { color: var(--cyan-dark); text-decoration: underline; }

/* User messages: jen preserve newlines */
.msg-user .msg-body { white-space: pre-wrap; }

/* Smooth scroll k anchor (z sidebaru) */
.msg { scroll-margin-top: 100px; }
.msg:target { animation: highlight 1.6s ease; }
@keyframes highlight {
  0% { box-shadow: 0 0 0 3px var(--cyan); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Loading overlay ───────────────────────────────────────── */
.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(14, 33, 62, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: fadein 0.2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.loading-content {
  background: white;
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border-light);
  border-top-color: var(--cyan);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 6px;
}
.loading-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}
.loading-tips {
  text-align: left;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-top: 14px;
}
.loading-tip {
  font-size: 11px;
  color: var(--tertiary);
  line-height: 1.6;
  padding: 2px 0;
  opacity: 0;
  animation: fadein-tip 0.4s ease forwards;
}
.loading-tip:nth-child(1) { animation-delay: 0.5s; }
.loading-tip:nth-child(2) { animation-delay: 1.5s; }
.loading-tip:nth-child(3) { animation-delay: 3.0s; }
@keyframes fadein-tip { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── BRIEFING ──────────────────────────────────────────────────── */
.briefing-card { background: linear-gradient(135deg, #0E213E 0%, #173767 100%); color: white; padding: 20px 24px; border-radius: var(--radius-lg); margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(14, 33, 62, 0.15); }
.briefing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.briefing-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--cyan); text-transform: uppercase; }
.briefing-time { font-size: 11px; color: rgba(255,255,255,0.5); margin-left: 10px; }
.briefing-content { font-size: 14px; line-height: 1.65; color: rgba(255,255,255,0.95); white-space: pre-wrap; }
.briefing-empty { font-size: 13px; color: rgba(255,255,255,0.6); padding: 6px 0; line-height: 1.5; }
.briefing-card .btn-outline { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.85); }
.briefing-card .btn-outline:hover { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.4); }

/* ── CHARTS ────────────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 1.5rem; }
.chart-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 18px; }
.chart-wide { grid-column: span 2; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--navy-dark); margin-bottom: 2px; }
.chart-sub { font-size: 11px; color: var(--tertiary); margin-bottom: 12px; }
.chart-card canvas { max-height: 240px; }
.chart-wide canvas { max-height: 280px; }
.chart-empty { font-size: 12px; color: var(--tertiary); text-align: center; padding: 80px 16px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg); }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } .chart-wide { grid-column: span 1; } }

/* ── HEAT MAP ──────────────────────────────────────────────────── */
.margin-heatmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.heat-cell { padding: 8px 10px; border-radius: 4px; color: white; font-size: 11px; line-height: 1.3; min-height: 70px; display: flex; flex-direction: column; justify-content: space-between; }
.heat-bad { background: #dc2626; }
.heat-low { background: #f59e0b; }
.heat-mid { background: #10b981; }
.heat-high { background: #059669; }
.heat-name { font-weight: 600; font-size: 11px; line-height: 1.2; }
.heat-client { font-size: 10px; opacity: 0.85; margin-top: 1px; }
.heat-margin { font-size: 14px; font-weight: 700; margin-top: auto; }
.heat-revenue { font-size: 10px; opacity: 0.85; }

/* ── MORE RECS ─────────────────────────────────────────────────── */
.more-recs { margin-top: 14px; }
.more-recs summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 0; user-select: none; }
.more-recs summary::-webkit-details-marker { color: var(--cyan-dark); }
.more-recs[open] summary { margin-bottom: 8px; color: var(--text); }
