/* AssetFlow – custom theme on top of Bootstrap 5.3 */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../vendor/fonts/PlusJakartaSans-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root, [data-bs-theme="light"] {
  --af-bg: #f3f5fb;
  --af-surface: #ffffff;
  --af-surface-2: #f8f9fd;
  --af-border: #e5e8f2;
  --af-text: #0f172a;
  --af-muted: #64748b;
  --af-primary: #6366f1;
  --af-primary-2: #8b5cf6;
  --af-pink: #ec4899;
  --af-cyan: #06b6d4;
  --af-green: #10b981;
  --af-amber: #f59e0b;
  --af-rose: #f43f5e;
  --af-slate: #94a3b8;
  --af-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --af-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --af-shadow-lg: 0 24px 60px -20px rgba(49, 46, 129, .35);
  --af-radius: 18px;
  --af-side-w: 264px;
  --bs-body-bg: var(--af-bg);
  --bs-body-color: var(--af-text);
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: .9rem;
  --bs-primary: #6366f1;
  --bs-primary-rgb: 99, 102, 241;
  --bs-link-color-rgb: 99, 102, 241;
  --bs-link-hover-color-rgb: 79, 70, 229;
  --bs-border-color: var(--af-border);
  --bs-secondary-color: var(--af-muted);
  --bs-border-radius: .7rem;
  --bs-border-radius-lg: 1rem;
}
[data-bs-theme="dark"] {
  --af-bg: #0a0e1c;
  --af-surface: #121829;
  --af-surface-2: #182036;
  --af-border: #232c47;
  --af-text: #e7ebf6;
  --af-muted: #8e9ab8;
  --af-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --af-shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --bs-body-bg: var(--af-bg);
  --bs-body-color: var(--af-text);
  --bs-border-color: var(--af-border);
  --bs-secondary-color: var(--af-muted);
  --bs-tertiary-bg: var(--af-surface-2);
}

body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.015em; }
a { text-decoration: none; }
.text-muted { color: var(--af-muted) !important; }
.num { font-variant-numeric: tabular-nums; }
.fw-800 { font-weight: 800; }
.grad-text { background: var(--af-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: rgba(99, 102, 241, .25); }
* { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .45) transparent; }

/* ---------- buttons & forms */
.btn { font-weight: 600; border-radius: .7rem; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: .95rem; --bs-btn-font-size: .875rem; }
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .8rem; border-radius: .55rem; }
.btn-primary { background: var(--af-grad); border: 0; box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .7); }
.btn-primary:hover, .btn-primary:focus-visible, .btn-primary:active { background: var(--af-grad) !important; filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--af-grad); opacity: .6; }
.btn-light { --bs-btn-bg: var(--af-surface); --bs-btn-border-color: var(--af-border); --bs-btn-color: var(--af-text); --bs-btn-hover-bg: var(--af-surface-2); --bs-btn-hover-border-color: var(--af-border); --bs-btn-hover-color: var(--af-text); --bs-btn-active-bg: var(--af-surface-2); --bs-btn-active-color: var(--af-text); --bs-btn-active-border-color: var(--af-border); }
.btn-icon { flex: none; width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 12px; }
.btn-icon.btn-sm { width: 32px; height: 32px; border-radius: 10px; }
.form-control, .form-select { border-radius: .7rem; padding: .55rem .8rem; font-size: .875rem; background-color: var(--af-surface); border-color: var(--af-border); }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .16); }
.form-label { font-weight: 600; font-size: .78rem; color: var(--af-muted); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--af-primary); border-color: var(--af-primary); }
.dropdown-menu { border-radius: 14px; border-color: var(--af-border); box-shadow: var(--af-shadow-lg); padding: .4rem; font-size: .875rem; background: var(--af-surface); }
.dropdown-item { border-radius: 9px; padding: .45rem .7rem; display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.dropdown-item:active { background: var(--af-primary); }
.dropdown-item i { opacity: .75; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 10% 10%, #7c3aed 0%, transparent 60%), radial-gradient(700px 500px at 90% 90%, #db2777 0%, transparent 55%), linear-gradient(135deg, #312e81, #4f46e5 50%, #7c3aed); }
.login-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.login-art > * { position: relative; z-index: 1; }
.login-feature { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); }
.login-feature i { font-size: 1.25rem; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--af-surface); }
.demo-chip { cursor: pointer; border: 1px dashed var(--af-border); border-radius: 12px; padding: .5rem .75rem; font-size: .78rem; background: var(--af-surface-2); transition: .15s; text-align: left; color: var(--af-text); }
.demo-chip:hover { border-color: var(--af-primary); transform: translateY(-1px); }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- brand */
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--af-grad); display: grid; place-items: center; color: #fff; font-size: 1.2rem; box-shadow: 0 8px 20px -6px rgba(139, 92, 246, .8); flex: none; }

/* ---------- shell */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--af-side-w); z-index: 1040; display: flex; flex-direction: column; color: #cbd5e1;
  background: radial-gradient(600px 300px at 0% 0%, rgba(99, 102, 241, .28), transparent 60%), radial-gradient(500px 300px at 100% 100%, rgba(236, 72, 153, .16), transparent 60%), #0b1022;
  border-right: 1px solid rgba(255, 255, 255, .06); transition: width .22s ease, transform .22s ease; }
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; }
.sidebar-head .brand-name { font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: -.02em; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-section { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #64708f; padding: 16px 12px 6px; white-space: nowrap; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: #aab4cf; font-weight: 600; font-size: .875rem; position: relative; white-space: nowrap; transition: background .15s, color .15s; }
.side-link i { font-size: 1.08rem; width: 22px; text-align: center; flex: none; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { color: #fff; background: linear-gradient(90deg, rgba(99, 102, 241, .95), rgba(139, 92, 246, .85)); box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .9); }
.side-link .badge { margin-left: auto; font-size: .66rem; border-radius: 99px; }
.side-link .ai-dot { margin-left: auto; font-size: .6rem; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; background: linear-gradient(135deg, #22d3ee, #a78bfa); color: #0b1022; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.side-user .name { color: #fff; font-weight: 700; font-size: .82rem; line-height: 1.1; }
.side-user .role { font-size: .7rem; color: #8894b3; text-transform: capitalize; }

.main { margin-left: var(--af-side-w); min-height: 100vh; transition: margin-left .22s ease; display: flex; flex-direction: column; }
body.side-mini { --af-side-w: 76px; }
body.side-mini .sidebar .brand-name, body.side-mini .nav-section, body.side-mini .side-link span, body.side-mini .side-link .badge, body.side-mini .side-link .ai-dot, body.side-mini .side-user > div:last-child { display: none; }
body.side-mini .side-link { justify-content: center; padding: 11px 0; }
body.side-mini .sidebar-head { justify-content: center; padding-inline: 0; }
body.side-mini .side-user { justify-content: center; background: none; }
.side-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); --af-side-w: 264px; width: 264px; }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 1035; }
  .main { margin-left: 0 !important; }
}

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--af-bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--af-border); }
.search-trigger { flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--af-border); background: var(--af-surface); color: var(--af-muted); cursor: text; font-size: .86rem; }
.search-trigger:hover { border-color: #a5b4fc; }
.search-trigger kbd { margin-left: auto; background: var(--af-surface-2); color: var(--af-muted); border: 1px solid var(--af-border); border-radius: 6px; font-size: .68rem; font-family: inherit; font-weight: 700; }
.content { padding: 24px 24px 96px; flex: 1; max-width: 1640px; width: 100%; margin: 0 auto; }
@media (max-width: 575.98px) { .search-trigger kbd { display: none; } .topbar { gap: 8px; } .hero .card-body { padding: 20px; } .ring { width: 104px; height: 104px; } .ring > div { width: 82px; height: 82px; } .ring b { font-size: 1.5rem; } .content { padding: 16px 12px 96px; } .topbar { padding: 10px 12px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.45rem; margin: 0; font-weight: 800; }
.page-head p { margin: 2px 0 0; color: var(--af-muted); font-size: .86rem; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards */
.card { border: 1px solid var(--af-border); border-radius: var(--af-radius); background: var(--af-surface); box-shadow: var(--af-shadow); }
.card-header { flex-wrap: wrap; background: transparent; border-bottom: 1px solid var(--af-border); padding: 16px 20px; display: flex; align-items: center; gap: 10px; }
.card-header h6 { margin: 0; font-size: .95rem; }
.card-header .sub { font-size: .76rem; color: var(--af-muted); font-weight: 500; }
.card-body { padding: 20px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .72rem; color: #fff; flex: none; background: var(--af-grad); }
.avatar.sm { width: 26px; height: 26px; font-size: .62rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1rem; }
.tile { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 1.1rem; flex: none; color: var(--c, var(--af-primary)); background: color-mix(in srgb, var(--c, var(--af-primary)) 14%, transparent); }
.tile.sm { width: 32px; height: 32px; border-radius: 10px; font-size: .95rem; }
.tile.solid { color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff)); box-shadow: 0 10px 20px -10px var(--c); }

.kpi { position: relative; overflow: hidden; padding: 18px; height: 100%; transition: transform .18s, box-shadow .18s; cursor: pointer; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--af-shadow-lg); }
.kpi::after { content: ""; position: absolute; width: 130px; height: 130px; right: -40px; top: -50px; border-radius: 50%; background: var(--c); opacity: .1; }
.kpi .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; font-weight: 700; color: var(--af-muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .value small { font-size: .8rem; font-weight: 700; color: var(--af-muted); letter-spacing: 0; margin-right: 3px; }
.kpi .value { white-space: nowrap; font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 10px; }
.kpi .hint { font-size: .76rem; color: var(--af-muted); margin-top: 2px; }
.trend-up { color: var(--af-green); font-weight: 700; }
.trend-down { color: var(--af-rose); font-weight: 700; }

.hero { position: relative; overflow: hidden; border: 0; color: #fff; border-radius: 22px;
  background: radial-gradient(700px 300px at 85% -20%, rgba(236, 72, 153, .75), transparent 60%), radial-gradient(500px 300px at 0% 120%, rgba(34, 211, 238, .55), transparent 60%), linear-gradient(120deg, #4338ca, #6d28d9 60%, #7e22ce); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent, #000 70%); }
.hero .card-body { position: relative; padding: 26px 28px; }
.hero .ai-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); }
.hero .btn-glass { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); color: #fff; backdrop-filter: blur(6px); }
.hero .btn-glass:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.hero .btn-white { background: #fff; color: #4338ca; border: 0; }
.ring { --p: 70; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: rgba(49, 46, 129, .88); display: grid; place-items: center; text-align: center; line-height: 1; }
.ring b { font-size: 2rem; font-weight: 800; display: block; }
.ring small { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }

/* ---------- tables */
.table { --bs-table-bg: transparent; margin: 0; font-size: .86rem; }
.table > thead th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--af-muted); background: var(--af-surface-2); border-bottom: 1px solid var(--af-border); padding: 11px 12px; white-space: nowrap; }
.table > tbody td { padding: 12px 12px; vertical-align: middle; border-color: var(--af-border); white-space: nowrap; }
.table > tbody td.wrap { white-space: normal; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: color-mix(in srgb, var(--af-primary) 5%, transparent); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--af-primary); }
.row-click { cursor: pointer; }
.cell-main { font-weight: 700; color: var(--af-text); line-height: 1.2; }
.cell-sub { font-size: .75rem; color: var(--af-muted); }
.table-card { overflow: hidden; }
.empty { text-align: center; padding: 48px 20px; color: var(--af-muted); }
.empty i { font-size: 2.4rem; display: block; margin-bottom: 10px; background: var(--af-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.pill.plain::before { display: none; }
.st-available { --c: #059669; } .st-assigned { --c: #4f46e5; } .st-maintenance { --c: #d97706; } .st-retired { --c: #64748b; } .st-lost { --c: #e11d48; }
.st-scheduled { --c: #0284c7; } .st-in_progress { --c: #d97706; } .st-completed { --c: #059669; } .st-cancelled { --c: #64748b; }
[data-bs-theme="dark"] .st-available, [data-bs-theme="dark"] .st-completed { --c: #34d399; }
[data-bs-theme="dark"] .st-assigned { --c: #a5b4fc; }
[data-bs-theme="dark"] .st-maintenance, [data-bs-theme="dark"] .st-in_progress { --c: #fbbf24; }
[data-bs-theme="dark"] .st-retired, [data-bs-theme="dark"] .st-cancelled { --c: #94a3b8; }
[data-bs-theme="dark"] .st-lost { --c: #fb7185; }
[data-bs-theme="dark"] .st-scheduled { --c: #38bdf8; }
.health { display: flex; align-items: center; gap: 8px; min-width: 84px; }
.table > :not(caption) > * > :first-child { padding-left: 18px; }
.table > :not(caption) > * > :last-child { padding-right: 18px; }
.health .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--af-surface-2); overflow: hidden; border: 1px solid var(--af-border); }
.health .bar span { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.health b { font-size: .78rem; width: 24px; text-align: right; }
.h-good { --c: #10b981; } .h-watch { --c: #f59e0b; } .h-replace { --c: #f43f5e; }
.sev-critical { --c: #f43f5e; } .sev-warning { --c: #f59e0b; } .sev-info { --c: #6366f1; } .sev-success { --c: #10b981; }

/* ---------- filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--af-border); }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 140px; padding-block: .42rem; }
.filter-bar .search { position: relative; flex: 1 1 220px; max-width: 320px; }
.filter-bar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--af-muted); }
.filter-bar .search input { padding-left: 34px; width: 100%; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--af-surface-2); border: 1px solid var(--af-border); gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 9px; font-size: .8rem; font-weight: 600; color: var(--af-muted); }
.seg button.active { background: var(--af-surface); color: var(--af-text); box-shadow: var(--af-shadow); }
.bulk-bar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--af-primary) 9%, var(--af-surface)); border-bottom: 1px solid var(--af-border); font-size: .85rem; font-weight: 600; }
.bulk-bar.show { display: flex; }

/* ---------- modals */
.modal-content { border: 1px solid var(--af-border); border-radius: 22px; background: var(--af-surface); box-shadow: var(--af-shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--af-border); padding: 18px 22px; }
.modal-title { font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--af-border); padding: 14px 22px; background: var(--af-surface-2); }
.modal-backdrop.show { opacity: .55; background: #0b1022; }
.modal.fade .modal-dialog { transform: translateY(18px) scale(.97); transition: transform .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.show .modal-dialog { transform: none; }
.confirm-icon { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; font-size: 1.9rem; margin: 0 auto 16px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); animation: pop .35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.ai-suggest { display: none; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--af-primary) 35%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--af-primary) 10%, transparent), color-mix(in srgb, var(--af-pink) 9%, transparent)); font-size: .82rem; }
.ai-suggest.show { display: flex; }
.rating { display: inline-flex; gap: 4px; }
.rating button { border: 0; background: none; padding: 0; font-size: 1.25rem; color: var(--af-border); line-height: 1; }
.rating button.on { color: #f59e0b; }

/* ---------- detail */
.nav-tabs { border-bottom: 1px solid var(--af-border); gap: 4px; padding: 0 22px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--af-muted); font-weight: 600; font-size: .86rem; padding: 12px 12px; }
.nav-tabs .nav-link.active { color: var(--af-primary); background: none; border-bottom-color: var(--af-primary); }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 20px; }
.dl dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--af-muted); }
.dl dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.stat-box { border: 1px solid var(--af-border); border-radius: 14px; padding: 12px 14px; background: var(--af-surface-2); }
.stat-box small { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--af-muted); display: block; }
.stat-box b { font-size: 1.1rem; font-weight: 800; }
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 44px; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--af-border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: .9rem; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.timeline .when { font-size: .73rem; color: var(--af-muted); }
.timeline .reverted { opacity: .55; }
.diff { margin-top: 6px; border: 1px solid var(--af-border); border-radius: 10px; overflow: hidden; font-size: .78rem; }
.diff div { display: grid; grid-template-columns: 110px 1fr 16px 1fr; gap: 8px; padding: 5px 10px; align-items: center; }
.diff div + div { border-top: 1px solid var(--af-border); }
.diff .f { color: var(--af-muted); font-weight: 600; }
.diff .old { color: #e11d48; text-decoration: line-through; word-break: break-word; }
.diff .new { color: #059669; font-weight: 600; word-break: break-word; }
.a-create { --c: #10b981; } .a-update { --c: #6366f1; } .a-delete { --c: #f43f5e; } .a-restore { --c: #06b6d4; } .a-checkout { --c: #8b5cf6; } .a-checkin { --c: #0ea5e9; } .a-undo_checkout, .a-undo_checkin { --c: #f59e0b; } .a-password { --c: #64748b; }
.qr-box { background: #fff; padding: 14px; border-radius: 16px; display: inline-block; border: 1px solid var(--af-border); }
.qr-box svg { display: block; }

/* ---------- lists */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--af-border); cursor: pointer; transition: background .12s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--af-surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight { display: flex; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--af-border); background: var(--af-surface); height: 100%; position: relative; overflow: hidden; }
.insight::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.insight h6 { font-size: .9rem; margin: 0 0 4px; }
.insight p { margin: 0; font-size: .8rem; color: var(--af-muted); }
.hbar { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; font-size: .8rem; padding: 6px 0; }
.hbar .track { height: 8px; border-radius: 99px; background: var(--af-surface-2); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--af-primary)); }
.ent-card { padding: 18px; height: 100%; transition: transform .16s, box-shadow .16s; }
.ent-card:hover { transform: translateY(-2px); box-shadow: var(--af-shadow-lg); }

/* ---------- AI assistant */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 1030; width: 58px; height: 58px; border-radius: 20px; border: 0; color: #fff; font-size: 1.45rem; background: var(--af-grad); box-shadow: 0 16px 34px -10px rgba(139, 92, 246, .9); display: grid; place-items: center; transition: transform .18s; }
.ai-fab:hover { transform: translateY(-3px) rotate(-6deg); }
.ai-fab::after { content: ""; position: absolute; inset: -5px; border-radius: 24px; border: 2px solid rgba(139, 92, 246, .5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.22); opacity: 0; } }
.offcanvas { background: var(--af-surface); border-color: var(--af-border) !important; }
.chat-head { background: var(--af-grad); color: #fff; padding: 18px 20px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--af-bg); }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: .86rem; line-height: 1.5; white-space: pre-line; animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.msg.user { align-self: flex-end; background: var(--af-grad); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--af-surface); border: 1px solid var(--af-border); border-bottom-left-radius: 6px; }
.msg .mini { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--af-border); margin-top: 6px; cursor: pointer; white-space: normal; background: var(--af-surface-2); }
.msg .mini:hover { border-color: var(--af-primary); }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--af-muted); margin-right: 3px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chip { border: 1px solid var(--af-border); background: var(--af-surface); color: var(--af-text); border-radius: 99px; padding: 5px 12px; font-size: .76rem; font-weight: 600; }
.chip:hover { border-color: var(--af-primary); color: var(--af-primary); }

/* ---------- command palette */
.palette .modal-content { border-radius: 18px; }
.palette input { border: 0; box-shadow: none !important; font-size: 1.02rem; padding: 18px 8px; background: transparent; }
.palette .results { max-height: 52vh; overflow-y: auto; border-top: 1px solid var(--af-border); padding: 8px; }
.palette .item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; cursor: pointer; }
.palette .item.sel, .palette .item:hover { background: color-mix(in srgb, var(--af-primary) 11%, transparent); }
.palette .grp { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--af-muted); padding: 10px 12px 4px; }

.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--af-surface-2) 25%, var(--af-border) 37%, var(--af-surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.fade-in { animation: rise .28s ease; }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-font-size: .8rem; --bs-pagination-color: var(--af-text); --bs-pagination-bg: var(--af-surface); --bs-pagination-border-color: var(--af-border); --bs-pagination-active-bg: var(--af-primary); --bs-pagination-active-border-color: var(--af-primary); gap: 4px; margin: 0; }
.pagination .page-link { border-radius: 10px !important; font-weight: 600; }
@media print { .sidebar, .topbar, .ai-fab, .actions, .filter-bar { display: none !important; } .main { margin: 0 !important; } }
