/* ==========================================================================
   TransitFlow — Design system (prototype)
   ========================================================================== */

:root {
  --tf-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tf-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --tf-primary: #2563eb;
  --tf-primary-rgb: 37, 99, 235;
  --tf-primary-600: #1d4ed8;
  --tf-primary-soft: #e8efff;
  --tf-accent: #0ea5a4;
  --tf-accent-soft: #dcf7f5;
  --tf-amber: #f59e0b;
  --tf-amber-soft: #fff4dc;
  --tf-danger: #e11d48;
  --tf-danger-soft: #ffe4ea;
  --tf-success: #16a34a;
  --tf-success-soft: #dcfce7;
  --tf-violet: #7c3aed;
  --tf-violet-soft: #efe7ff;
  --tf-slate-soft: #eef1f6;

  --tf-bg: #f4f6fb;
  --tf-surface: #ffffff;
  --tf-surface-2: #f8fafc;
  --tf-border: #e5e9f2;
  --tf-text: #0f172a;
  --tf-text-2: #475569;
  --tf-muted: #8a94a8;

  --tf-sidebar-bg: #0b1736;
  --tf-sidebar-bg-2: #0f1f4a;
  --tf-sidebar-text: #aab6d3;
  --tf-sidebar-active: #ffffff;

  --tf-radius: 14px;
  --tf-radius-sm: 10px;
  --tf-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --tf-shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --tf-sidebar-w: 264px;
  --tf-topbar-h: 68px;

  --bs-body-font-family: var(--tf-font);
  --bs-body-bg: var(--tf-bg);
  --bs-body-color: var(--tf-text);
  --bs-primary: var(--tf-primary);
  --bs-primary-rgb: var(--tf-primary-rgb);
  --bs-border-color: var(--tf-border);
  --bs-link-color: var(--tf-primary);
  --bs-link-color-rgb: var(--tf-primary-rgb);
}

[data-bs-theme="dark"] {
  --tf-bg: #0a1020;
  --tf-surface: #111a2e;
  --tf-surface-2: #0e1628;
  --tf-border: #1f2b45;
  --tf-text: #e6ebf5;
  --tf-text-2: #a9b4cc;
  --tf-muted: #7584a3;
  --tf-primary-soft: rgba(37, 99, 235, .18);
  --tf-accent-soft: rgba(14, 165, 164, .18);
  --tf-amber-soft: rgba(245, 158, 11, .16);
  --tf-danger-soft: rgba(225, 29, 72, .18);
  --tf-success-soft: rgba(22, 163, 74, .18);
  --tf-violet-soft: rgba(124, 58, 237, .2);
  --tf-slate-soft: #18233b;
  --tf-sidebar-bg: #070d1c;
  --tf-sidebar-bg-2: #0b1430;
  --tf-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --bs-body-bg: var(--tf-bg);
  --bs-body-color: var(--tf-text);
  --bs-border-color: var(--tf-border);
  --bs-secondary-bg: var(--tf-surface-2);
  --bs-tertiary-bg: var(--tf-surface-2);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--tf-font);
  background: var(--tf-bg);
  color: var(--tf-text);
  font-size: .9rem;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
.font-mono { font-family: var(--tf-mono); font-size: .85em; }
.text-muted, .text-secondary { color: var(--tf-muted) !important; }
.text-2 { color: var(--tf-text-2) !important; }
.fw-semi { font-weight: 600; }
.small-xs { font-size: .74rem; }
.ls-1 { letter-spacing: .06em; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--tf-sidebar-w);
  background: linear-gradient(180deg, var(--tf-sidebar-bg) 0%, var(--tf-sidebar-bg-2) 100%);
  color: var(--tf-sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease, width .25s ease;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 240px;
  background: radial-gradient(120% 80% at 0% 100%, rgba(14, 165, 164, .18), transparent 60%);
  pointer-events: none;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1.15rem 1.35rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #0ea5a4);
  box-shadow: 0 6px 18px rgba(14, 165, 164, .35);
  color: #fff;
  font-size: 1.15rem;
}
.brand-sub { display: block; font-size: .68rem; font-weight: 500; color: var(--tf-sidebar-text); letter-spacing: .04em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .85rem 1rem; scrollbar-width: thin; scrollbar-color: #24345f transparent; }
.nav-section {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: #5d6c92;
  padding: 1.1rem .6rem .45rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .58rem .7rem;
  border-radius: 10px;
  color: var(--tf-sidebar-text);
  font-weight: 500;
  font-size: .87rem;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, .28), rgba(59, 130, 246, .08));
  color: var(--tf-sidebar-active);
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -.85rem;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
}
.sidebar-link .badge { margin-left: auto; font-size: .68rem; font-weight: 700; border-radius: 6px; }

.sidebar-footer { padding: .9rem; border-top: 1px solid rgba(255, 255, 255, .06); position: relative; z-index: 1; }
.sidebar-user { display: flex; align-items: center; gap: .7rem; padding: .5rem; border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-user small { color: var(--tf-sidebar-text); display: block; font-size: .72rem; }

.app-main { flex: 1; margin-left: var(--tf-sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--tf-topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  background: color-mix(in srgb, var(--tf-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--tf-border);
}
.topbar-search {
  flex: 1;
  min-width: 0;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: 11px;
  padding: .5rem .85rem;
  color: var(--tf-muted);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:hover { border-color: rgba(var(--tf-primary-rgb), .4); box-shadow: 0 0 0 4px rgba(var(--tf-primary-rgb), .07); }
.kbd { font-family: var(--tf-mono); font-size: .7rem; padding: .1rem .4rem; border-radius: 6px; border: 1px solid var(--tf-border); background: var(--tf-surface-2); color: var(--tf-text-2); }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--tf-border);
  background: var(--tf-surface);
  color: var(--tf-text-2);
  display: inline-grid;
  place-items: center;
  position: relative;
  transition: all .15s;
}
.icon-btn:hover { color: var(--tf-primary); border-color: rgba(var(--tf-primary-rgb), .35); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--tf-danger); border: 2px solid var(--tf-surface); }

.app-content { padding: 1.75rem; flex: 1; }
.app-footer { padding: 1rem 1.75rem; color: var(--tf-muted); font-size: .78rem; border-top: 1px solid var(--tf-border); }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--tf-shadow-lg); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 1035; }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 1rem; gap: .5rem; }
  .topbar .icon-btn { width: 36px; height: 36px; }
  .app-content { padding: 1rem; padding-bottom: 5.5rem; }
}

/* ---------- Mobile bottom nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: var(--tf-surface);
  border-top: 1px solid var(--tf-border);
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--tf-muted); font-size: .66rem; font-weight: 600; padding: .3rem 0; }
.bottom-nav a i { font-size: 1.2rem; }
.bottom-nav a.active { color: var(--tf-primary); }
.bottom-nav .fab { width: 48px; height: 48px; margin-top: -22px; border-radius: 16px; background: linear-gradient(135deg, var(--tf-primary), var(--tf-accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(var(--tf-primary-rgb), .4); flex: none; }
@media (max-width: 991.98px) { .bottom-nav { display: flex; align-items: center; } }

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; margin: 0; }
.page-subtitle { color: var(--tf-muted); margin: .25rem 0 0; }
.breadcrumb { font-size: .78rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: var(--tf-muted); }
.breadcrumb a { color: var(--tf-muted); }
.breadcrumb a:hover { color: var(--tf-primary); }

/* ---------- Cards ---------- */
.card {
  --bs-card-bg: var(--tf-surface);
  --bs-card-border-color: var(--tf-border);
  --bs-card-border-radius: var(--tf-radius);
  --bs-card-inner-border-radius: calc(var(--tf-radius) - 1px);
  --bs-card-cap-bg: transparent;
  box-shadow: var(--tf-shadow);
}
.card-header { padding: 1rem 1.25rem; border-bottom-color: var(--tf-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-title { font-size: .98rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .18s, box-shadow .18s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--tf-shadow-lg); }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-label { color: var(--tf-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .kpi-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: .35rem 0 .2rem; }
.kpi .kpi-value small { font-size: .8rem; font-weight: 600; color: var(--tf-muted); }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.trend { font-size: .76rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; }
.trend.up { color: var(--tf-success); background: var(--tf-success-soft); }
.trend.down { color: var(--tf-danger); background: var(--tf-danger-soft); }

.bg-soft-primary { background: var(--tf-primary-soft) !important; color: var(--tf-primary) !important; }
.bg-soft-accent { background: var(--tf-accent-soft) !important; color: var(--tf-accent) !important; }
.bg-soft-amber { background: var(--tf-amber-soft) !important; color: #c27803 !important; }
.bg-soft-danger { background: var(--tf-danger-soft) !important; color: var(--tf-danger) !important; }
.bg-soft-success { background: var(--tf-success-soft) !important; color: var(--tf-success) !important; }
.bg-soft-violet { background: var(--tf-violet-soft) !important; color: var(--tf-violet) !important; }
.bg-soft-slate { background: var(--tf-slate-soft) !important; color: var(--tf-text-2) !important; }

.hero-card {
  background: radial-gradient(120% 140% at 100% 0%, rgba(14, 165, 164, .55), transparent 55%),
              linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0b1736 100%);
  color: #fff;
  border: 0;
  overflow: hidden;
  position: relative;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, .06);
}
.hero-card .text-muted { color: rgba(255, 255, 255, .7) !important; }

/* ---------- Status pills ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .26rem .62rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-draft { background: var(--tf-slate-soft); color: var(--tf-text-2); }
.status-open { background: var(--tf-primary-soft); color: var(--tf-primary); }
.status-docs { background: var(--tf-amber-soft); color: #b76e00; }
.status-customs { background: var(--tf-violet-soft); color: var(--tf-violet); }
.status-bae { background: var(--tf-accent-soft); color: var(--tf-accent); }
.status-delivered, .status-paid { background: var(--tf-success-soft); color: var(--tf-success); }
.status-late, .status-unpaid { background: var(--tf-danger-soft); color: var(--tf-danger); }
.status-closed { background: var(--tf-slate-soft); color: var(--tf-muted); }

.op-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; padding: .18rem .5rem; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.op-import { background: var(--tf-primary-soft); color: var(--tf-primary); }
.op-export { background: var(--tf-accent-soft); color: var(--tf-accent); }
.op-transit { background: var(--tf-violet-soft); color: var(--tf-violet); }
.op-douane { background: var(--tf-amber-soft); color: #b76e00; }

/* ---------- Tables ---------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--tf-text);
  --bs-table-border-color: var(--tf-border);
  --bs-table-hover-bg: color-mix(in srgb, var(--tf-primary) 4%, transparent);
  margin: 0;
}
.table > thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--tf-muted);
  background: var(--tf-surface-2);
  border-bottom-width: 1px;
  padding: .75rem 1rem;
  white-space: nowrap;
}
.table > tbody td { padding: .85rem 1rem; vertical-align: middle; }
.table-responsive { position: relative; }
.table-responsive > .table > tbody td { white-space: nowrap; }
.table-card .table > thead th:first-child, .table-card .table > tbody td:first-child { padding-left: 1.25rem; }
.table tr.row-link { cursor: pointer; }
.cell-title { font-weight: 600; color: var(--tf-text); }
.cell-sub { font-size: .76rem; color: var(--tf-muted); }

/* ---------- Avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; border-radius: 8px; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 14px; }
.avatar-round { border-radius: 50%; }
.avatar-stack .avatar { border: 2px solid var(--tf-surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Forms & buttons ---------- */
.form-control, .form-select {
  border-radius: var(--tf-radius-sm);
  border-color: var(--tf-border);
  background-color: var(--tf-surface);
  color: var(--tf-text);
  padding: .55rem .85rem;
  font-size: .88rem;
}
.form-control:focus, .form-select:focus { border-color: rgba(var(--tf-primary-rgb), .55); box-shadow: 0 0 0 4px rgba(var(--tf-primary-rgb), .12); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--tf-text-2); margin-bottom: .35rem; }
.input-group-text { background: var(--tf-surface-2); border-color: var(--tf-border); color: var(--tf-muted); border-radius: var(--tf-radius-sm); }
.btn { border-radius: var(--tf-radius-sm); font-weight: 600; font-size: .86rem; padding: .52rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-sm { padding: .32rem .7rem; font-size: .78rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--tf-primary); --bs-btn-border-color: var(--tf-primary); --bs-btn-hover-bg: var(--tf-primary-600); --bs-btn-hover-border-color: var(--tf-primary-600); box-shadow: 0 4px 14px rgba(var(--tf-primary-rgb), .25); }
.btn-gradient { background: linear-gradient(135deg, var(--tf-primary), var(--tf-accent)); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(var(--tf-primary-rgb), .3); }
.btn-gradient:hover { color: #fff; filter: brightness(1.06); }
.btn-light-soft { background: var(--tf-surface); border: 1px solid var(--tf-border); color: var(--tf-text-2); }
.btn-light-soft:hover { border-color: rgba(var(--tf-primary-rgb), .4); color: var(--tf-primary); background: var(--tf-surface); }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ---------- Tabs ---------- */
.nav-tabs-line { border-bottom: 1px solid var(--tf-border); gap: 1.25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-line .nav-link { border: 0; border-bottom: 2px solid transparent; padding: .8rem 0; color: var(--tf-muted); font-weight: 600; background: none; white-space: nowrap; border-radius: 0; }
.nav-tabs-line .nav-link:hover { color: var(--tf-text); }
.nav-tabs-line .nav-link.active { color: var(--tf-primary); border-bottom-color: var(--tf-primary); }
.nav-tabs-line .nav-link .badge { font-size: .65rem; }

.nav-pills-soft { background: var(--tf-surface-2); border: 1px solid var(--tf-border); border-radius: 11px; padding: 3px; display: inline-flex; gap: 2px; }
.nav-pills-soft .nav-link, .nav-pills-soft .btn { border-radius: 8px; padding: .32rem .8rem; font-size: .8rem; font-weight: 600; color: var(--tf-text-2); border: 0; }
.nav-pills-soft .nav-link.active, .nav-pills-soft .btn.active { background: var(--tf-surface); color: var(--tf-primary); box-shadow: var(--tf-shadow); }

/* ---------- Workflow stepper ---------- */
.stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding-bottom: .25rem; position: relative; scrollbar-width: none; }
.step { flex: 1; min-width: 110px; text-align: center; position: relative; }
.step::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 3px; background: var(--tf-border); z-index: 0; }
.step:first-child::before { display: none; }
.step .step-dot { width: 36px; height: 36px; border-radius: 50%; margin: 0 auto .5rem; display: grid; place-items: center; background: var(--tf-surface); border: 2px solid var(--tf-border); color: var(--tf-muted); position: relative; z-index: 1; font-size: .95rem; }
.step .step-label { font-size: .74rem; font-weight: 600; color: var(--tf-muted); }
.step .step-date { font-size: .68rem; color: var(--tf-muted); }
.step.done::before, .step.current::before { background: linear-gradient(90deg, var(--tf-primary), var(--tf-accent)); }
.step.done .step-dot { background: var(--tf-primary); border-color: var(--tf-primary); color: #fff; }
.step.done .step-label { color: var(--tf-text); }
.step.current .step-dot { border-color: var(--tf-primary); color: var(--tf-primary); box-shadow: 0 0 0 6px rgba(var(--tf-primary-rgb), .15); animation: pulse 2s infinite; }
.step.current .step-label { color: var(--tf-primary); }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(var(--tf-primary-rgb), .05); } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--tf-border); }
.timeline li { position: relative; padding-left: 46px; padding-bottom: 1.15rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-icon { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; border: 3px solid var(--tf-surface); }
.timeline .tl-title { font-weight: 600; font-size: .86rem; }
.timeline .tl-meta { font-size: .74rem; color: var(--tf-muted); }

/* ---------- Progress ---------- */
.progress { --bs-progress-bg: var(--tf-slate-soft); border-radius: 99px; height: 8px; }
.progress-thin { height: 5px; }

/* ---------- Dropdowns / modals ---------- */
.dropdown-menu { --bs-dropdown-bg: var(--tf-surface); --bs-dropdown-border-color: var(--tf-border); --bs-dropdown-link-color: var(--tf-text); --bs-dropdown-link-hover-bg: var(--tf-surface-2); border-radius: 12px; box-shadow: var(--tf-shadow-lg); padding: .4rem; font-size: .86rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; display: flex; align-items: center; gap: .55rem; }
.modal-content { border-radius: 18px; border: 0; background: var(--tf-surface); box-shadow: var(--tf-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--tf-border); padding: 1rem 1.25rem; }
.offcanvas { background: var(--tf-surface); }

.notif-item { display: flex; gap: .75rem; padding: .7rem; border-radius: 10px; }
.notif-item:hover { background: var(--tf-surface-2); }

/* ---------- Command palette ---------- */
.cmdk .modal-content { overflow: hidden; }
.cmdk-input { border: 0; font-size: 1.05rem; padding: 1.1rem 1.25rem; background: transparent; color: var(--tf-text); width: 100%; outline: none; }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: .5rem; border-top: 1px solid var(--tf-border); }
.cmdk-group { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tf-muted); padding: .6rem .7rem .3rem; }
.cmdk-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px; color: var(--tf-text); }
.cmdk-item:hover, .cmdk-item.active { background: var(--tf-primary-soft); color: var(--tf-primary); }

/* ---------- Misc ---------- */
.divider-label { display: flex; align-items: center; gap: .75rem; color: var(--tf-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.divider-label::after { content: ""; flex: 1; height: 1px; background: var(--tf-border); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem 1.5rem; }
.dl-grid dt { font-size: .72rem; font-weight: 600; color: var(--tf-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .15rem; }
.dl-grid dd { margin: 0; font-weight: 600; }
.file-tile { display: flex; align-items: center; gap: .8rem; padding: .75rem; border: 1px solid var(--tf-border); border-radius: 12px; background: var(--tf-surface); transition: border-color .15s; }
.file-tile:hover { border-color: rgba(var(--tf-primary-rgb), .4); }
.file-ext { width: 40px; height: 46px; border-radius: 8px; display: grid; place-items: center; font-size: .65rem; font-weight: 800; color: #fff; flex: none; }
.dropzone { border: 2px dashed var(--tf-border); border-radius: var(--tf-radius); padding: 2rem; text-align: center; color: var(--tf-muted); background: var(--tf-surface-2); transition: all .15s; }
.dropzone:hover { border-color: var(--tf-primary); background: var(--tf-primary-soft); color: var(--tf-primary); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--tf-muted); }
.empty-state i { font-size: 2.5rem; opacity: .5; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--tf-border); background: var(--tf-surface); font-size: .76rem; font-weight: 600; color: var(--tf-text-2); }
.chip.active { background: var(--tf-primary-soft); border-color: transparent; color: var(--tf-primary); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--tf-surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--tf-border); padding: .9rem 1.25rem; z-index: 5; }
.amount { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.fade-up { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Print (factures, notes) ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .app-footer, .no-print { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none !important; border: 0 !important; }
}
.min-w-0 { min-width: 0; }
.d-grid > *, .file-tile > * { min-width: 0; }
.file-tile { overflow: hidden; }
.list-clean > li.d-flex > * { min-width: 0; overflow-wrap: anywhere; }
