/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; background: var(--bg); }
body { margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
    --brand: #1a1a2e;
    --brand-dark: #0f0f1c;
    --accent: #e84393;
    --accent-hover: #c4306e;
    --accent-light: #fce7f3;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --text-muted: #6b7280;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --navbar-h: 52px;
}

:root[data-theme="dark"] {
    --brand: #0f172a;
    --brand-dark: #0b1220;
    --accent: #f472b6;
    --accent-hover: #ec4899;
    --accent-light: #4a1d3a;
    --bg: #0b1220;
    --card-bg: #111827;
    --border: #2b3648;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
    --shadow-md: 0 10px 30px rgba(0,0,0,.45);
}

body {
    background: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }

/* ── Navbar ── */
.app-navbar {
    background: var(--brand);
    height: var(--navbar-h);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.app-navbar .container-fluid { padding: 0; }
.navbar-brand {
    font-weight: 700;
    font-size: 18px;
    color: #fff !important;
    text-decoration: none;
    letter-spacing: -0.3px;
}
.navbar-brand .accent { color: var(--accent); }

/* Collapse toggle */
.navbar-toggler {
    border: 1px solid rgba(255,255,255,.3);
    padding: 4px 8px;
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile menu */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--brand-dark);
        position: absolute;
        top: var(--navbar-h);
        left: 0; right: 0;
        padding: .75rem 1rem 1rem;
        border-top: 1px solid rgba(255,255,255,.08);
        box-shadow: 0 8px 20px rgba(0,0,0,.3);
    }
    .navbar-nav.mx-auto { margin: 0 !important; }
}

/* Nav links */
.navbar-nav .nav-link {
    color: rgba(255,255,255,.82) !important;
    font-size: 14px;
    font-weight: 500;
    padding: .38rem .75rem;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background .15s, color .15s;
}
.navbar-nav .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.1); }
.navbar-nav .nav-link.active { color: #fff !important; background: rgba(255,255,255,.14); }
.navbar-nav .nav-link .material-icons-outlined { font-size: 17px; line-height: 1; }

.theme-toggle {
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.08);
}

.theme-toggle:hover {
    background: rgba(255,255,255,.16);
}

/* Dropdowns in navbar */
.app-navbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 13.5px;
    min-width: 190px;
    padding: .4rem;
}
.app-navbar .dropdown-item {
    border-radius: 6px;
    padding: .45rem .9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background .12s;
}
.app-navbar .dropdown-item .material-icons-outlined { font-size: 17px; color: var(--text-muted); }
.app-navbar .dropdown-item:hover { background: #e5e7eb; color: var(--text); }
.app-navbar .dropdown-item.active,
.app-navbar .dropdown-item:active { background: #e0e2e6; color: var(--text); font-weight: 600; }
.app-navbar .dropdown-item.text-danger .material-icons-outlined { color: #dc3545; }
.app-navbar .dropdown-item.profile-dropdown-link {
    display: block;
    text-decoration: none;
    gap: 0;
}

/* Admin pill */
.btn-admin {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.9) !important;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: .28rem .7rem;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: background .15s;
}
.btn-admin:hover { background: rgba(255,255,255,.18); }
.btn-admin .material-icons-outlined { font-size: 15px; }

/* ── Layout ── */
.page-wrapper { padding: 1.5rem 1.25rem; }
@media (min-width: 768px) { .page-wrapper { padding: 2rem 2rem; } }
@media (max-width: 575px) { .page-wrapper { padding: 1rem; } }

/* ── Dark Theme Bootstrap Overrides ── */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .modal-content,
:root[data-theme="dark"] .dropdown-menu {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

:root[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: rgba(148, 163, 184, 0.08);
    --bs-table-hover-color: var(--text);
}

:root[data-theme="dark"] .table-invoices th {
    background: #0f172a;
    color: #94a3b8;
}

:root[data-theme="dark"] .table-invoices tbody tr:hover {
    background: rgba(148, 163, 184, .08);
}

:root[data-theme="dark"] .invoice-link {
    color: #f9a8d4 !important;
}

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
    background-color: #0f172a;
    color: var(--text);
    border-color: var(--border);
}

:root[data-theme="dark"] .accordion-item {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}
:root[data-theme="dark"] .accordion-button {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: none;
}
:root[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
}
:root[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}
:root[data-theme="dark"] .accordion-body {
    background: var(--card-bg);
    color: var(--muted);
}

:root[data-theme="dark"] .form-control:focus,
:root[data-theme="dark"] .form-select:focus {
    background-color: #0f172a;
    color: var(--text);
    border-color: #7c3aed;
    box-shadow: 0 0 0 .2rem rgba(124, 58, 237, .25);
}

:root[data-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}

:root[data-theme="dark"] .form-label {
    color: #cbd5e1;
}

:root[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}

:root[data-theme="dark"] .btn-outline-secondary:hover {
    color: #e2e8f0;
    background: #1e293b;
    border-color: #64748b;
}

:root[data-theme="dark"] .pagination .page-link {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #475569;
}

:root[data-theme="dark"] .pagination .page-link:hover {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #64748b;
}

:root[data-theme="dark"] .pagination .page-link:focus {
    box-shadow: 0 0 0 .15rem rgba(148, 163, 184, .2);
}

:root[data-theme="dark"] .pagination .page-item.active .page-link {
    background: #1e293b;
    color: #f8fafc;
    border-color: #64748b;
}

:root[data-theme="dark"] .pagination .page-item.disabled .page-link {
    background: #111827;
    color: #64748b;
    border-color: #334155;
}

:root[data-theme="dark"] .dropdown-item {
    color: var(--text);
}

:root[data-theme="dark"] .dropdown-item .material-icons-outlined {
    color: var(--text-muted);
}

:root[data-theme="dark"] .dropdown-item.active,
:root[data-theme="dark"] .dropdown-item:active,
:root[data-theme="dark"] .dropdown-item:hover {
    background: #1f2937;
    color: var(--text);
}

:root[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

:root[data-theme="dark"] .alert-info {
    background: #1e3a8a;
    color: #dbeafe;
}

:root[data-theme="dark"] .alert-success {
    background: #064e3b;
    color: #d1fae5;
}

:root[data-theme="dark"] .alert-warning {
    background: #78350f;
    color: #fef3c7;
}

:root[data-theme="dark"] .alert-danger {
    background: #7f1d1d;
    color: #fee2e2;
}

:root[data-theme="dark"] .toast-close:hover {
    background: #1f2937;
    color: var(--text);
}

:root[data-theme="dark"] .modal-content {
    background: var(--card-bg) !important;
    color: var(--text) !important;
}

:root[data-theme="dark"] .modal-content .alert-info {
    background: #1e3a8a !important;
    color: #dbeafe !important;
}

/* Danger card dark mode now handled by .card-danger / .card-header-danger classes */

/* Table totals bar dark mode now handled by .table-totals-bar class */

/* Icon muted dark mode now handled by .icon-muted-sm class */

/* Stat icon & badge dark modes now handled by .stat-icon-gray/.badge-show-payments-* classes */

:root[data-theme="dark"] #terminals-content code,
:root[data-theme="dark"] .table code,
:root[data-theme="dark"] .list-group-item code {
    color: #cbd5e1 !important;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 1px 4px;
}

:root[data-theme="dark"] .list-group-item {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

:root[data-theme="dark"] .list-group-item .text-muted,
:root[data-theme="dark"] #terminals-content .text-muted {
    color: #94a3b8 !important;
}

/* Stat icon/value/amount dark modes now handled by .stat-icon-*/stat-value-*/amount-* classes */

:root[data-theme="dark"] .badge-created {
    background: #1f2937;
    color: #cbd5e1;
    border-color: #374151;
}

:root[data-theme="dark"] .badge-processing,
:root[data-theme="dark"] .badge-info {
    background: #1e3a8a;
    color: #dbeafe;
}

:root[data-theme="dark"] .badge-success {
    background: #064e3b;
    color: #d1fae5;
}

:root[data-theme="dark"] .badge-failure,
:root[data-theme="dark"] .badge-expired {
    background: #7f1d1d;
    color: #fee2e2;
}

:root[data-theme="dark"] .badge-reversed {
    background: #78350f;
    color: #fef3c7;
}

:root[data-theme="dark"] .badge-secondary {
    background: #1f2937;
    color: #cbd5e1;
}

/* ── Cards ── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: .85rem 1.1rem;
    font-weight: 600;
    font-size: .92rem;
}
.card-body { padding: 1.1rem; }
.card-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    padding: .7rem 1.1rem;
}

/* ── Stat cards ── */
.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card .stat-icon {
    width: 40px; height: 40px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: .6rem;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Buttons ── */
.btn {
    font-weight: 500;
    border-radius: 7px;
    font-size: .875rem;
}
.btn-primary-brand {
    background: var(--brand);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.22);
}
.btn-primary-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.22);
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-mono {
    background: var(--brand);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.22);
}
.btn-mono:hover { background: var(--accent); color: #fff; }

.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-icon .material-icons-outlined {
    font-size: 14px;
    line-height: 1;
    margin: 0;
    display: block;
}

:root[data-theme="dark"] .btn-mono,
:root[data-theme="dark"] .btn-primary-brand,
:root[data-theme="dark"] .btn-accent {
    border-color: rgba(148, 163, 184, .45);
}

:root[data-theme="dark"] .instructions-panel .instruction-icon-brand {
    color: #c4b5fd !important;
}

:root[data-theme="dark"] .instructions-panel .instruction-icon-sync,
:root[data-theme="dark"] .instructions-panel .instruction-icon-webhook {
    color: #7dd3fc !important;
}

:root[data-theme="dark"] .instructions-panel .instruction-icon-security {
    color: #6ee7b7 !important;
}

:root[data-theme="dark"] .instructions-panel .instruction-icon-timer {
    color: #fcd34d !important;
}

:root[data-theme="dark"] .instructions-panel .instruction-link {
    color: #c4b5fd !important;
    text-decoration-color: rgba(196, 181, 253, .55);
}

/* ── Tables ── */
.table { font-size: .875rem; }
.table-invoices th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    background: #f9fafb;
    border-bottom: 2px solid var(--border) !important;
    white-space: nowrap;
    padding: .65rem 1rem;
}
.table-invoices td { padding: .35rem 1rem; vertical-align: middle; }
.table-invoices tbody tr { transition: background .1s; }
.table-invoices tbody tr:hover { background: #f9fafb; }

/* Sortable column headers */
.th-sort {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: color .15s;
    white-space: nowrap;
}
.th-sort:hover { color: var(--text); }
.th-sort.asc::after  { content: " \2191"; color: var(--accent); }  /* ↑ */
.th-sort.desc::after { content: " \2193"; color: var(--accent); }  /* ↓ */
.th-sort.asc, .th-sort.desc { color: var(--text); }

/* ── Column settings (gear in header row) ── */
.th-col-settings {
    position: relative;
    width: 36px;
    min-width: 36px;
    padding: .45rem .4rem !important;
    text-align: center;
    vertical-align: middle;
}
.btn-columns-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .15s, color .15s, border-color .15s;
}
.btn-columns-toggle:hover {
    background: rgba(0,0,0,.06);
    color: var(--text);
    border-color: var(--border);
}

/* Column settings dropdown panel */
.col-settings-panel {
    display: none;
    position: fixed;
    z-index: 1050;
    min-width: 230px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    padding: .5rem 0;
}
.col-settings-panel.open { display: block; }

.col-settings-header {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    padding: .35rem 1rem .25rem;
}
.col-settings-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.col-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .3rem 1rem;
    transition: background .1s;
}
.col-settings-item:hover { background: rgba(0,0,0,.04); }
.col-settings-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    margin: 0;
}
.col-settings-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
    cursor: pointer;
}
.col-settings-arrows {
    display: flex;
    gap: 2px;
}
.col-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: .8rem;
    transition: background .1s, color .1s;
    padding: 0;
}
.col-arrow:hover { background: var(--border); color: var(--text); }
.col-settings-reset {
    display: block;
    width: calc(100% - 2rem);
    margin: .4rem 1rem .25rem;
    padding: .35rem;
    font-size: .78rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.col-settings-reset:hover { background: #fee2e2; color: #991b1b; }

/* Dark mode adjustments for column settings */
:root[data-theme="dark"] .col-settings-panel {
    background: var(--card-bg);
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
:root[data-theme="dark"] .btn-columns-toggle:hover {
    background: rgba(255,255,255,.08);
}
:root[data-theme="dark"] .col-settings-item:hover { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .col-settings-reset:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

@media (max-width: 767px) {
    .table-invoices th, .table-invoices td { padding: .5rem .6rem; font-size: .8rem; }
}

/* ── Badges ── */
.badge { font-weight: 600; border-radius: 6px; letter-spacing: .2px; }
.badge-created   { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.badge-processing{ background: #dbeafe; color: #1d4ed8; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-failure   { background: #fee2e2; color: #991b1b; }
.badge-reversed  { background: #fef3c7; color: #92400e; }
.badge-expired   { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #dbeafe; color: #1d4ed8; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }
.badge-status { font-size: .78rem; padding: .28em .65em; }

/* ── Forms ── */
.form-control, .form-select {
    border-radius: 7px;
    border: 1px solid #d1d5db;
    font-size: .875rem;
    padding: .45rem .75rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,67,147,.15);
}
.form-label { font-weight: 500; font-size: .83rem; margin-bottom: .3rem; color: #374151; }
.form-text { font-size: .78rem; color: var(--text-muted); }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.page-header h4 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.page-back {
    font-size: .82rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: .5rem;
    transition: color .15s;
}
.page-back:hover { color: var(--text); }
.page-back .material-icons-outlined { font-size: 16px; }

/* ── Modal overlay (Alpine) ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}
.modal-overlay .modal-dialog { margin: 0; width: 100%; max-width: 480px; }

/* ── Alerts ── */
.alert { border-radius: var(--radius); font-size: .875rem; border: none; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1090;
    display: flex;
    flex-direction: column-reverse;
    gap: .6rem;
    width: 380px;
    max-width: calc(100vw - 2.5rem);
    pointer-events: none;
}
.toast-notif {
    pointer-events: auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.06);
    overflow: hidden;
    animation: toastIn .3s cubic-bezier(.22,1,.36,1);
    position: relative;
}
.toast-notif.toast-out {
    animation: toastOut .25s ease-in forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(40px) scale(.92); }
}
.toast-body {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .8rem 1rem;
}
.toast-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    margin-top: 1px;
}
.toast-notif.toast-success .toast-icon { background: #d1fae5; color: #065f46; }
.toast-notif.toast-danger .toast-icon,
.toast-notif.toast-error .toast-icon   { background: #fee2e2; color: #991b1b; }
.toast-notif.toast-warning .toast-icon { background: #fef3c7; color: #92400e; }
.toast-notif.toast-info .toast-icon    { background: #dbeafe; color: #1e40af; }
.toast-notif.toast-secondary .toast-icon { background: #e5e7eb; color: #374151; }
.toast-msg {
    flex: 1;
    font-size: .855rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text);
    padding-top: 1px;
}
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    margin-top: -1px;
}
.toast-close:hover { background: #f3f4f6; color: var(--text); }
.toast-close .material-icons-outlined { font-size: 17px; }
/* Progress bar track */
.toast-progress-track {
    height: 4px;
    background: #e5e7eb;
}
.toast-progress-bar {
    height: 100%;
    background: #3b82f6;
    border-radius: 0 0 0 var(--radius);
    transition: width 50ms linear;
}
.toast-notif.toast-success .toast-progress-bar { background: #10b981; }
.toast-notif.toast-success .toast-progress-track { background: #d1fae5; }
.toast-notif.toast-danger .toast-progress-bar,
.toast-notif.toast-error .toast-progress-bar   { background: #ef4444; }
.toast-notif.toast-danger .toast-progress-track,
.toast-notif.toast-error .toast-progress-track { background: #fee2e2; }
.toast-notif.toast-warning .toast-progress-bar { background: #f59e0b; }
.toast-notif.toast-warning .toast-progress-track { background: #fef3c7; }
.toast-notif.toast-info .toast-progress-bar    { background: #3b82f6; }
.toast-notif.toast-info .toast-progress-track  { background: #dbeafe; }
.toast-notif.toast-secondary .toast-progress-bar   { background: #6b7280; }
.toast-notif.toast-secondary .toast-progress-track { background: #e5e7eb; }

/* ── Empty state ── */
.empty-state { padding: 3rem 1.5rem; text-align: center; }
.empty-state .material-icons-outlined { font-size: 52px; color: #d1d5db; }
.empty-state h5 { font-size: 1rem; font-weight: 600; margin-top: .75rem; }
.empty-state p { font-size: .875rem; color: var(--text-muted); margin-bottom: .75rem; }
.empty-state .btn { font-size: .8rem; padding: .3rem .9rem; }

/* ── Pagination ── */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: .82rem;
    border-color: var(--border);
}
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

/* ── Misc utils ── */
code { background: #f3f4f6; border-radius: 4px; padding: .1em .35em; font-size: .85em; color: #374151; }
.text-muted { color: var(--text-muted) !important; }
.divider { border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Section label (card sub-heading) ── */
.section-label {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .5px;
}

/* ── Danger/Delete card ── */
.card-danger { border-color: #fca5a5 !important; }
.card-header-danger {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    border-bottom-color: #fca5a5 !important;
}
:root[data-theme="dark"] .card-danger { border-color: #7f1d1d !important; }
:root[data-theme="dark"] .card-header-danger {
    background: #3f1d1d !important;
    color: #fecaca !important;
    border-bottom-color: #7f1d1d !important;
}

/* ── Warning block (left-border) ── */
.warning-block {
    background: var(--accent-light);
    border-left: 4px solid #ef4444;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}

/* ── Auth pages ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg);
}
.auth-inner { width: 100%; max-width: 400px; }
.auth-logo-wrap { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.auth-logo-box {
    width: 36px; height: 36px;
    background: var(--brand);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon { color: #fff; font-size: 20px; }
.auth-brand { font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; }
.auth-brand .accent { color: var(--accent); }
.auth-tagline { color: var(--text-muted); font-size: .9rem; margin: 0; }
.auth-card { border-radius: 16px; padding: 2rem; }
.auth-submit-btn { padding: .6rem; }
.auth-footer-text { font-size: .88rem; color: var(--text-muted); }
.auth-footer-text a.link-brand { color: var(--brand); }
.auth-footer-text a.link-accent { color: var(--accent); }

/* ── Stat icon variants ── */
.stat-icon-gray  { background: #f3f4f6; color: #374151; }
.stat-icon-green { background: #d1fae5; color: #065f46; }
.stat-icon-blue  { background: #dbeafe; color: #1d4ed8; }
.stat-icon-orange { background: #fff7ed; color: #9a3412; }
.stat-icon-red   { background: #fee2e2; color: #991b1b; }
.stat-icon-muted { background: #f3f4f6; color: #6b7280; }
:root[data-theme="dark"] .stat-icon-gray  { background: #1f2937 !important; color: #cbd5e1 !important; }
:root[data-theme="dark"] .stat-icon-green { background: #064e3b !important; color: #d1fae5 !important; }
:root[data-theme="dark"] .stat-icon-blue  { background: #1e3a8a !important; color: #dbeafe !important; }
:root[data-theme="dark"] .stat-icon-orange { background: #431407 !important; color: #fdba74 !important; }
:root[data-theme="dark"] .stat-icon-red   { background: #450a0a !important; color: #fca5a5 !important; }
:root[data-theme="dark"] .stat-icon-muted { background: #1f2937 !important; color: #cbd5e1 !important; }

/* ── Stat value colors ── */
.stat-value-green  { color: #065f46; }
.stat-value-blue   { color: #1d4ed8; }
.stat-value-orange { color: #9a3412; }
.stat-value-red    { color: #991b1b; }
.stat-value-gray   { color: #374151; }
.stat-value-muted  { color: #6b7280; }
:root[data-theme="dark"] .stat-value-green  { color: #86efac !important; }
:root[data-theme="dark"] .stat-value-blue   { color: #93c5fd !important; }
:root[data-theme="dark"] .stat-value-orange { color: #fdba74 !important; }
:root[data-theme="dark"] .stat-value-red    { color: #fca5a5 !important; }
:root[data-theme="dark"] .stat-value-gray   { color: #cbd5e1 !important; }
:root[data-theme="dark"] .stat-value-muted  { color: #cbd5e1 !important; }

/* ── Amount colored text ── */
.amount-paid   { color: #065f46; }
.amount-unpaid { color: #991b1b; }
:root[data-theme="dark"] .amount-paid { color: #86efac !important; }

/* ── Icon check/muted (table boolean indicators) ── */
.icon-check     { font-size: 16px; color: #10b981; }
.icon-muted-sm  { font-size: 16px; color: #d1d5db; }
:root[data-theme="dark"] .icon-muted-sm { color: #64748b !important; }

/* ── Sticky totals bar ── */
.table-totals-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #f9fafb;
    border-top: 2px solid var(--border);
    padding: .5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    font-size: .85rem;
    border-radius: 0 0 var(--radius) var(--radius);
}
.table-totals-inner {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    align-items: center;
}
:root[data-theme="dark"] .table-totals-bar { background: #0f172a !important; }

/* ── Per-page selector ── */
.per-page-inline { display: inline-flex; align-items: center; gap: 4px; margin-left: .5rem; }
.per-page-label  { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
.per-page-select {
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 4px;
    font-size: .78rem;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
}

/* ── Terminal show-payments badges ── */
.badge-show-payments-yes { font-size: .75rem; background: #dbeafe; color: #1d4ed8; }
.badge-show-payments-no  { font-size: .75rem; background: #f3f4f6; color: #6b7280; }
.badge-show-payments-yes .material-icons-outlined,
.badge-show-payments-no  .material-icons-outlined { font-size: 12px; vertical-align: middle; margin-right: 2px; }
:root[data-theme="dark"] .badge-show-payments-yes { background: #1e3a8a !important; color: #dbeafe !important; }
:root[data-theme="dark"] .badge-show-payments-no  { background: #1f2937 !important; color: #cbd5e1 !important; }

/* ── Social share buttons ── */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .35rem .6rem;
    color: #fff !important;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 500;
    font-size: .875rem;
    line-height: 1;
    border: none;
}
.btn-share:hover { opacity: .88; }
.btn-share-telegram              { background: #26A5E4; }
.btn-share-telegram:hover        { background: #26A5E4 !important; }
.btn-share-viber                 { background: #7360F2; }
.btn-share-viber:hover           { background: #7360F2 !important; }
.btn-share-whatsapp              { background: #25D366; }
.btn-share-whatsapp:hover        { background: #25D366 !important; }
.btn-share-email                 { background: #6c757d; }
.btn-share-email:hover           { background: #6c757d !important; }
.btn-share .material-icons-outlined { font-size: 20px; }

/* ── Invoice link (monospace number) ── */
.invoice-link {
    font-size: .8rem;
    font-family: monospace;
    color: var(--brand);
    text-decoration: none;
}
:root[data-theme="dark"] .invoice-link { color: #f9a8d4 !important; }

/* ── Modal confirm dialog ── */
.modal-confirm-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
    background: #fff;
    padding: 1rem;
}
.modal-confirm-icon {
    width: 40px; height: 40px;
    background: #fee2e2;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
}
:root[data-theme="dark"] .modal-confirm-content { background: var(--card-bg) !important; }

/* ── Audit feed ── */
.audit-feed { max-height: 420px; overflow-y: auto; }
.audit-row  { font-size: .82rem; }
.audit-date { font-size: .75rem; color: var(--text-muted); }

/* ── Invoice detail ── */
.invoice-number { font-family: monospace; letter-spacing: -.5px; }
.invoice-info-table { font-size: .85rem; }
.invoice-info-table .label-col { width: 190px; color: var(--text-muted); vertical-align: middle; }

/* ── Instructions panel sticky ── */
.instructions-panel-sticky { position: sticky; top: calc(var(--navbar-h) + 1rem); }

/* ── Product search dropdown ── */
.product-search-dropdown {
    z-index: 1050;
    max-height: 260px;
    top: calc(100% + 2px);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ── Items table (invoice create) ── */
#items-table { font-size: .75rem; }
#items-table thead tr { font-size: .60rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
#items-table th, #items-table td { padding-top: .18rem; padding-bottom: .18rem; vertical-align: middle; }
#items-table .form-control-sm { padding: .1rem .3rem; font-size: .75rem; }
.item-product-link {
    font-size: .82rem;
    color: var(--accent);
    text-decoration: none;
    line-height: 1.4;
    display: block;
}
.item-discount-val { white-space: nowrap; color: var(--text-muted); }
.item-total-val { font-weight: 600; white-space: nowrap; }
.item-remove-btn { padding: .1rem .25rem; color: var(--text-muted); }
.item-remove-btn .material-icons-outlined { font-size: 16px; }
.tfoot-no-border { border-top: none; }
.tfoot-label { font-size: .78rem; color: var(--text-muted); padding-top: .4rem; }
.tfoot-value { font-size: .78rem; color: var(--text-muted); padding-top: .4rem; white-space: nowrap; }
.tfoot-total-label { font-weight: 600; font-size: .85rem; padding-top: .4rem; }
.tfoot-total-value { font-weight: 700; font-size: .98rem; white-space: nowrap; padding-top: .4rem; }
.search-price-hint { font-size: .7rem; white-space: nowrap; color: var(--text-muted); }

/* ── Dashboard data cells ── */
.td-date    { color: var(--text-muted); white-space: nowrap; font-size: .8rem; }
.td-muted   { color: var(--text-muted); }
.td-mono    { font-size: .75rem; font-family: monospace; color: var(--text-muted); white-space: nowrap; }
.td-ref     { font-size: .8rem; color: var(--text-muted); }
.td-url     { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-url a   { font-size: .78rem; }
.td-fee     { white-space: nowrap; font-size: .85rem; }
.td-pan     { font-size: .8rem; font-family: monospace; color: var(--text-muted); }
.td-err     { font-size: .8rem; color: var(--text-muted); }
.td-reason  { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--text-muted); }
.td-dest    { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

/* ── Feedback category/status badges ── */
.badge-cat-bug         { font-size: .7rem; font-weight: 600; background: #fef2f2; color: #ef4444; }
.badge-cat-improvement { font-size: .7rem; font-weight: 600; background: #f0fdf4; color: #16a34a; }
.badge-cat-feature     { font-size: .7rem; font-weight: 600; background: var(--accent-light); color: var(--accent); }
.badge-status-pending   { font-size: .7rem; font-weight: 600; background: #fef3c7; color: #d97706; }
.badge-status-published { font-size: .7rem; font-weight: 600; background: var(--accent-light); color: var(--accent); }
.badge-status-progress  { font-size: .7rem; font-weight: 600; background: #dbeafe; color: #2563eb; }
.badge-status-completed { font-size: .7rem; font-weight: 600; background: #d1fae5; color: #059669; }
.badge-status-rejected  { font-size: .7rem; font-weight: 600; background: #fef2f2; color: #ef4444; }
.badge-status-icon { font-size: 12px; vertical-align: -1px; }

/* ── Feedback voting ── */
.vote-container     { min-width: 56px; }
.vote-disabled      { min-width: 48px; opacity: .45; }
.vote-btn           { background: none; min-width: 48px; }
.vote-thumb-icon    { font-size: 28px; transition: color .15s; }
.vote-count         { font-size: .85rem; font-weight: 700; line-height: 1.2; transition: color .15s; }
.vote-count-static  { font-size: .85rem; font-weight: 700; line-height: 1.2; color: var(--text-muted); }
.vote-thumb-static  { font-size: 28px; color: var(--text-muted); }

/* ── Landing page ── */
.landing-hero { min-height: calc(100vh - 64px); display: flex; align-items: center; padding: 4rem 1rem; }
.landing-section { padding: 5rem 1rem; }
.landing-section:nth-child(even) { background: var(--card-bg); }
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
    width: 56px; height: 56px;
    background: var(--accent-light);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.feature-icon .material-icons-outlined { font-size: 28px; color: var(--accent); }
.step-num {
    width: 40px; height: 40px;
    background: var(--accent); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
    flex-shrink: 0;
}
.cta-section { background: var(--brand); color: #fff; padding: 5rem 1rem; text-align: center; }
.cta-section h2 { color: #fff; }
.cta-section p  { color: rgba(255,255,255,.7); }
.landing-footer {
    background: var(--brand);
    color: rgba(255,255,255,.6);
    padding: 2rem 1rem;
    font-size: .85rem;
}
.landing-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.landing-footer a:hover { color: #fff; }
.landing-footer-brand { font-weight: 700; color: rgba(255,255,255,.9); }
.landing-footer-accent { color: var(--accent); }

/* ── Landing Typography helpers ── */
.text-brand-accent { color: var(--accent); }
.text-accent { color: var(--accent); }
.fw-medium { font-weight: 500; }
.landing-hero-h1 { font-size: 2.8rem; font-weight: 900; line-height: 1.1; margin-bottom: 1.2rem; }
.landing-hero-lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 480px; }
.landing-cta-btn { padding: .7rem 2rem; font-size: 1rem; }
.landing-outline-btn { padding: .65rem 1.5rem; font-size: 1rem; border: 1px solid var(--border); color: var(--text); }
.cta-section .landing-outline-btn { border-color: rgba(255,255,255,.4); color: rgba(255,255,255,.9); }
.cta-section .landing-outline-btn:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.6); }
.landing-section-title { font-weight: 800; font-size: 2rem; margin-bottom: .5rem; }
.landing-section-lead { color: var(--text-muted); }
.landing-cta-title { font-size: 2.2rem; font-weight: 800; margin-bottom: .8rem; }
.landing-cta-lead { font-size: 1.1rem; max-width: 480px; margin: 0 auto 2rem; }
.badge-free {
    background: #10b981; color: #fff;
    font-size: .75rem; padding: .25rem .6rem;
    border-radius: 6px; font-weight: 700;
}
.advantage-item { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.advantage-item .material-icons-outlined { color: var(--accent); font-size: 24px; margin-top: 2px; }

/* Usecase cards */
.usecase-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}
.usecase-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.usecase-icon { font-size: 36px; color: var(--accent); margin-bottom: .75rem; display: block; }

/* CTA outline button */
.landing-cta-outline-btn {
    padding: .65rem 1.5rem;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,.35);
    color: rgba(255,255,255,.9);
    border-radius: var(--radius);
}
.landing-cta-outline-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.landing-mockup-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}
.landing-mockup-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.landing-dot { width: 10px; height: 10px; border-radius: 50%; }
.landing-dot-red    { background: #ef4444; }
.landing-dot-yellow { background: #f59e0b; }
.landing-dot-green  { background: #10b981; }
.landing-mockup-title { flex: 1; text-align: center; font-size: .75rem; color: var(--text-muted); }
.landing-stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.landing-stat-card { background: var(--bg); border-radius: 12px; padding: 1rem; text-align: center; }
.landing-stat-label { font-size: .7rem; color: var(--text-muted); margin-bottom: 4px; }
.landing-stat-value { font-size: 1.4rem; font-weight: 800; }
.landing-stat-value-green { color: #10b981; }
.landing-invoice-row {
    background: var(--bg);
    border-radius: 10px;
    padding: .6rem .8rem;
    font-size: .75rem;
    display: flex; align-items: center; gap: 6px;
}
@media (max-width: 640px) { .landing-hero { padding: 3rem 1rem; } .step-num { width: 32px; height: 32px; font-size: .95rem; } }

/* ── Landing nav (public layout) ── */
.landing-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.landing-nav .nav-link { color: var(--text-muted); font-weight: 500; font-size: .9rem; }
.landing-nav .nav-link:hover { color: var(--text); }
/* Landing logo elements */
.landing-logo-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.landing-logo-box {
    width: 32px; height: 32px;
    background: var(--brand);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.landing-logo-icon { color: #fff; font-size: 18px; }
.landing-logo-text { font-size: 1.2rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.landing-logo-text .accent { color: var(--accent); }
.landing-nav-guide-link { color: var(--text-muted); font-weight: 500; font-size: .9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.landing-theme-btn { border: none; background: none; color: var(--text-muted); }
.landing-login-link { color: var(--text); font-weight: 600; }

/* ── Guide page ── */
.guide-wrap {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1140px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}
.guide-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--navbar-h, 52px) + 1.5rem);
    max-height: calc(100vh - var(--navbar-h, 52px) - 3rem);
    overflow-y: auto;
    scrollbar-width: thin;
}
.guide-sidebar-inner {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .75rem .5rem;
}
.guide-sidebar-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: .25rem .75rem .5rem;
}
.guide-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .45rem .75rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    line-height: 1.3;
}
.guide-nav-link:hover { background: var(--bg); color: var(--text); }
.guide-nav-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.guide-nav-link .material-icons-outlined { font-size: 16px; flex-shrink: 0; }
.guide-nav-subs { padding-left: 2rem; overflow: hidden; }
.guide-nav-sublink {
    display: block;
    padding: .25rem .75rem;
    border-left: 2px solid var(--border);
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 400;
    text-decoration: none;
    line-height: 1.35;
    transition: color .15s, border-color .15s;
}
.guide-nav-sublink:hover { color: var(--text); border-color: var(--text-muted); }
.guide-nav-sublink.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.guide-content { flex: 1; min-width: 0; }
.guide-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem 2rem 1.75rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: calc(var(--navbar-h, 52px) + 1.5rem);
}
.guide-section h3[id] {
    scroll-margin-top: calc(var(--navbar-h, 52px) + 1.5rem);
}
.guide-section-header {
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.guide-section-icon {
    width: 40px; height: 40px;
    background: var(--accent-light);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.guide-section-icon .material-icons-outlined { font-size: 22px; color: var(--accent); }
.guide-section-header h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.guide-section h3 { font-size: .95rem; font-weight: 700; margin: 1.5rem 0 .6rem; color: var(--text); }
.guide-section h3:first-of-type { margin-top: 0; }
.guide-section p { font-size: .9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: .75rem; }
.guide-section p:last-child { margin-bottom: 0; }
.guide-section ul, .guide-section ol { font-size: .9rem; color: var(--text-muted); line-height: 1.7; padding-left: 1.4rem; margin-bottom: .75rem; }
.guide-section li { margin-bottom: .25rem; }
.guide-section li:last-child { margin-bottom: 0; }
.guide-tip {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: .75rem 1rem;
    font-size: .85rem; color: var(--text); line-height: 1.6;
    margin: 1rem 0;
}
.guide-tip strong { color: var(--accent); }
.guide-warn {
    background: rgba(245, 158, 11, .1);
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    padding: .75rem 1rem;
    font-size: .85rem; color: var(--text); line-height: 1.6;
    margin: 1rem 0;
}
.guide-warn strong { color: #f59e0b; }
.guide-table { width: 100%; font-size: .85rem; border-collapse: collapse; margin: .75rem 0 1rem; }
.guide-table th { background: var(--bg); font-weight: 600; color: var(--text); padding: .55rem .75rem; text-align: left; border-bottom: 2px solid var(--border); }
.guide-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.guide-table tr:last-child td { border-bottom: none; }
.guide-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 5px; }
.guide-badge-success { background: #d1fae5; color: #065f46; }
.guide-badge-warning { background: #fef3c7; color: #92400e; }
.guide-badge-danger  { background: #fee2e2; color: #991b1b; }
.guide-badge-info    { background: #dbeafe; color: #1e40af; }
.guide-badge-muted   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
:root[data-theme="dark"] .guide-badge-success { background: #064e3b; color: #6ee7b7; }
:root[data-theme="dark"] .guide-badge-warning { background: #78350f; color: #fcd34d; }
:root[data-theme="dark"] .guide-badge-danger  { background: #7f1d1d; color: #fca5a5; }
:root[data-theme="dark"] .guide-badge-info    { background: #1e3a5f; color: #93c5fd; }
.guide-steps { counter-reset: step; padding: 0; list-style: none; margin: .75rem 0 1rem; }
.guide-steps li { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; font-size: .9rem; color: var(--text-muted); line-height: 1.6; counter-increment: step; }
.guide-steps li::before { content: counter(step); min-width: 24px; height: 24px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; flex-shrink: 0; margin-top: 1px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; margin: .75rem 0; }
.perm-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem; font-size: .85rem; }
.perm-card strong { display: block; color: var(--text); margin-bottom: .25rem; }
.perm-card span { color: var(--text-muted); font-size: .8rem; }
.guide-mobile-nav {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .5rem;
    margin-bottom: 1.25rem;
    overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.guide-mobile-nav::-webkit-scrollbar { display: none; }
.guide-mobile-nav a { display: inline-flex; align-items: center; gap: 5px; padding: .4rem .7rem; border-radius: 7px; font-size: .8rem; font-weight: 500; color: var(--text-muted); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.guide-mobile-nav a:hover { background: var(--bg); color: var(--text); }
.guide-mobile-nav a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.guide-mobile-nav .material-icons-outlined { font-size: 15px; }
@media (max-width: 900px) { .guide-sidebar { display: none; } .guide-mobile-nav { display: block; } .guide-wrap { padding: 1rem .75rem 3rem; gap: 0; } }
@media (max-width: 600px) { .guide-section { padding: 1.25rem 1rem; } }

/* ═══ Terminals & Catalog shared icon helpers ══════════════════════════ */
.icon-badge {
    font-size: 12px;
    vertical-align: middle;
    margin-right: 2px;
}
.icon-sm-inline {
    font-size: 15px;
    vertical-align: middle;
    margin-right: 3px;
}
.icon-xs-inline {
    font-size: 13px;
    vertical-align: middle;
    margin-right: 4px;
}
.icon-xs {
    font-size: 14px;
}
.icon-btn-inline {
    font-size: 17px;
    vertical-align: middle;
    margin-right: 4px;
}
.icon-heading-inline {
    vertical-align: middle;
    margin-right: 6px;
}
.icon-action-link {
    line-height: 1;
}

/* ═══ Icon utility sizes ════════════════════════════════════════════════ */
/* Bootstrap-compatible extra-small/xx-small text */
.x-small  { font-size: .82rem; }
.xx-small { font-size: .75rem; }

/* ═══ Terminals ═════════════════════════════════════════════════════════ */
.badge-show-payments-yes {
    font-size: .75rem;
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-show-payments-no {
    font-size: .75rem;
    background: #f3f4f6;
    color: #6b7280;
}
.label-col-130 {
    width: 130px;
}
.list-group-item-themed {
    border-color: var(--border) !important;
}

/* ═══ Catalog ═══════════════════════════════════════════════════════════ */

/* Category sidebar items */
.catalog-cat-item {
    background: transparent;
    transition: background .15s, color .15s;
}
.catalog-cat-item:hover {
    background: var(--accent-light) !important;
    color: var(--text) !important;
}
.catalog-cat-item.active {
    background: var(--accent) !important;
    color: #fff !important;
}
.catalog-cat-item.active .text-muted,
.catalog-cat-item.active .icon-action-link,
.catalog-cat-item.active .text-inherit {
    color: rgba(255,255,255,.75) !important;
}
.catalog-cat-item.active .badge-count-accent {
    background: rgba(255,255,255,.25);
    color: #fff;
}
.badge-count-accent {
    background: var(--accent-light);
    color: var(--text);
    border-radius: 20px;
    font-size: .73rem;
}
.btn-icon-plain {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}
.btn-icon-xs {
    padding: .2rem .45rem !important;
}
.catalog-search-input {
    width: 220px;
}
.text-inherit { color: inherit; }
.col-actions-sm { width: 90px; }
.row-archived { opacity: .55; }

/* ═══ Delete / danger cards ════════════════════════════════════════════ */
.card-danger-red {
    border: 1px solid #ef4444;
}
.warning-block-danger {
    background: var(--accent-light);
    border-left: 4px solid #ef4444;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}
.icon-box-danger {
    width: 40px;
    height: 40px;
    background: #fee2e2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-danger-md {
    color: #dc3545;
    font-size: 20px;
}
.icon-md {
    font-size: 18px;
}
.label-col-150 { width: 150px; }
.btn-secondary-outline-themed {
    border: 1px solid var(--border);
    color: var(--text);
}
.content-transition { transition: opacity .15s; }

/* ═══ Feedback templates ════════════════════════════════════════════════ */
/* Category badges */
.badge-cat-bug         { font-size: .7rem; font-weight: 600; background: #fef2f2; color: #ef4444; }
.badge-cat-improvement { font-size: .7rem; font-weight: 600; background: #f0fdf4; color: #16a34a; }
.badge-cat-feature     { font-size: .7rem; font-weight: 600; background: var(--accent-light); color: var(--accent); }

/* Status badges */
.badge-status-in_progress { font-size: .7rem; font-weight: 600; background: #fef3c7; color: #d97706; }
.badge-status-completed   { font-size: .7rem; font-weight: 600; background: #d1fae5; color: #059669; }
.badge-status-pending     { font-size: .7rem; font-weight: 600; background: #fef3c7; color: #d97706; }
.badge-status-rejected    { font-size: .7rem; font-weight: 600; background: #fef2f2; color: #ef4444; }

/* Generic small badge */
.badge-xs { font-size: .7rem; font-weight: 600; }

/* Vote section */
.vote-container { min-width: 56px; text-align: center; }
.vote-disabled  { min-width: 48px; opacity: .45; }
.vote-icon-muted { font-size: 28px; color: var(--text-muted); }
.vote-count-muted { font-size: .85rem; font-weight: 700; line-height: 1.2; color: var(--text-muted); }
.vote-btn   { background: none; min-width: 48px; border: none; padding: 0; cursor: pointer; }
.vote-icon  { font-size: 28px; transition: color .15s; }
.vote-count { font-size: .85rem; font-weight: 700; line-height: 1.2; transition: color .15s; }

/* Icon helpers for feedback */
.icon-hero-inline { font-size: 22px; vertical-align: -3px; margin-right: 4px; }
.icon-lg-inline   { font-size: 20px; vertical-align: -3px; margin-right: 4px; }
.icon-md-align    { font-size: 18px; }
.icon-sm-align    { font-size: 16px; vertical-align: -2px; }
.icon-xs-align    { font-size: 12px; vertical-align: -1px; }

/* Filter UI */
.filter-divider { border-left: 1px solid var(--border); padding-left: 12px; }
.input-group-themed { background: var(--card-bg); border-color: var(--border); }
.border-themed { border-color: var(--border) !important; }
.feedback-search-input { width: 220px; }
.comment-box-accent { background: var(--accent-light); border-radius: 8px; }
.min-w-0 { min-width: 0; }
.col-title-min { min-width: 250px; }

/* "My suggestions" badge pill inside button */
.badge-my-active   { font-size: .65rem; padding: 2px 5px; margin-left: 2px; background: rgba(255,255,255,.25); color: #fff; }
.badge-my-inactive { font-size: .65rem; padding: 2px 5px; margin-left: 2px; background: var(--border); color: var(--text-muted); }
.badge-my-pending-active   { font-size: .65rem; padding: 2px 5px; margin-left: 2px; background: rgba(255,255,255,.25); color: #fff; }
.badge-my-pending-inactive { font-size: .65rem; padding: 2px 5px; margin-left: 2px; background: #fef3c7; color: #d97706; }

/* Moderation status badges (admin list view) */
.badge-status-published { font-size: .7rem; font-weight: 600; background: var(--accent-light); color: var(--accent); }
.badge-status-other     { font-size: .7rem; font-weight: 600; background: #f3f4f6; color: #6b7280; }

/* ═══ Audit list ════════════════════════════════════════════════════════ */
.audit-col-date   { width: 160px; }
.audit-col-user   { width: 140px; }
.audit-col-action { width: 130px; }
.audit-col-type   { width: 120px; }
.audit-col-detail { width: 60px; }
.audit-detail-td  { max-width: 300px; }
.audit-scroll-box { max-height: 300px; overflow-y: auto; }

.audit-diff-block {
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 8px;
    padding: .75rem;
    font-size: .82rem;
    word-break: break-all;
}
.modal-content-rounded {
    border-radius: 14px;
    border: none;
}
.icon-xs-sm-inline { font-size: 14px; vertical-align: middle; }
.icon-sm-middle    { font-size: 16px; vertical-align: middle; }
.icon-md-inline    { font-size: 18px; vertical-align: middle; margin-right: 4px; }
.icon-sm           { font-size: 16px; }
.icon-empty-state  { font-size: 48px; }

/* ═══ SMTP / Send invoice hint card ════════════════════════════════════ */
.card-hint-accent {
    background: var(--accent-light);
    border: none;
}

/* ═══ Misc account ══════════════════════════════════════════════════════ */
.ban-account-input { width: 200px; }

/* ═══ Base template – user dropdown ════════════════════════════════════ */
.dropdown-user-name  { font-size: .8rem; font-weight: 600; }
.dropdown-user-email { font-size: .75rem; color: var(--text-muted); }

/* ═══ Guide page ════════════════════════════════════════════════════════ */
.guide-page-header     { margin-bottom: 1.5rem; }
.guide-breadcrumb      { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.guide-breadcrumb-link { color: var(--text-muted); text-decoration: none; font-size: .85rem; display: inline-flex; align-items: center; gap: 3px; }
.guide-breadcrumb-sep  { color: var(--text-muted); font-size: .85rem; }
.guide-breadcrumb-cur  { color: var(--text-muted); font-size: .85rem; }
.guide-page-title      { font-size: 1.6rem; font-weight: 800; margin: 0 0 .3rem; }
.guide-page-lead       { color: var(--text-muted); font-size: .9rem; margin: 0; }
.guide-badge-row       { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.guide-badge-row-sm    { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.guide-faq-item        { border-bottom: 1px solid var(--border); padding: .75rem 0; }
.guide-faq-btn         { background: none; border: none; width: 100%; text-align: left; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.guide-faq-question    { font-size: .9rem; font-weight: 600; color: var(--text); }
.guide-faq-chevron     { font-size: 18px; color: var(--text-muted); flex-shrink: 0; transition: transform .2s; }
.guide-faq-answer      { padding-top: .6rem; }
.guide-faq-answer-text { font-size: .88rem; color: var(--text-muted); line-height: 1.7; margin: 0; }

/* ═══ Landing page ══════════════════════════════════════════════════════ */
.landing-feature-text   { font-size: .9rem; margin: 0; }
.landing-section-lead-w { max-width: 520px; margin: 0 auto; }
.landing-arrow-icon     { font-size: 18px; vertical-align: middle; margin-left: 4px; }
.landing-check-icon     { font-size: 16px; color: #10b981; }
.landing-paid-label     { color: #10b981; }
.landing-nav-icon-sm    { font-size: 17px; }
.landing-nav-icon-md    { font-size: 20px; }
.landing-nav-icon-cab   { font-size: 16px; vertical-align: middle; }

/* ═══ Legal pages (privacy_policy, terms_of_service) ═══════════════════ */
.legal-page-wrap    { min-height: 100vh; padding: 2rem 1rem; background: var(--bg); }
.legal-page-inner   { max-width: 780px; margin: 0 auto; }
.legal-back-link    { color: var(--text-muted); text-decoration: none; font-size: .9rem; display: inline-flex; align-items: center; gap: 4px; }
.legal-back-icon    { font-size: 18px; }
.legal-card         { border-radius: 16px; padding: 2.5rem; }
.legal-card-title   { font-weight: 800; margin-bottom: .3rem; }
.legal-card-date    { color: var(--text-muted); font-size: .85rem; margin-bottom: 2rem; }
.legal-content      { line-height: 1.8; color: var(--text); }
.legal-section-h5   { font-weight: 700; margin-top: 1.5rem; }
.legal-tip-block    { background: var(--accent-light); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: 1rem 1.2rem; }
.legal-tip-p        { margin: .5rem 0 0; }

/* ═══ Dashboard modal & icon boxes ─════════════════════════════════════ */
.modal-content-styled { border-radius: 14px; border: none; box-shadow: 0 24px 64px rgba(0,0,0,.18); background: #fff; padding: 1rem; }
.icon-box-sm-danger   { width: 40px; height: 40px; background: #fee2e2; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0; }
.alert-fs-sm          { font-size: .83rem; }

/* ═══ Invoice create – table columns ═══════════════════════════════════ */
.col-product-name  { min-width: 160px; }
.col-qty           { width: 60px; }
.col-price         { width: 90px; }
.col-discount      { width: 70px; }
.col-discount-sum  { width: 80px; }
.col-total         { width: 90px; }
.col-del           { width: 26px; }
.tfoot-spacer      { padding-top: .4rem; padding-bottom: .25rem; padding-left: 0; padding-right: .25rem; }
.tfoot-spacer-md   { padding-top: .4rem; padding-bottom: .3rem; }
.icon-sync-xs      { font-size: 12px; vertical-align: middle; }
.fs-78             { font-size: .78rem; }
.fs-84             { font-size: .84rem; }
.icon-add-circle   { font-size: 17px; vertical-align: middle; margin-right: 4px; }
.icon-help         { font-size: 16px; vertical-align: middle; margin-right: 6px; color: var(--text-muted); }
.help-list         { font-size: .85rem; }
.icon-save-17      { font-size: 17px; vertical-align: middle; }

/* ═══ Invoice detail / _invoice_detail_content ══════════════════════════ */
.icon-16-mr3       { font-size: 16px; vertical-align: middle; margin-right: 3px; }
.icon-17-mr4       { font-size: 17px; vertical-align: middle; margin-right: 4px; }
.icon-18-mr4       { font-size: 18px; vertical-align: middle; margin-right: 4px; }
.icon-16-fwd       { font-size: 16px; vertical-align: middle; }
.icon-32           { font-size: 32px; }
.invoice-info-fs   { font-size: .9rem; }
.invoice-id-code   { font-size: .85rem; }
.invoice-ref-code  { font-size: .82rem; }
.badge-status-lg   { font-size: .82rem; padding: .35em .7em; }
.invoice-amount-lg { font-size: 1.1rem; }
.invoice-url-small { font-size: .76rem; }
.icon-16-cancel    { font-size: 20px; color: #dc3545; }
.icon-16-mr6       { font-size: 16px; vertical-align: middle; margin-right: 6px; }

/* ═══ Terminal form ─────────────────────────────────────────────────────── */
.card-header-fw600   { font-weight: 600; }
.instruction-list-sm { font-size: .87rem; }
.icon-brand-18       { font-size: 18px; color: var(--brand); flex-shrink: 0; }
.link-brand          { color: var(--brand); }
.icon-sync-18        { font-size: 18px; color: #0ea5e9; flex-shrink: 0; }
.icon-lock-18        { font-size: 18px; color: #10b981; flex-shrink: 0; }
.log-scroll-box      { max-height: 300px; overflow-y: auto; }
.log-entry-fs        { font-size: .82rem; }
.log-date-fs         { font-size: .75rem; }

/* ═══ Dashboard content – filters & pagination ══════════════════════════ */
.filter-toggle-btn  { cursor: pointer; user-select: none; }
.icon-filter        { font-size: 17px; vertical-align: middle; margin-right: 6px; color: var(--text-muted); }
.icon-expand        { font-size: 18px; color: var(--text-muted); transition: transform .2s; }
.th-center-text     { text-align: center; }
.tr-clickable       { cursor: pointer; }
.tr-clickable:hover td { background: var(--accent-light) !important; }
.pagination-gap     { gap: 2px; }
.icon-14-mid        { font-size: 14px; vertical-align: middle; }
.icon-settings      { font-size: 16px; }

/* ═══ Catalog forms (save buttons) ─────────────────────────────────────── */
.icon-save-cat   { font-size: 17px; vertical-align: middle; }
.product-code-fs { font-size: .82rem; color: var(--text-muted); }
.icon-add-sm     { font-size: 14px; }

/* ═══ Nested modals (category / unit on top of product modal) ─══════════ */
.modal-nested { z-index: 1075 !important; }
