/*
 * Asset Tracker: the tool's own components, styled in the site's design language (6 Oct 2026, on the
 * UltraCompress Pro template). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme
 * toggle, focus rings) and /libs/shared-nav.css (the site's header and footer). This file holds only what the
 * tool itself needs: the section tabs and toolbar, the dashboard tiles, the asset list and detail page, the
 * calendar, the charts, the comparison, the settings, the windows, the quick tour, the bulk bar and the toasts.
 * Light is the default; dark applies when <html> has no data-theme. Every class and id the script touches
 * keeps its name, and the variable names the script writes into its markup (--accent-primary, --bg-secondary,
 * --text-muted ...) are aliases of the site's tokens below.
 */

/* ----- Tokens the tool adds, and the aliases the script's markup uses ----- */
:root {
    --surface: #ffffff;                 /* cards are true white in the light theme */
    --surface-2: #f3f4f8;               /* a quiet inset inside a card */
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --info: #0369a1;

    --bg-primary: var(--bg);
    --bg-secondary: var(--surface);
    --bg-tertiary: var(--surface-2);
    --bg-hover: rgba(139, 92, 246, 0.08);
    --text-muted: var(--text-3);
    --border-color: var(--surface-border);
    --border-light: rgba(0, 0, 0, 0.06);
    --accent-primary: var(--brand);
    --accent-primary-hover: #7C3AED;
    --accent-secondary: var(--brand-2);
    --accent-success: var(--success);
    --accent-warning: var(--warning);
    --accent-danger: var(--danger);
    --accent-info: var(--info);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);
    --bg-hover: rgba(139, 92, 246, 0.16);
    --info: #38bdf8;
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container {
    max-width: calc(var(--app-max) + 2 * var(--content-gutter));
    margin-top: 16px;
}
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }
body.modal-open { overflow: hidden; }

/* ----- Tools back link above the header, as on every other tool: the bar scrolls away under the sticky header ----- */
body { padding-top: 0; }
.back-bar { height: 48px; display: flex; align-items: center; padding: 0 var(--zdu-gutter, 24px); }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: calc(90px + var(--bar-offset, 48px)); }
@media (max-width: 768px) { .theme-toggle { top: calc(75px + var(--bar-offset, 48px)); } }

/* ----- Hero: brand row, headline, tagline ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-strong);
}
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline {
    color: var(--text-2);
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 44rem;
    margin: 0 auto;
}

/* ----- Buttons: the site's pills, in the tool's sizes ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    padding: 12px 24px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--surface);
    color: var(--text-strong);
    border: 1px solid var(--surface-border);
    padding: 11px 23px;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--danger-strong); color: #fff; box-shadow: 0 4px 15px rgba(185, 28, 28, 0.25); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(185, 28, 28, 0.35); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm { padding: 8px 15px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ----- The app: section tabs and the toolbar ----- */
.app-shell { margin: 0 0 3rem; }
.app-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0 8px;
    margin: 0 0 12px;
    -webkit-overflow-scrolling: touch;
}
.app-tabs::-webkit-scrollbar { display: none; }
.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: var(--chip);
    border: 1px solid var(--chip-border);
    color: var(--text-2);
    padding: 9px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.nav-item:hover { border-color: var(--brand); color: var(--link); }
.nav-item.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.nav-item-icon { font-size: 1rem; line-height: 1; }
.nav-item-badge {
    display: none;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 9999px;
    background: var(--danger-strong);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}
.nav-item.active .nav-item-badge { background: #fff; color: #b91c1c; }
.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin: 0 0 1.25rem;
}
.page-title { margin: 0; font-size: 1.5rem; }
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Page visibility */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ----- Cards: one surface for every box the tool draws ----- */
.stat-card, .dashboard-card, .asset-card, .calendar-container, .stats-chart-card, .settings-section, .comparison-card, .empty-state {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--surface-shadow);
}

/* ----- Dashboard: five tiles that fill their row ----- */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 14px;
}
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.12); }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.12); }
.stat-card-icon.orange { background: rgba(245, 158, 11, 0.14); }
.stat-card-icon.red { background: rgba(239, 68, 68, 0.12); }
.stat-card-icon.purple { background: rgba(139, 92, 246, 0.14); }
.stat-card-value {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.15;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}
.stat-card-label { font-size: 0.85rem; color: var(--text-3); }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.dashboard-card { overflow: hidden; }
.dashboard-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dashboard-card-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.dashboard-card-body { padding: 16px 20px; }

/* Recent assets */
.recent-asset-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}
.recent-asset-item:last-child { border-bottom: none; }
.recent-asset-image {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: var(--surface-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    overflow: hidden;
}
.recent-asset-image img { width: 100%; height: 100%; object-fit: cover; }
.recent-asset-info { flex: 1; min-width: 0; }
.recent-asset-name { font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-asset-category { font-size: 0.8rem; color: var(--text-3); }
.recent-asset-value { text-align: right; flex-shrink: 0; }
.recent-asset-current { font-weight: 700; color: var(--success); }
.recent-asset-original { font-size: 0.8rem; color: var(--text-3); text-decoration: line-through; }

/* Warranty alerts and upcoming expirations */
.warranty-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.warranty-alert-item:hover { background: var(--bg-hover); }
.warranty-alert-item:last-child { margin-bottom: 0; }
.warranty-alert-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.warranty-alert-icon.urgent { background: rgba(239, 68, 68, 0.14); }
.warranty-alert-icon.warning { background: rgba(245, 158, 11, 0.16); }
.warranty-alert-icon.info { background: rgba(59, 130, 246, 0.14); }
.warranty-alert-info { flex: 1; min-width: 0; }
.warranty-alert-name { font-weight: 600; color: var(--text-strong); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warranty-alert-date { font-size: 0.8rem; color: var(--text-3); }
.warranty-alert-days { flex-shrink: 0; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 9999px; color: #fff; }
.warranty-alert-days.urgent { background: #dc2626; }
.warranty-alert-days.warning { background: #d97706; }
.warranty-alert-days.info { background: #2563eb; }

/* ----- All assets: search, filters, cards ----- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 240px; max-width: 420px; position: relative; }
.search-input, .filter-select, .form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input::placeholder, .form-input::placeholder, .form-textarea::placeholder { color: var(--placeholder); }
.search-input:focus, .filter-select:focus, .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.search-input { padding-left: 40px; }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; pointer-events: none; }
.filter-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-select, .form-select {
    width: auto;
    padding-right: 36px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b93a1' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.form-select { width: 100%; }
.filter-select--full { width: 100%; }
.filter-select option, .form-select option { color: #0a0a14; background: #fff; }

.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.asset-card { overflow: hidden; cursor: pointer; position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.asset-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.asset-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--brand);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.asset-card:hover .asset-card-checkbox, .asset-card.selected .asset-card-checkbox, .asset-card-checkbox:focus-visible { opacity: 1; }
.asset-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--ring); }
.asset-card-image {
    height: 150px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    position: relative;
}
.asset-card-image img { width: 100%; height: 100%; object-fit: cover; }
.asset-card-category {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 10, 20, 0.7);
    color: #fff;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.asset-card-body { padding: 16px 18px 18px; }
.asset-card-title { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; }
.asset-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; }
.asset-card-meta-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--text-3); }
.asset-card-values { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.asset-card-value-item { text-align: center; min-width: 0; }
.asset-card-value-label { font-size: 0.7rem; color: var(--text-3); margin-bottom: 2px; }
.asset-card-value-amount { font-size: 0.95rem; font-weight: 700; overflow-wrap: anywhere; }
.asset-card-value-amount.original { color: var(--text-2); }
.asset-card-value-amount.current { color: var(--success); }
.asset-card-value-amount.depreciation { color: var(--danger); }
.asset-card-warranty { margin-top: 12px; padding: 7px 12px; border-radius: 9999px; font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.asset-card-warranty.active { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.asset-card-warranty.expiring { background: rgba(245, 158, 11, 0.14); color: var(--warning); }
.asset-card-warranty.expired { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Empty states */
.empty-state { text-align: center; padding: 56px 20px; box-shadow: none; }
.dashboard-card-body .empty-state { background: none; border: 0; }
.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state-title { margin: 0 0 8px; font-size: 1.25rem; }
.empty-state-text { color: var(--text-3); margin-bottom: 20px; }
.empty-state-text:last-child { margin-bottom: 0; }

/* ----- Asset detail ----- */
.detail-back { margin-bottom: 1.25rem; }
.asset-detail-header { display: flex; gap: 28px; margin-bottom: 28px; }
.asset-detail-image {
    width: 300px;
    height: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    overflow: hidden;
}
.asset-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.asset-detail-info { flex: 1; min-width: 0; }
.asset-detail-title { font-size: 1.85rem; text-align: left; margin: 0 0 8px; }
.asset-detail-category {
    display: inline-block;
    padding: 5px 14px;
    background: var(--chip);
    border: 1px solid var(--chip-border);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 20px;
}
.asset-detail-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.asset-detail-value-card { background: var(--surface); border: 1px solid var(--surface-border); padding: 16px; border-radius: 12px; text-align: center; }
.asset-detail-value-label { font-size: 0.8rem; color: var(--text-3); margin-bottom: 6px; }
.asset-detail-value-amount { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--text-strong); overflow-wrap: anywhere; }
.asset-detail-value-amount.green { color: var(--success); }
.asset-detail-value-amount.red { color: var(--danger); }
.asset-detail-value-amount.blue { color: var(--brand-3); }
.asset-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Tabs on the detail page */
.tabs { border-bottom: 1px solid var(--surface-border); margin-bottom: 20px; }
.tabs-nav { display: flex; gap: 4px; overflow-x: auto; }
.tab-btn {
    padding: 12px 18px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.tab-btn:hover { color: var(--text-strong); }
.tab-btn.active { color: var(--link); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--gradient-brand); border-radius: 2px 2px 0 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Information grid on the detail page (the script writes .info-grid there too, so the rule is scoped) */
#assetDetailContent .info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.info-item { padding: 14px 16px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 12px; }
.info-item-label { font-size: 0.8rem; color: var(--text-3); margin-bottom: 4px; }
.info-item-value { font-size: 1rem; font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }

/* Issue log */
.defects-list { margin-top: 16px; }
.defect-item { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 12px; margin-bottom: 12px; }
.defect-item:last-child { margin-bottom: 0; }
.defect-icon { width: 38px; height: 38px; flex-shrink: 0; background: rgba(239, 68, 68, 0.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.defect-content { flex: 1; min-width: 0; }
.defect-title { font-weight: 700; color: var(--text-strong); margin-bottom: 2px; }
.defect-date { font-size: 0.8rem; color: var(--text-3); margin-bottom: 6px; }
.defect-description { font-size: 0.9rem; color: var(--text-2); overflow-wrap: anywhere; }

/* Charts (the detail page's value curve and the statistics page) */
.chart-container { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); padding: 20px; }
.chart-container--flat { background: none; border: 0; padding: 0; }
.chart-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.chart-title { margin: 0; font-size: 1rem; font-weight: 700; }
.chart-legend { display: flex; gap: 16px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-2); }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-area { height: 250px; position: relative; }
.chart-svg { width: 100%; height: 100%; display: block; }
.chart-grid-line { stroke: var(--surface-border); stroke-width: 1; }
.chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area-fill { opacity: 0.12; }
.chart-point { fill: var(--surface); stroke-width: 3; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 10px; }
.chart-label { font-size: 0.75rem; color: var(--text-3); }

/* ----- Warranty calendar ----- */
.calendar-container { overflow: hidden; }
.calendar-header { padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.calendar-nav { display: flex; align-items: center; gap: 12px; }
.calendar-nav-btn {
    width: 36px;
    height: 36px;
    background: var(--chip);
    border: 1px solid var(--chip-border);
    border-radius: 50%;
    font-size: 1rem;
    color: var(--text-strong);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.calendar-nav-btn:hover { border-color: var(--brand); color: var(--link); }
.calendar-month-year { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-strong); min-width: 9.5rem; text-align: center; }
.calendar-grid { padding: 12px 16px 16px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.calendar-weekday { text-align: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 6px 0; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 10px;
    color: var(--text);
    transition: background 0.2s ease;
}
.calendar-day:hover { background: var(--bg-hover); }
.calendar-day.other-month { color: var(--text-3); opacity: 0.5; }
.calendar-day.today { background: var(--gradient-brand); color: #fff; }
.calendar-day-number { font-size: 0.9rem; font-weight: 500; }
.calendar-day-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 3px; }
.calendar-day-dot.expiring { background: #d97706; }
.calendar-day-dot.expired { background: #dc2626; }
.calendar-day.today .calendar-day-dot { background: #fff; }
.calendar-upcoming { margin-top: 20px; }

/* ----- Statistics ----- */
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.stats-chart-card { padding: 20px; }
.stats-chart-title { margin: 0 0 16px; font-size: 1.05rem; font-weight: 700; }
.pie-chart-container { display: flex; align-items: center; gap: 28px; }
.pie-chart { width: 180px; height: 180px; flex-shrink: 0; position: relative; }
.pie-chart svg { width: 100%; height: 100%; display: block; }
.pie-chart-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.pie-chart-center-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--text-strong); background: var(--surface); border-radius: 9999px; padding: 6px 14px; }
.pie-chart-center-label { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.pie-chart-legend { flex: 1; min-width: 0; }
.pie-legend-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.pie-legend-item:last-child { border-bottom: none; }
.pie-legend-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.pie-legend-label { flex: 1; font-size: 0.875rem; color: var(--text-2); }
.pie-legend-value { font-weight: 700; color: var(--text-strong); }
.bar-chart { height: 220px; display: flex; align-items: flex-end; justify-content: space-around; gap: 12px; padding-top: 20px; }
.bar-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.bar { width: 36px; max-width: 100%; border-radius: 8px 8px 0 0; transition: height 0.35s ease; }
.bar-label { margin-top: 8px; font-size: 0.72rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-value { font-size: 0.78rem; font-weight: 700; color: var(--text-strong); margin-bottom: 6px; white-space: nowrap; }

/* ----- Compare ----- */
.comparison-container { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: start; }
.comparison-card { padding: 20px; }
.comparison-select { margin-bottom: 20px; }
.comparison-asset-info { text-align: center; }
.comparison-asset-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 14px;
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    overflow: hidden;
}
.comparison-asset-image img { width: 100%; height: 100%; object-fit: cover; }
.comparison-asset-name { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-strong); margin-bottom: 6px; overflow-wrap: anywhere; }
.comparison-stats { margin-top: 20px; text-align: left; }
.comparison-stat-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.comparison-stat-item:last-child { border-bottom: none; }
.comparison-stat-label { color: var(--text-3); font-size: 0.875rem; }
.comparison-stat-value { font-weight: 700; color: var(--text-strong); text-align: right; overflow-wrap: anywhere; text-transform: capitalize; }
.comparison-vs { display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--text-3); padding-top: 150px; }

/* ----- Settings ----- */
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.settings-section-header { padding: 16px 20px; border-bottom: 1px solid var(--surface-border); }
.settings-section-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.settings-section-body { padding: 6px 20px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.setting-item:last-child { border-bottom: none; }
.setting-info { flex: 1; min-width: 0; }
.setting-label { display: block; font-weight: 600; color: var(--text-strong); margin-bottom: 2px; }
.setting-description { font-size: 0.8rem; color: var(--text-3); line-height: 1.5; }
.setting-item .filter-select { max-width: 100%; }
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
.toggle-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.toggle-slider { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--surface-border); border-radius: 28px; transition: background 0.2s ease, border-color 0.2s ease; }
.toggle-slider::before { content: ''; position: absolute; width: 22px; height: 22px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease; }
.toggle-switch input:checked + .toggle-slider { background: var(--gradient-brand); border-color: transparent; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows (add or edit, issue, delete) ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(12px);
    transition: transform 0.25s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal--narrow { max-width: 500px; }
.modal--small { max-width: 420px; }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { margin: 0; font-size: 1.15rem; }
.modal-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--chip-border);
    background: var(--chip);
    color: var(--text-strong);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.modal-close:hover { border-color: var(--brand); color: var(--link); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body--center { text-align: center; }
.modal-big-icon { font-size: 3.5rem; margin-bottom: 12px; }
.modal-text { color: var(--text-2); margin-bottom: 6px; }
.modal-strong { font-weight: 700; color: var(--text-strong); margin-bottom: 0; overflow-wrap: anywhere; }
.modal-muted { color: var(--text-3); font-size: 0.875rem; margin: 14px 0 0; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--surface-border); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.modal-footer--center { justify-content: center; }

/* Forms inside the windows */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-group { margin-bottom: 16px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-textarea { min-height: 96px; resize: vertical; }
.form-help { font-size: 0.78rem; color: var(--text-3); margin-top: 5px; }
.form-input[type="date"] { color-scheme: light; }
:root:not([data-theme="light"]) .form-input[type="date"] { color-scheme: dark; }

/* Photo picker: a small drop zone in the tool's look */
.image-upload {
    position: relative;
    border: 2px dashed rgba(139, 92, 246, 0.45);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.3s ease, background 0.3s ease;
}
.image-upload:hover, .image-upload:focus-within { border-color: var(--brand); background: var(--tint-brand); }
.image-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.image-upload-text { color: var(--text-strong); font-weight: 600; margin-bottom: 4px; }
.image-upload-hint { font-size: 0.8rem; color: var(--text-3); }
.image-upload input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.image-preview { margin-top: 14px; position: relative; display: inline-block; }
.image-preview img { max-width: 200px; max-height: 150px; border-radius: 12px; object-fit: cover; display: block; border: 1px solid var(--surface-border); }
.image-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    background: var(--danger-strong);
    border: 2px solid var(--surface);
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ----- Quick tour ----- */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.75);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.onboarding-overlay.active { opacity: 1; visibility: visible; }
.onboarding-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 480px;
    padding: 36px 28px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.onboarding-overlay.active .onboarding-card { transform: scale(1); }
.onboarding-icon { font-size: 3.5rem; margin-bottom: 16px; }
.onboarding-title { margin: 0 0 12px; font-size: 1.4rem; }
.onboarding-text { color: var(--text-2); margin-bottom: 24px; line-height: 1.7; }
.onboarding-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.onboarding-dot { width: 10px; height: 10px; border-radius: 9999px; background: var(--surface-border); cursor: pointer; transition: width 0.2s ease, background 0.2s ease; }
.onboarding-dot.active { background: var(--gradient-brand); width: 30px; }
.onboarding-actions { display: flex; justify-content: center; gap: 10px; }

/* ----- Bulk actions bar ----- */
.bulk-actions-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 9999px;
    padding: 10px 10px 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
    max-width: calc(100vw - 32px);
}
.bulk-actions-bar.active { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.bulk-actions-count { font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.bulk-actions-separator { width: 1px; height: 24px; background: var(--surface-border); }

/* ----- Toasts ----- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast {
    background: #0a0a14;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px 14px 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}
.toast.active { transform: translateX(0); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; margin-bottom: 1px; }
.toast-message { font-size: 0.8rem; color: #c7cad1; overflow-wrap: anywhere; }
.toast-close { background: none; border: none; color: #c7cad1; cursor: pointer; padding: 4px; font-size: 1.2rem; line-height: 1; }
.toast-close:hover { color: #fff; }

/* ----- Information sections below the tool ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section > p { max-width: 70ch; }
/* Three columns on desktops, two on tablets, one on phones: six cards fill two rows without a gap. */
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--surface-shadow);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-section article:not(.info-card) p { color: var(--text-2); max-width: 70ch; }
.step-card { position: relative; padding-top: 24px; }
.step-num {
    position: absolute;
    top: -16px;
    left: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary {
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-strong);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ----- Tablets ----- */
@media (max-width: 1023px) {
    .stats-grid { grid-template-columns: repeat(6, 1fr); }
    .stats-grid > .stat-card { grid-column: span 2; }
    .stats-grid > .stat-card:nth-child(4), .stats-grid > .stat-card:nth-child(5) { grid-column: span 3; }
    .dashboard-grid, .stats-row { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr 1fr; }
    .settings-grid > .settings-section:nth-child(3) { grid-column: span 2; }
    .comparison-container { grid-template-columns: 1fr; }
    .comparison-vs { padding: 4px 0; }
    .info-section .info-grid, .info-three { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .page-title { font-size: 1.25rem; }
    .app-actions { width: 100%; }
    .app-actions .btn { flex: 1 1 auto; padding-left: 12px; padding-right: 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stats-grid > .stat-card, .stats-grid > .stat-card:nth-child(4) { grid-column: auto; }
    .stats-grid > .stat-card:nth-child(5) { grid-column: span 2; }
    .stat-card { padding: 14px; }
    .stat-card-icon { width: 38px; height: 38px; font-size: 1.15rem; margin-bottom: 10px; }
    .stat-card-value { font-size: 1.35rem; }
    .dashboard-card-header, .dashboard-card-body, .stats-chart-card, .comparison-card, .calendar-header { padding-left: 16px; padding-right: 16px; }
    .settings-section-header, .settings-section-body { padding-left: 16px; padding-right: 16px; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid > .settings-section:nth-child(3) { grid-column: auto; }
    .setting-item { flex-wrap: wrap; }
    .setting-item .filter-select { width: 100%; }
    .list-toolbar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: none; }
    .filter-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-controls .filter-select { width: 100%; }
    .filter-controls .filter-select:nth-child(3) { grid-column: span 2; }
    .assets-grid { grid-template-columns: 1fr; }
    .asset-detail-header { flex-direction: column; gap: 16px; }
    .asset-detail-image { width: 100%; height: 200px; }
    .asset-detail-title { font-size: 1.5rem; }
    .asset-detail-values { grid-template-columns: 1fr; gap: 10px; }
    #assetDetailContent .info-grid { grid-template-columns: 1fr; }
    .pie-chart-container { flex-direction: column; }
    .bar-chart { gap: 6px; }
    .bar { width: 28px; }
    .form-grid { grid-template-columns: 1fr; }
    .modal-overlay { padding: 8px; }
    .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
    .onboarding-card { padding: 28px 20px; }
    .bulk-actions-bar { bottom: 16px; }
    .toast-container { bottom: 16px; right: 16px; left: 16px; align-items: flex-end; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .stat-card, .asset-card, .info-card, .modal, .onboarding-card, .toast, .bulk-actions-bar, .page.active { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026) */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 44px; }
}
