/* ==========================================================================
   Techno Help Assets — styled after technohelp.co.uk
   Tokens below are taken from the website's own :root variables.
   ========================================================================== */

:root {
    --th-night: #0b1220;
    --th-night-2: #111a2e;
    --th-ink: #0f172a;
    --th-ink-2: #1e293b;
    --th-muted: #526077;
    --th-line: #e3e8f0;
    --th-soft: #f5f7fb;
    --th-white: #ffffff;
    --th-brand: #1d4ed8;
    --th-brand-600: #2563eb;
    --th-brand-50: #eef3ff;
    --th-brand-100: #dce6ff;
    --th-accent: #5b8cf8;
    --th-ok: #059669;
    --th-radius: 16px;
    --th-radius-sm: 10px;
    --th-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --th-shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 24px 48px rgba(15, 23, 42, .10);
    --th-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --th-font-head: "Plus Jakarta Sans", var(--th-font);

    /* Bootstrap overrides */
    --bs-body-font-family: var(--th-font);
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--th-ink);
    --bs-body-bg: var(--th-soft);
    --bs-secondary-color: var(--th-muted);
    --bs-primary: var(--th-brand);
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: var(--th-brand-600);
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: var(--th-brand);
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-border-color: var(--th-line);
    --bs-border-radius: var(--th-radius-sm);
    --bs-border-radius-lg: var(--th-radius);
    --bs-focus-ring-color: rgba(37, 99, 235, .25);
}

/* Softer surfaces: cards and tables use a very light grey-blue instead of pure white. */
:root {
    --th-surface: #fafbfd;        /* cards */
    --th-surface-head: #f2f5fa;   /* table headers */
    --th-surface-hover: #eef3fc;  /* table row hover */
}

body {
    background: var(--th-night);
    color: var(--th-ink);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* The Techno Help circuit-board image behind every page at ~70% strength over Techno Help navy
   (the login page has its own full-strength version). Fixed, so it stays put while the content scrolls.
   Cards, tables and forms stay solid and light on top of it, so the information itself reads as before. */
:root { --th-bg-strength-wash: .30; }   /* 0 = the image at full strength, 1 = plain navy */
body:not(.auth-body)::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        linear-gradient(rgba(11, 18, 32, var(--th-bg-strength-wash)), rgba(11, 18, 32, var(--th-bg-strength-wash))),
        url("../img/th-background.jpg") 30% center / cover no-repeat,
        var(--th-night);
}

/* Text that sits directly on the background (page headings, their labels and intro lines, the footer)
   is light, with a soft shadow so it stays readable over the brighter parts of the image. */
.th-main h1, .th-main > p,
.page-header .lead-text, .page-header .text-secondary, .page-header .text-muted, .page-header .small,
.th-footer {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .75), 0 0 14px rgba(0, 0, 0, .5);
}
.th-main .page-header .lead-text, .th-main .page-header .small, body .th-footer { color: rgba(255, 255, 255, .88); }
/* Bootstrap's .text-secondary/.text-muted use !important, so the heading-area override has to as well. */
.th-main .page-header .text-secondary, .th-main .page-header .text-muted { color: rgba(255, 255, 255, .88) !important; }
.page-header .eyebrow, .page-header .eyebrow a { color: #9cbcff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.page-header .lead-text a, .page-header .text-secondary a { color: #b9d0ff; }
.th-main > form > .btn-link { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .75); }

/* A soft navy fade behind the heading area only, so headings stay readable even over the bright
   circuit lines, while the rest of the background stays vivid. */
.th-main .page-header { position: relative; z-index: 0; }
.th-main .page-header::before {
    content: ""; position: absolute; z-index: -1; inset: -.9rem -.75rem; border-radius: 18px; pointer-events: none;   /* stays inside the page gutter */
    background: linear-gradient(90deg, rgba(11, 18, 32, .72) 0%, rgba(11, 18, 32, .55) 55%, rgba(11, 18, 32, 0) 100%);
}
.th-main .page-header .eyebrow, .th-main .page-header .eyebrow a { color: #c3d5ff; }
.th-main .page-header .count-pill, .th-main h1 .count-pill { text-shadow: none; }
.th-main h1 .asset-tag { color: inherit; }

h1, h2, h3, h4, .th-heading {
    font-family: var(--th-font-head);
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--th-ink);
}

a { text-underline-offset: 2px; }

/* ---------- Header ---------------------------------------------------- */

/* Banner: the Techno Help circuit-board image under a navy tint so the menu stays readable. */
.th-header {
    background:
        linear-gradient(90deg, rgba(11, 18, 32, .82) 0%, rgba(11, 18, 32, .70) 45%, rgba(11, 18, 32, .82) 100%),
        url("../img/th-background.jpg") center 42% / cover no-repeat,
        var(--th-night);
    border-bottom: 1px solid rgba(91, 140, 248, .35);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.th-logo { width: 38px; height: 38px; filter: drop-shadow(0 2px 8px rgba(37, 99, 235, .55)); }
.th-header .navbar { padding-top: .7rem; padding-bottom: .7rem; }

.th-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--th-font-head); }
.th-mark {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--th-brand-600), var(--th-accent));
    color: #fff; font-weight: 800; font-size: .85rem; letter-spacing: .02em;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .45);
}
.th-wordmark { font-weight: 800; font-size: 1.1rem; color: #fff; }
.th-product {
    font-family: var(--th-font); font-size: .72rem; font-weight: 600;
    color: var(--th-accent); background: rgba(76, 130, 247, .14);
    padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em;
}

.th-nav { gap: .15rem; margin-left: 1.25rem; }
.th-nav .nav-link {
    color: rgba(255, 255, 255, .72); font-weight: 500; font-size: .92rem;
    padding: .45rem .85rem !important; border-radius: 999px;
    transition: background-color .15s, color .15s;
}
.th-nav .nav-link { white-space: nowrap; }
.th-nav .nav-link i { opacity: .8; margin-right: .2rem; }
/* Medium screens: drop the menu icons and narrow the search so everything fits on one line. */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .th-nav { margin-left: .5rem; }
    .th-nav .nav-link i { display: none; }
    .th-search input { min-width: 0; width: 200px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .th-nav .nav-link { padding: .45rem .6rem !important; }
    .th-search input { width: 150px; }
    .th-product { display: none; }
}
.th-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.th-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, .1); }

.th-search {
    position: relative; display: flex; align-items: center;
    margin-top: .5rem;
}
@media (min-width: 992px) { .th-search { margin-top: 0; } }
.th-search i { position: absolute; left: .9rem; color: rgba(255, 255, 255, .5); font-size: .85rem; }
.th-search input {
    width: 100%; min-width: 260px;
    background: rgba(255, 255, 255, .06); color: #fff;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
    padding: .45rem 1rem .45rem 2.3rem; font-size: .88rem;
    transition: border-color .15s, background-color .15s;
}
.th-search input::placeholder { color: rgba(255, 255, 255, .5); }
.th-search input:focus { outline: none; border-color: var(--th-accent); background: rgba(255, 255, 255, .1); }

.th-user { margin-left: .75rem; margin-top: .5rem; }
@media (min-width: 992px) { .th-user { margin-top: 0; } }
.th-user-button {
    display: flex; align-items: center; gap: .5rem; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06); color: #fff; border-radius: 999px; padding: .25rem .7rem .25rem .25rem; font-size: .88rem;
}
.th-user-button:hover, .th-user-button:focus-visible { background: rgba(255, 255, 255, .12); outline: none; }
.th-avatar {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--th-brand-600), var(--th-accent)); font-weight: 700; font-size: .8rem;
}
/* Desktop: just the initial in the bar (the name is in the menu); phones show the full name in the open menu. */
@media (min-width: 992px) {
    .th-user-name { display: none; }
    .th-user-button { padding-right: .45rem; }
}
.th-user .dropdown-menu { border: 1px solid var(--th-line); border-radius: 12px; box-shadow: var(--th-shadow-lg); padding: .35rem; }
.th-user .dropdown-item { border-radius: 8px; font-size: .9rem; }
.th-user .dropdown-item .bi { margin-right: .35rem; color: var(--th-muted); }

/* ---------- Sign-in page ---------------------------------------------- */

/* The circuit-board image fills the page under an even navy tint; the sign-in card sits in the centre. */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at center, rgba(11, 18, 32, .55) 0%, rgba(11, 18, 32, .35) 60%, rgba(11, 18, 32, .55) 100%),
        url("../img/th-background.jpg") 30% center / cover no-repeat,
        var(--th-night);
}
.auth-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-footer { text-align: center; }
.auth-card {
    width: 100%; max-width: 420px; border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .55), 0 0 0 1px rgba(91, 140, 248, .15);
}
.auth-brand { display: flex; align-items: center; gap: .9rem; }
.auth-logo { width: 72px; height: 72px; filter: drop-shadow(0 6px 16px rgba(37, 99, 235, .35)); }
.auth-brand .th-wordmark { color: var(--th-ink); font-family: var(--th-font-head); font-size: 1.45rem; line-height: 1.1; margin-bottom: .25rem; }
.auth-brand .th-product { background: var(--th-brand-50); color: var(--th-brand); }
.auth-alt { margin: 1.25rem 0 0; text-align: center; font-size: .85rem; color: var(--th-muted); }
.auth-alt .btn-link { font-size: inherit; }
.pin-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.6rem; letter-spacing: .4em; text-align: center; padding-block: .6rem; }
.auth-footer { color: rgba(255, 255, 255, .7); font-size: .8rem; margin-top: 1.5rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.who { color: var(--th-muted); font-size: .75rem; }

/* ---------- Layout ---------------------------------------------------- */

.th-main { padding-top: 2rem; padding-bottom: 3rem; flex: 1; }
.th-footer { color: var(--th-muted); font-size: .8rem; padding-bottom: 1.5rem; }

.page-header {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.75rem; margin: 0; }
.page-header .lead-text { color: var(--th-muted); margin: .25rem 0 0; }
.eyebrow {
    display: block; color: var(--th-brand); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em; margin-bottom: .35rem;
}
.count-pill {
    display: inline-block; vertical-align: middle; margin-left: .4rem;
    font-family: var(--th-font); font-size: .8rem; font-weight: 600;
    color: var(--th-muted); background: #fff; border: 1px solid var(--th-line);
    padding: .1rem .6rem; border-radius: 999px;
}

/* ---------- Cards ----------------------------------------------------- */

.card {
    border: 1px solid var(--th-line);
    border-radius: var(--th-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 12px 32px rgba(0, 0, 0, .22);   /* lifts cards off the dark background */
    background: var(--th-surface);
}
.card-header {
    background: transparent; border-bottom: 1px solid var(--th-line);
    padding: 1rem 1.25rem; font-family: var(--th-font-head); font-weight: 700; font-size: 1rem;
}
.card-header:first-child { border-radius: var(--th-radius) var(--th-radius) 0 0; }
.card-body { padding: 1.25rem; }
.card > .table-responsive:last-child, .card > .list-group:last-child { border-radius: 0 0 var(--th-radius) var(--th-radius); }
.card > .table-responsive:first-child { border-radius: var(--th-radius); }

.stat-card { padding: 1.1rem 1.25rem; transition: box-shadow .15s, transform .15s; }
a.stat-card:hover { box-shadow: var(--th-shadow-lg); transform: translateY(-1px); }
.stat-card .stat-label { color: var(--th-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.stat-card .stat-value { font-family: var(--th-font-head); font-size: 2rem; font-weight: 800; line-height: 1.15; margin-top: .25rem; color: var(--th-ink); }
.stat-card .stat-icon {
    float: right; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: var(--th-brand-50); color: var(--th-brand-600);
}

/* ---------- Buttons --------------------------------------------------- */

.btn { border-radius: 999px; font-weight: 600; padding: .5rem 1.1rem; font-size: .9rem; }
.btn-sm { padding: .3rem .8rem; font-size: .8rem; }
.btn-primary {
    --bs-btn-bg: var(--th-brand); --bs-btn-border-color: var(--th-brand);
    --bs-btn-hover-bg: var(--th-brand-600); --bs-btn-hover-border-color: var(--th-brand-600);
    --bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: var(--th-brand); --bs-btn-disabled-border-color: var(--th-brand);
    box-shadow: 0 4px 14px rgba(29, 78, 216, .25);
}
.btn-light, .btn-outline-secondary {
    --bs-btn-color: var(--th-ink-2); --bs-btn-bg: #fff; --bs-btn-border-color: var(--th-line);
    --bs-btn-hover-color: var(--th-ink); --bs-btn-hover-bg: var(--th-soft); --bs-btn-hover-border-color: #cfd8e6;
    --bs-btn-active-color: var(--th-ink); --bs-btn-active-bg: var(--th-brand-50); --bs-btn-active-border-color: var(--th-brand-100);
}
.btn-outline-primary {
    --bs-btn-color: var(--th-brand); --bs-btn-border-color: var(--th-brand-100); --bs-btn-bg: #fff;
    --bs-btn-hover-color: var(--th-brand); --bs-btn-hover-bg: var(--th-brand-50); --bs-btn-hover-border-color: var(--th-brand-100);
}
.btn-danger { --bs-btn-bg: #dc2626; --bs-btn-border-color: #dc2626; --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; }
.btn-outline-danger { --bs-btn-color: #b91c1c; --bs-btn-border-color: #fecaca; --bs-btn-bg: #fff; --bs-btn-hover-bg: #fef2f2; --bs-btn-hover-color: #b91c1c; --bs-btn-hover-border-color: #fca5a5; }
.btn-success { --bs-btn-bg: var(--th-ok); --bs-btn-border-color: var(--th-ok); --bs-btn-hover-bg: #047857; --bs-btn-hover-border-color: #047857; }
.btn-warning { --bs-btn-color: #78350f; --bs-btn-bg: #fde68a; --bs-btn-border-color: #fde68a; --bs-btn-hover-bg: #fcd34d; --bs-btn-hover-border-color: #fcd34d; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }

/* ---------- Forms ----------------------------------------------------- */

.form-label { font-weight: 600; font-size: .85rem; color: var(--th-ink-2); margin-bottom: .35rem; }
.form-control, .form-select {
    border-color: var(--th-line); border-radius: var(--th-radius-sm);
    padding: .55rem .8rem; font-size: .92rem;
}
.form-control:focus, .form-select:focus { border-color: var(--th-brand-600); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.form-text { color: var(--th-muted); }

.filter-bar { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.filter-bar .form-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--th-muted); }

/* ---------- Tables ---------------------------------------------------- */

.table { margin-bottom: 0; --bs-table-bg: var(--th-surface); --bs-table-hover-bg: var(--th-surface-hover); }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--th-line); }
.table thead th {
    background: var(--th-surface-head); color: var(--th-muted); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table td, .table th { vertical-align: middle; }
.cell-sub { display: block; color: var(--th-muted); font-size: .8rem; margin-top: .1rem; }
.cell-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; }

.asset-tag {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600;
    white-space: nowrap; text-decoration: none;
}
a.asset-tag:hover { text-decoration: underline; }

.empty-state { text-align: center; color: var(--th-muted); padding: 2.5rem 1rem; }
.empty-state i { font-size: 1.75rem; display: block; margin-bottom: .5rem; color: #9aa6ba; }

/* ---------- Status pills ---------------------------------------------- */

.status-pill {
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
    font-size: .75rem; font-weight: 600; padding: .22rem .65rem; border-radius: 999px;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-instock    { color: #047857; background: #ecfdf5; }
.status-checkedout { color: var(--th-brand); background: var(--th-brand-50); }
.status-inrepair   { color: #b45309; background: #fffbeb; }
.status-lost       { color: #b91c1c; background: #fef2f2; }
.status-retired    { color: #475569; background: #f1f5f9; }

.warn-pill { font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; margin-left: .3rem; }
.warn-soon    { color: #b45309; background: #fffbeb; }
.warn-expired { color: #b91c1c; background: #fef2f2; }
.warn-ok      { color: #047857; background: #ecfdf5; }

/* ---------- Tags ------------------------------------------------------ */

.tag-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag-chip {
    display: inline-flex; align-items: center; gap: .25rem; max-width: 100%;
    font-size: .75rem; font-weight: 600; line-height: 1.2;
    color: var(--th-brand); background: var(--th-brand-50); border: 1px solid var(--th-brand-100);
    padding: .2rem .55rem; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
a.tag-chip:hover { background: var(--th-brand-100); color: var(--th-brand); }
.tag-chip .bi { font-size: .7rem; }
.tag-more { font-size: .75rem; color: var(--th-muted); font-weight: 600; align-self: center; }

/* ---------- Notes button (end of each asset row) ---------------------- */

.btn-note {
    --bs-btn-color: var(--th-ink-2); --bs-btn-bg: #fff; --bs-btn-border-color: var(--th-line);
    --bs-btn-hover-color: var(--th-brand); --bs-btn-hover-bg: var(--th-brand-50); --bs-btn-hover-border-color: var(--th-brand-100);
    --bs-btn-active-color: var(--th-brand); --bs-btn-active-bg: var(--th-brand-100); --bs-btn-active-border-color: var(--th-brand-100);
    display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
}
.btn-note .note-count {
    min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; font-size: .7rem; line-height: 1.3rem;
    background: var(--th-soft); color: var(--th-muted); text-align: center;
}
.btn-note.has-notes .note-count { background: var(--th-brand); color: #fff; }
.col-actions { width: 1%; text-align: right; }
/* Keep the Notes button in view when a wide table scrolls sideways. */
.table td.col-actions, .table th.col-actions {
    position: sticky; right: 0; z-index: 1;
    background: var(--th-surface); box-shadow: -10px 0 12px -10px rgba(15, 23, 42, .15);
}
.table thead th.col-actions { background: var(--th-surface-head); }
.table-hover > tbody > tr:hover > td.col-actions { background: var(--th-surface-hover); }
.assets-table > :not(caption) > * > * { padding-left: .75rem; padding-right: .75rem; }

/* ---------- Notes side panel ------------------------------------------ */

.notes-panel { --bs-offcanvas-width: 480px; border-left: 1px solid var(--th-line) !important; box-shadow: -24px 0 48px rgba(15, 23, 42, .12); }
.notes-panel .offcanvas-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--th-line); align-items: flex-start; }
.notes-panel .offcanvas-title { font-size: 1.3rem; margin: 0; }
.notes-panel .panel-sub { color: var(--th-muted); font-size: .88rem; margin-top: .15rem; }
.notes-panel .offcanvas-body { padding: 1.25rem 1.5rem; }
.notes-panel .offcanvas-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--th-line); background: #fff;
    display: flex; justify-content: flex-end; align-items: center; gap: .5rem;
}
.panel-section + .panel-section { margin-top: 1.5rem; }
.panel-section-title { font-family: var(--th-font-head); font-weight: 700; font-size: .95rem; margin-bottom: .5rem; display: flex; justify-content: space-between; align-items: center; }

.tag-input {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
    min-height: 44px; padding: .4rem .5rem; background: #fff; cursor: text;
    border: 1px solid var(--th-line); border-radius: var(--th-radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
.tag-input:focus-within { border-color: var(--th-brand-600); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.tag-input input { flex: 1; min-width: 120px; border: 0; outline: 0; padding: .2rem .25rem; font-size: .92rem; background: transparent; }
.tag-input .tag-chip { font-size: .8rem; padding: .25rem .35rem .25rem .6rem; }
.tag-chip .tag-remove {
    border: 0; background: transparent; color: inherit; opacity: .6; padding: 0 .15rem; line-height: 1; font-size: .95rem;
    border-radius: 50%;
}
.tag-chip .tag-remove:hover, .tag-chip .tag-remove:focus-visible { opacity: 1; background: var(--th-brand-100); outline: none; }

.tag-suggestions {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10;
    list-style: none; margin: 0; padding: .35rem; max-height: 260px; overflow-y: auto;
    background: #fff; border: 1px solid var(--th-line); border-radius: 12px; box-shadow: var(--th-shadow-lg);
}
.tag-suggestions li {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .5rem .65rem; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.tag-suggestions li.active, .tag-suggestions li:hover { background: var(--th-brand-50); color: var(--th-brand); }
.tag-suggestions li mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }
.tag-suggestions .sugg-count { color: var(--th-muted); font-size: .75rem; }
.tag-suggestions .sugg-create { color: var(--th-brand); font-weight: 600; }
.tag-suggestions .sugg-empty { color: var(--th-muted); cursor: default; }
.tag-suggestions .sugg-empty:hover { background: transparent; color: var(--th-muted); }

.note-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--th-muted); margin-top: .35rem; }
.note-history { list-style: none; padding: 0; margin: 0; }
.note-history li {
    padding: .85rem 1rem; border: 1px solid var(--th-line); border-radius: 12px; background: var(--th-soft);
}
.note-history li + li { margin-top: .6rem; }
.note-history .note-when { font-size: .75rem; color: var(--th-muted); font-weight: 600; margin-bottom: .25rem; }
.note-history .note-text { white-space: pre-line; font-size: .9rem; color: var(--th-ink-2); overflow-wrap: anywhere; }
.note-history li.is-new { border-color: var(--th-brand-100); background: var(--th-brand-50); }

.panel-saved { color: var(--th-ok); font-weight: 600; font-size: .85rem; margin-right: auto; opacity: 0; transition: opacity .2s; }
.panel-saved.show { opacity: 1; }

/* ---------- Pictures -------------------------------------------------- */

.col-picture { width: 1%; padding-right: 0 !important; }
.asset-thumb {
    width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; overflow: hidden;
    background: var(--th-soft); border: 1px solid var(--th-line); color: #b3bdcc; text-decoration: none;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.asset-thumb.is-damage { border: 2px solid #dc2626; }
a.asset-thumb:hover { border-color: var(--th-brand-100); color: var(--th-brand-600); }

.photo-drop {
    display: grid; place-items: center; min-height: 150px; cursor: pointer; text-align: center; overflow: hidden;
    border: 2px dashed #cfd8e6; border-radius: 12px; background: var(--th-soft); color: var(--th-muted);
    transition: border-color .15s, background-color .15s;
}
.photo-drop:hover, .photo-drop.is-over, .photo-upload input[type=file]:focus-visible + .photo-drop { border-color: var(--th-brand-600); background: var(--th-brand-50); }
.photo-drop-text { display: grid; gap: .2rem; padding: 1rem; font-size: .82rem; }
.photo-drop-text .bi { font-size: 1.6rem; color: var(--th-brand-600); }
.photo-drop-text strong { color: var(--th-ink-2); font-size: .92rem; }
.photo-preview { max-width: 100%; max-height: 220px; object-fit: contain; }
.photo-drop [hidden] { display: none !important; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.photo-thumb {
    position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: zoom-in;
    border: 1px solid var(--th-line); border-radius: 12px; background: #fff;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.photo-thumb:hover, .photo-thumb:focus-visible { border-color: var(--th-brand-600); outline: none; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.photo-kind {
    position: absolute; left: 6px; bottom: 6px; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: .12rem .4rem; border-radius: 999px; background: rgba(15, 23, 42, .72); color: #fff;
}
.photo-kind-damage { background: #dc2626; }
.photo-kind-product { background: rgba(29, 78, 216, .85); }
.photo-full { max-width: 100%; max-height: 70vh; object-fit: contain; display: block; margin: 0 auto; }

.document-list .list-group-item { padding-block: .75rem; }
.document-icon { font-size: 1.6rem; line-height: 1; color: var(--th-brand); }
.document-icon.bi-file-earmark-pdf { color: #c62828; }
.document-icon.bi-file-earmark-word { color: #1d4ed8; }
.document-icon.bi-file-earmark-excel { color: #15803d; }
.document-kind {
    font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: .12rem .45rem; border-radius: 999px; background: var(--th-brand-50); color: var(--th-brand);
}
.min-w-0 { min-width: 0; }

/* ---------- Details page --------------------------------------------- */

dl.asset-fields { margin: 0; }
dl.asset-fields dt { color: var(--th-muted); font-weight: 500; font-size: .85rem; }
dl.asset-fields dd { margin-bottom: .75rem; font-weight: 500; }

.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--th-line); padding: 0 0 1rem 1.1rem; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -6px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--th-brand-600); box-shadow: 0 0 0 3px var(--th-brand-50);
}

/* ---------- Dashboard: collapsible cards & donut charts --------------- */

.dash-card-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    cursor: pointer; user-select: none;
}
.dash-title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.dash-title .bi { color: var(--th-brand-600); }
.collapse-toggle {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    border: 1px solid var(--th-line); background: #fff; color: var(--th-ink-2);
    transition: background-color .15s, border-color .15s;
}
.collapse-toggle:hover, .collapse-toggle:focus-visible { background: var(--th-brand-50); border-color: var(--th-brand-100); color: var(--th-brand); outline: none; }
.collapse-toggle .bi { transition: transform .2s; }
.dash-card.is-collapsed .collapse-toggle .bi { transform: rotate(180deg); }
.dash-card.is-collapsed .dash-card-header { border-bottom: 0; border-radius: var(--th-radius); }
.dash-card.is-collapsed { height: auto !important; }

.donut-layout { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.donut { width: 180px; flex-shrink: 0; margin: 0 auto; }
.donut svg { display: block; width: 100%; height: auto; overflow: visible; }
.donut-slice { stroke: #fff; stroke-width: 2; stroke-linejoin: round; cursor: pointer; transition: opacity .15s, transform .15s; transform-origin: 100px 100px; }
.donut-slice:hover { transform: scale(1.03); }
.donut-slice.is-dim { opacity: .3; }
.donut-value { font-family: var(--th-font-head); font-weight: 800; font-size: 30px; fill: var(--th-ink); text-anchor: middle; }
.donut-label { font-size: 11px; fill: var(--th-muted); text-anchor: middle; }

.chart-legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 200px; display: grid; gap: .2rem; }
.legend-item {
    width: 100%; display: grid; grid-template-columns: 12px 1fr auto 3rem; align-items: center; gap: .55rem;
    border: 1px solid transparent; background: transparent; border-radius: 10px;
    padding: .4rem .55rem; text-align: left; font-size: .86rem; color: var(--th-ink-2);
}
.legend-item:hover, .legend-item:focus-visible { background: var(--th-soft); outline: none; }
.legend-item[aria-pressed="true"] { background: var(--th-brand-50); border-color: var(--th-brand-100); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend-label { font-weight: 500; }
.legend-count { font-weight: 700; color: var(--th-ink); font-variant-numeric: tabular-nums; }
.legend-pct { color: var(--th-muted); font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums; }
.chart-hint { color: var(--th-muted); font-size: .78rem; margin: .9rem 0 0; }

.slice-detail { margin-top: 1rem; border: 1px solid var(--th-line); border-radius: 12px; overflow: hidden; }
.slice-detail-head {
    display: flex; align-items: center; gap: .6rem; padding: .65rem .85rem;
    background: var(--th-soft); border-bottom: 1px solid var(--th-line); font-size: .88rem;
}
.slice-key { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.slice-list { list-style: none; margin: 0; padding: 0; max-height: 290px; overflow-y: auto; }
.slice-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: .75rem; row-gap: .1rem; padding: .5rem .85rem; border-bottom: 1px solid var(--th-line); font-size: .85rem; }
.slice-list li:last-child { border-bottom: 0; }
.slice-item-main { display: flex; gap: .5rem; min-width: 0; flex: 1 1 14rem; }
.slice-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slice-item-meta { color: var(--th-muted); font-size: .78rem; white-space: nowrap; }

.chart-tooltip {
    position: fixed; z-index: 1080; pointer-events: none;
    display: grid; gap: .1rem; padding: .5rem .7rem; border-radius: 10px;
    background: var(--th-night); color: rgba(255, 255, 255, .8); font-size: .8rem; box-shadow: var(--th-shadow-lg);
}
.chart-tooltip strong { color: #fff; font-size: .95rem; }
.chart-tooltip em { font-style: normal; color: var(--th-accent); font-size: .72rem; }
.chart-tooltip[hidden] { display: none; }

/* ---------- Settings -------------------------------------------------- */

.settings-nav .nav-link {
    color: var(--th-ink-2); font-weight: 600; border-radius: var(--th-radius-sm); padding: .6rem .85rem;
    display: flex; align-items: center; gap: .55rem;
}
.settings-nav .nav-link:hover { background: var(--th-soft); }
.settings-nav .nav-link.active { background: var(--th-brand-50); color: var(--th-brand); }
.rename-form { display: flex; gap: .4rem; align-items: center; }
.rename-form .form-control { max-width: 280px; padding: .35rem .65rem; }

/* ---------- Alerts / modals ------------------------------------------ */

.th-alert { border-radius: 12px; border: 1px solid; display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.th-alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.th-alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.modal-content { border: 0; border-radius: var(--th-radius); box-shadow: var(--th-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--th-line); }
.danger-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: #fef2f2; color: #dc2626; font-size: 1.2rem;
}

.list-group-item { border-color: var(--th-line); padding: .75rem 1.25rem; }

/* ---------- Reports --------------------------------------------------- */

.report-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: .75rem;
    border-radius: 12px; background: var(--th-brand-50); color: var(--th-brand); font-size: 1.3rem;
}
.report-counts { display: flex; flex-wrap: wrap; gap: .5rem; }
.report-count { padding: .25rem .65rem; border-radius: 999px; background: var(--th-brand-50); color: var(--th-ink); font-size: .85rem; }
.report-count strong { color: var(--th-brand); }
.report-totals-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--th-muted); margin-bottom: .35rem; }
.report-totals .table td { padding: .2rem .25rem; font-size: .85rem; }
.report-table td, .report-table th { font-size: .85rem; }

/* Printing or "Save as PDF": just the report, on white, without the background, menus or buttons. */
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    body, body.th-body { background: #fff !important; color: #000 !important; }
    body::before, .th-header, .th-footer, .no-print, .toast-container, .alert { display: none !important; }
    .th-main { padding: 0 !important; }
    .th-main .page-header, .th-main .page-header h1, .th-main .page-header .lead-text, .th-main .page-header .eyebrow,
    .th-main .page-header a, .th-main .page-header span { color: #000 !important; text-shadow: none !important; }
    .th-main .page-header::before { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #cbd5e1 !important; break-inside: auto; }
    .report-section { break-before: auto; }
    .report-table tr { break-inside: avoid; }
    .table-responsive { overflow: visible !important; }
    a { color: #000 !important; text-decoration: none !important; }
    tr[hidden] { display: table-row !important; }   /* print every asset, whatever filter is on screen */
}
