/* =====================================================================
   Prime Koders — dashboards: sidebar layout, stat cards, tables,
   status pills, progress bars, charts and bulk actions.
   ===================================================================== */

.dashboard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 24px; }
.sidebar {
    position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; scrollbar-width: thin;
}
.sidebar-user { display: flex; gap: 12px; align-items: center; padding: 4px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar-user strong { display: block; color: var(--text-strong); line-height: 1.3; margin-bottom: 4px; }
.sidebar-level { display: block; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); margin-bottom: 10px; color: var(--text); }
.sidebar-level span { font-weight: 800; color: var(--text-strong); }
.sidebar-level small { float: right; color: var(--muted); }
.sidebar-heading { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtle); padding: 12px 12px 4px; }
.sidebar-nav { display: grid; gap: 1px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 0.92rem; transition: background 0.15s, color 0.15s, transform 0.15s; }
.sidebar-nav a i { width: 18px; text-align: center; }
.sidebar-nav a:hover { color: var(--text-strong); background: var(--hover); transform: translateX(2px); }
.sidebar-nav a.active { color: var(--text-strong); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.dash-content { min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; font-size: 1.6rem; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
.dash-section { margin-bottom: 24px; }
.dash-section > h2, .dash-section .card-head h2 { font-size: 1.08rem; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
    display: flex; gap: 14px; align-items: center; transition: transform 0.25s var(--spring), border-color 0.2s; position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--accent-line); }
a.stat-card { color: var(--text); }
.stat-icon { width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.14); color: var(--cyan-text); }
.stat-icon.green { background: rgba(34, 197, 94, 0.14); color: var(--green-text); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.14); color: var(--amber-text); }
.stat-icon.red { background: rgba(239, 68, 68, 0.14); color: var(--red-text); }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-strong); line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 0.8rem; }
.stat-trend { font-size: 0.75rem; font-weight: 700; margin-left: 6px; }
.stat-trend.up { color: var(--green-text); }
.stat-trend.down { color: var(--red-text); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--accent-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; color: var(--text-strong); border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table .nowrap { white-space: nowrap; }
.table .check-col { width: 36px; }
.table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.sort-link { color: inherit; display: inline-flex; gap: 6px; align-items: center; }
.sort-link i { opacity: 0.45; }
.sort-link.active { color: var(--text-strong); }
.sort-link.active i { opacity: 1; color: var(--accent); }
.thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.table-person { display: flex; align-items: center; gap: 10px; color: var(--text); }
.table-person strong { color: var(--text-strong); }
.row-highlight { background: var(--accent-soft); }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bulk-bar { display: none; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); animation: slide-down 0.25s var(--ease); }
.bulk-bar.show { display: flex; }

/* Status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.pill-amber { background: rgba(245, 158, 11, 0.14); color: var(--amber-text); border-color: rgba(245, 158, 11, 0.35); }
.pill-green { background: rgba(34, 197, 94, 0.14); color: var(--green-text); border-color: rgba(34, 197, 94, 0.35); }
.pill-red { background: rgba(239, 68, 68, 0.14); color: var(--red-text); border-color: rgba(239, 68, 68, 0.35); }
.pill-indigo { background: var(--accent-soft); color: var(--indigo-text); border-color: var(--accent-line); }
.pill-grey { background: var(--hover); color: var(--muted); border-color: var(--border-strong); }

/* Progress bars (<progress> element) */
progress.progress {
    -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px;
    background: var(--border); overflow: hidden; display: block; margin: 10px 0 6px;
}
progress.progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--gradient); border-radius: 999px; transition: width 0.8s var(--ease); }
progress.progress::-moz-progress-bar { background: var(--gradient); border-radius: 999px; }
progress.progress-lg { height: 14px; }
progress.progress-sm { height: 6px; margin: 4px 0; min-width: 80px; }
progress.progress-green::-webkit-progress-value { background: linear-gradient(90deg, #22c55e, #10b981); }
progress.progress-green::-moz-progress-bar { background: linear-gradient(90deg, #22c55e, #10b981); }
.progress-meta { font-size: 0.86rem; display: flex; gap: 6px; align-items: baseline; }
.progress-meta .pct { margin-left: auto; color: var(--green-text); }

/* Tabs and filter bars */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text-strong); }
.tabs a.active { color: var(--text-strong); border-bottom-color: var(--accent); }
.tabs .tab-count { font-size: 0.72rem; color: var(--muted); margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--hover); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-group { margin: 0; min-width: 140px; flex: 1; }
.filter-bar .btn { height: 44px; }

/* Lists */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list .list-main { flex: 1; min-width: 200px; }
.list .list-main strong { color: var(--text-strong); }

/* Notifications page */
.notification-item { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); align-items: flex-start; }
.notification-item:hover { background: var(--hover); color: var(--text-strong); }
.notification-item.unread { background: var(--accent-soft); }
.notification-item.unread .notification-dot { background: var(--accent); }
.notification-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 8px; flex-shrink: 0; background: transparent; }
.notification-item p { margin: 0; }
.notification-item .stat-icon { width: 38px; height: 38px; font-size: 0.95rem; }

/* Charts */
.chart-box { position: relative; width: 100%; }
.chart-h-sm { height: 190px; }
.chart-h-md { height: 260px; }
.chart-h-lg { height: 340px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-top: 8px; }
.chart-card .card-head select { width: auto; padding: 6px 10px; }

/* Settings page */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 2px; }
.settings-nav a { padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.settings-nav a.active, .settings-nav a:hover { background: var(--accent-soft); color: var(--text-strong); }
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-preset { position: relative; margin: 0; cursor: pointer; }
.theme-preset input { position: absolute; opacity: 0; }
.theme-preset-body { display: block; border-radius: var(--radius-sm); border: 2px solid var(--border-strong); overflow: hidden; transition: transform 0.2s var(--spring), border-color 0.2s; }
.theme-preset:hover .theme-preset-body { transform: translateY(-3px); }
.theme-preset input:checked + .theme-preset-body { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25); }
.preset-swatch { height: 64px; display: flex; }
.preset-swatch span { flex: 1; }
.preset-name { display: block; padding: 8px 10px; font-weight: 700; font-size: 0.86rem; color: var(--text-strong); }
.mode-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mode-card { height: 84px; border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; }
.mode-card span { height: 8px; border-radius: 4px; }
.mode-card.dark { background: #0b0f19; } .mode-card.dark span { background: #1e293b; } .mode-card.dark span:first-child { width: 50%; background: #6366f1; }
.mode-card.light { background: #f4f6fb; border: 1px solid #e2e8f0; } .mode-card.light span { background: #e2e8f0; } .mode-card.light span:first-child { width: 50%; background: #6366f1; }
.mode-card.system { background: linear-gradient(90deg, #0b0f19 50%, #f4f6fb 50%); border: 1px solid #e2e8f0; }
.secret-field { font-family: ui-monospace, monospace; }

/* Media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.media-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); transition: transform 0.2s var(--spring); }
.media-tile:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.media-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-soft); }
.media-tile div { padding: 8px 10px; font-size: 0.8rem; }
.media-tile strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-strong); }
.media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; }
.media-pick label { margin: 0; cursor: pointer; position: relative; }
.media-pick input { position: absolute; opacity: 0; }
.media-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 2px solid transparent; }
.media-pick input:checked + img { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.3); }

/* Kanban-like list rows for rewards/milestones */
.row-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 10px; flex-wrap: wrap; }
.row-card .grow { flex: 1; min-width: 200px; }
.reward-card { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 16px; transition: border-color 0.2s, transform 0.2s var(--spring); cursor: pointer; position: relative; display: block; margin: 0; }
.reward-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.reward-card input { position: absolute; opacity: 0; }
.reward-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.reward-card .reward-amount { font-weight: 800; color: var(--text-strong); font-size: 1.1rem; }
.reward-card.sold-out { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 1024px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: flex; overflow-x: auto; gap: 6px; }
    .settings-nav a { white-space: nowrap; }
}
@media (max-width: 900px) {
    .dashboard { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
    .sidebar { position: static; padding: 8px; min-width: 0; max-height: none; }
    .sidebar-user, .sidebar-heading, .sidebar-level { display: none; }
    .sidebar-nav { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: thin; }
    .sidebar-nav a { white-space: nowrap; padding: 8px 12px; flex-shrink: 0; }
    .sidebar-nav a.active { box-shadow: none; }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
    .stat-value { font-size: 1.1rem; }
}

/* Account settings */
.settings-summary { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.settings-summary .progress { max-width: 320px; }
.settings-checks { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-checks span { padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid var(--border); background: var(--hover); color: var(--muted); }
.settings-checks span.ok { color: var(--green-text); border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.12); }
.settings-checks span.todo { color: var(--amber-text); border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.1); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting-row:last-child { border-bottom: 0; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; min-width: 0; }
.input-action .btn { flex-shrink: 0; }
.provider-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--hover); color: var(--text-strong); border: 1px solid var(--border); }
.provider-google { color: #ea4335; }
.xp-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: rgba(255, 255, 255, 0.22); }
.goal-option { margin: 0; cursor: pointer; position: relative; }
.goal-option input { position: absolute; opacity: 0; }
.goal-option > span { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 16px 10px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface-2); transition: transform 0.2s var(--spring), border-color 0.2s; }
.goal-option > span i { font-size: 1.4rem; color: var(--accent); }
.goal-option > span small { color: var(--muted); }
.goal-option:hover > span { transform: translateY(-3px); }
.goal-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
.goal-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.small { font-size: 0.82rem; }
@media (max-width: 560px) { .input-action { flex-direction: column; } }

/* Notification centre */
.list-heading { margin: 18px 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtle); }
.p-0 { padding: 0 !important; overflow: hidden; }
.ml-auto { margin-left: auto; }
.notification-row { display: flex; align-items: center; padding-left: 14px; border-bottom: 1px solid var(--border); transition: background 0.2s; }
.notification-row:last-child { border-bottom: 0; }
.notification-row .notification-item { flex: 1; border-bottom: 0; align-items: center; }
.notification-row.unread { background: var(--accent-soft); }
.notification-row.unread .notification-dot { background: var(--accent); }
.notification-row .notification-dot { margin-top: 0; }
.stat-icon.violet { background: rgba(139, 92, 246, 0.14); color: #8b5cf6; }
.stat-icon.red { background: rgba(239, 68, 68, 0.14); color: var(--red-text); }
tr.selected td, .notification-row.selected { background: rgba(var(--accent-rgb), 0.12); }

/* Dashboard top row: progress + quests */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; align-items: start; }
.dash-top > :only-child { grid-column: 1 / -1; }
.dash-top .quest-list { max-height: 260px; overflow-y: auto; }
.wave { display: inline-block; animation: wave 1.8s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.dash-section { margin-bottom: 24px; }
@media (max-width: 1024px) { .dash-top { grid-template-columns: 1fr; } }

/* Toolbars above data tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; margin-bottom: 14px; }
.toolbar .input-icon { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 130px; }
.toolbar .toolbar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.summary-strip a, .summary-strip span { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--hover); border: 1px solid var(--border); font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.summary-strip a.active, .summary-strip a:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text-strong); }
.summary-strip strong { color: var(--text-strong); }
.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); color: var(--text); transition: background 0.2s; }
.feed-item:hover { background: var(--hover); color: var(--text-strong); }
.feed-item .stat-icon { width: 38px; height: 38px; font-size: 0.95rem; }
@media (max-width: 640px) { .toolbar select { flex: 1; } .toolbar .toolbar-end { margin-left: 0; width: 100%; } }

/* Project manage page */
.thumb.thumb-lg { width: 96px; height: 60px; border-radius: 10px; }
.timeline .timeline-item { position: relative; padding: 0 0 22px 38px; }
.timeline .timeline-item::before { content: ''; position: absolute; left: 4px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline .timeline-item:first-child::before { background: var(--accent); }
.qa-manage { margin-bottom: 12px; border-left: 3px solid transparent; }
.qa-manage.needs-answer { border-left-color: var(--amber); }
.qa-manage.is-hidden { opacity: 0.6; }
.qa-manage textarea { min-height: 44px; }
.rating-bar-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; gap: 10px; align-items: center; font-size: 0.86rem; margin-bottom: 6px; }
.rating-bar-row progress { margin: 0; }
.review.clickable { cursor: pointer; border-radius: var(--radius-sm); padding: 10px; margin: 0 -10px; transition: background 0.2s; }
.review.clickable:hover { background: var(--hover); }
.review-manage { margin-bottom: 12px; border-left: 3px solid transparent; }
.review-manage.needs-answer { border-left-color: var(--amber); }
.rating-big { display: grid; justify-items: center; gap: 4px; margin-bottom: 14px; }
.rating-big strong { font-size: 3rem; line-height: 1; color: var(--text-strong); }
a.rating-bar-row { color: var(--text); border-radius: 8px; padding: 2px 4px; }
a.rating-bar-row:hover { background: var(--hover); }
.delta { display: inline-flex; gap: 3px; align-items: center; font-size: 0.72rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.delta.up { color: var(--green-text); background: rgba(34, 197, 94, 0.12); }
.delta.down { color: var(--red-text); background: rgba(239, 68, 68, 0.12); }
.attention-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.attention-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.attention-list a:hover { background: var(--hover); color: var(--text-strong); }
.attention-list a i { width: 18px; color: var(--muted); }
.attention-list .pill { margin-left: auto; }
.waiting-item { display: block; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border-strong); margin-top: 6px; color: var(--text); }
.waiting-item:hover { border-color: var(--accent-line); }

/* Campaign manage */
.row-editor { margin-bottom: 10px; padding: 14px 16px; }
.row-editor summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.row-editor summary::-webkit-details-marker { display: none; }
.row-editor[open] summary .fa-pen { color: var(--accent); }
.row-editor .reward-amount { font-weight: 800; color: var(--green-text); }
.faq-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.faq-row:last-child { border-bottom: 0; }
.comment-manage { margin-bottom: 12px; }
.comment-manage.is-hidden { opacity: 0.55; }
.list li.clickable { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.list li.clickable:hover { background: var(--hover); }
.reward-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.amount-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.amount-quick .chip { cursor: pointer; font-family: inherit; }
.amount-quick .chip:hover { background: var(--accent); color: #fff; }

/* Admin tool tiles */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tool-tile { display: grid; gap: 4px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: transform 0.2s var(--spring), border-color 0.2s; }
.tool-tile:hover { transform: translateY(-3px); border-color: var(--accent-line); color: var(--text-strong); }
.tool-tile i { font-size: 1.3rem; color: var(--accent); margin-bottom: 4px; }
.tool-tile strong { color: var(--text-strong); }
.tool-tile small { color: var(--muted); font-size: 0.78rem; }
.funnel { display: grid; gap: 14px; margin-top: 8px; }
.funnel-step { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; gap: 4px 12px; align-items: center; }
.funnel-step progress { margin: 0; }
.funnel-step strong { text-align: right; color: var(--text-strong); }
.funnel-step small { grid-column: 2 / -1; }
@media (max-width: 640px) { .funnel-step { grid-template-columns: 1fr 70px; } .funnel-step progress { grid-column: 1 / -1; grid-row: 2; } }
.rank-num { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 800; background: var(--hover); color: var(--muted); flex-shrink: 0; }
.trust-icons i { margin-right: 4px; } .fade-in { animation: slide-down 0.25s var(--ease); }
.profile-admin { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.profile-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; max-width: 420px; justify-content: flex-end; }
.profile-admin-actions select { width: auto; padding: 6px 10px; }
@media (max-width: 760px) { .profile-admin-actions { justify-content: flex-start; max-width: none; } }
.check-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: 0.88rem; }
.check-list li.ok i { color: var(--green-text); }
.check-list li.todo { color: var(--amber-text); }
.chips .chip[data-fill-target] { cursor: pointer; font-family: inherit; text-align: left; }
.toolbar .input-sm, .toolbar input[type="date"] { width: auto; max-width: 160px; }
.input-sm { max-width: 150px; } .input-xs { max-width: 80px; }
.dropzone { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border: 2px dashed var(--accent-line); background: var(--accent-soft); }
.dropzone > i { font-size: 2rem; color: var(--accent); }
.dropzone .form-group { min-width: 220px; }
details.media-tile summary { list-style: none; cursor: pointer; }
details.media-tile summary::-webkit-details-marker { display: none; }
details.media-tile summary div span { display: block; font-size: 0.74rem; }
details.media-tile[open] { grid-row: span 2; border-color: var(--accent); }
.media-edit-form { display: grid; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.media-edit-form label { font-size: 0.76rem; margin: 0; display: grid; gap: 4px; }
.media-edit-form input { padding: 6px 8px; font-size: 0.82rem; }
details.media-tile > form:last-child { padding: 0 10px 10px; }
.banner-row { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 8px; flex-wrap: wrap; }
.banner-row img, .banner-noimg { width: 120px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.banner-noimg { display: grid; place-items: center; background: var(--hover); color: var(--subtle); }
.banner-row .grow { flex: 1; min-width: 180px; }
.banner-row.is-off { opacity: 0.6; }
.sticky-card { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
.media-pick .media-none { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; border: 2px dashed var(--border-strong); font-size: 0.75rem; color: var(--muted); }
.media-pick input:checked + .media-none { border-color: var(--accent); color: var(--text-strong); }
@media (max-width: 1024px) { .sticky-card { position: static; max-height: none; } }
.announce-preview { padding: 10px 14px; border-radius: 10px; color: #fff; font-size: 0.88rem; font-weight: 600; }
.announce-preview.announce-promo { background: var(--gradient); }
.announce-preview .muted { color: rgba(255, 255, 255, 0.7); }
.faq-row.is-off { opacity: 0.55; }

/* Settings page */
.settings-form h2 { font-size: 1.1rem; }
.preset-swatch { position: relative; }
.preset-swatch.preset-dark { background: #0b0f19; }
.preset-swatch.preset-light { background: #f4f6fb; }
.preset-swatch.preset-system { background: linear-gradient(90deg, #0b0f19 50%, #f4f6fb 50%); }
.preset-swatch .sw { flex: 1; margin: 14px 4px; border-radius: 8px; }
.preset-swatch .sw-mode-dark, .preset-swatch .sw-mode-light, .preset-swatch .sw-mode-system { flex: 0.6; }
.sw-mode-dark { background: #1e293b; } .sw-mode-light { background: #e2e8f0; } .sw-mode-system { background: linear-gradient(90deg, #1e293b 50%, #e2e8f0 50%); }
.sw-green-1 { background: #14a800; } .sw-green-2 { background: #0d7a3e; }
.sw-indigo-1 { background: #6366f1; } .sw-indigo-2 { background: #06b6d4; }
.sw-emerald-1 { background: #10b981; } .sw-emerald-2 { background: #06b6d4; }
.sw-rose-1 { background: #f43f5e; } .sw-rose-2 { background: #f97316; }
.sw-violet-1 { background: #8b5cf6; } .sw-violet-2 { background: #ec4899; }
.sw-amber-1 { background: #f59e0b; } .sw-amber-2 { background: #ef4444; }
.sw-ocean-1 { background: #3b82f6; } .sw-ocean-2 { background: #14b8a6; }
.accent-row { display: flex; gap: 8px; }
.accent-dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); }
.section-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 12px; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.setup-steps { padding-left: 18px; }
.copy-box { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 0.8rem; word-break: break-all; cursor: pointer; }
.copy-box:hover { border-color: var(--accent); }

/* SVG charts (assets/js/charts.js) */
.nx-chart { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
.nx-svg { display: block; overflow: visible; }
.nx-axis-label, .nx-value-label { font-size: 11px; font-family: var(--font); }
.nx-value-label { font-weight: 700; }
.nx-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: flex-end; font-size: 0.78rem; color: var(--muted); padding-bottom: 8px; }
.nx-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.nx-legend-item strong { color: var(--text-strong); font-weight: 700; margin-left: 2px; }
.nx-sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.nx-donut-side { flex-direction: row; align-items: center; gap: 18px; }
.nx-donut-side .nx-legend { flex-direction: column; justify-content: center; flex: 1; gap: 8px; padding: 0; }
.nx-chart:not(.nx-donut-side) .nx-donut { margin: 0 auto 8px; }
.nx-chart:not(.nx-donut-side):has(.nx-donut) { flex-direction: column-reverse; }
.nx-chart:not(.nx-donut-side):has(.nx-donut) .nx-legend { justify-content: center; }
.nx-donut-total { font-size: 18px; font-weight: 800; fill: var(--text-strong); font-family: var(--font); }
.nx-empty { margin: auto; color: var(--muted); font-size: 0.86rem; }
.nx-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 0.8rem; opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; }
.nx-tip.show { opacity: 1; transform: none; }
.nx-tip-title { font-weight: 700; color: var(--text-strong); margin-bottom: 6px; }
.nx-tip-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.nx-tip-row + .nx-tip-row { margin-top: 4px; }
.nx-tip-label { flex: 1; }
.nx-tip-row strong { color: var(--text-strong); }
.nx-cross, .nx-dot { opacity: 0; transition: opacity 0.12s; }
.nx-cross.show, .nx-dot.show { opacity: 1; }
.nx-bar { transition: opacity 0.15s; }
.nx-bar.dim { opacity: 0.45; }
.nx-bar.hover { opacity: 0.85; }
.nx-arc { transition: transform 0.2s var(--spring), opacity 0.2s; transform-box: fill-box; transform-origin: center; cursor: pointer; }
.nx-arc:hover { transform: scale(1.04); }
.nx-bar.grow-y { transform-box: fill-box; transform-origin: bottom; animation: nx-grow-y 0.7s var(--ease) both; }
.nx-bar.grow-x { transform-box: fill-box; transform-origin: left; animation: nx-grow-x 0.7s var(--ease) both; }
.nx-line.draw { animation: nx-draw 1.1s var(--ease) forwards; }
.nx-fade { animation: fade-in 0.8s var(--ease) both; }
.nx-arc.pop { animation: pop-in 0.5s var(--spring) both; }
@keyframes nx-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes nx-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes nx-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .nx-bar, .nx-line, .nx-fade, .nx-arc { animation: none !important; } }
.table-person > img, .table-person .thumb, .table-person .avatar, .person > img { flex-shrink: 0; max-width: none; }
.table th.text-right, .table td.text-right { text-align: right; }
.table-person > div { min-width: 90px; }

/* Settings: currency checkboxes and the exchange-rate editor */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin-top: 6px; }
.check-grid .check { display: flex; align-items: baseline; gap: 6px; margin: 0; font-weight: 400; }
.check-grid .check small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rates-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.rates-grid label { display: flex; align-items: center; gap: 8px; margin: 0; }
.rates-grid label span { width: 40px; flex-shrink: 0; font-weight: 700; font-size: 0.82rem; color: var(--muted); }
.rates-grid input { min-width: 0; padding: 6px 8px; font-variant-numeric: tabular-nums; }
