/* © Ombim@ge - All Right Reserved ® Ombim@ge 2026 */

/* POS - Dark theme (default), responsive, collapsible sidebar. Light theme via [data-theme="light"]. */
:root {
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --content-bg: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    --header-bg: rgba(30, 41, 59, 0.97);
    --card-bg: rgba(255,255,255,0.07);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #f43f5e;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 72px;
    --header-height: 56px;
    --border-subtle: rgba(255,255,255,0.08);
    --border-default: rgba(255,255,255,0.12);
    --hover-bg: rgba(255,255,255,0.08);
    --hover-bg-strong: rgba(255,255,255,0.15);
    --input-border-color: rgba(255,255,255,0.15);
    --dropdown-bg: rgba(18, 22, 28, 1);
}

/* Light theme – same palette, light backgrounds, optimized text contrast */
[data-theme="light"] {
    --sidebar-bg: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    --content-bg: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    --header-bg: rgba(255,255,255,0.97);
    --card-bg: rgba(255,255,255,0.95);
    --text: #0f172a;
    --text-muted: #334155;
    --primary: #0284c7;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --border-subtle: rgba(0,0,0,0.08);
    --border-default: rgba(0,0,0,0.12);
    --hover-bg: rgba(0,0,0,0.06);
    --hover-bg-strong: rgba(0,0,0,0.1);
    --input-border-color: rgba(0,0,0,0.2);
    --dropdown-bg: #fff;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; font-size: 16px; -webkit-text-size-adjust: 100%; }
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--primary);
    z-index: 9999;
    pointer-events: none;
    transition: width 0.12s ease-out;
}
body.navigating .nav-progress { width: 35%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--content-bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}
.app-body { display: flex; flex-direction: column; min-height: 100vh; }
img, video, iframe { max-width: 100%; height: auto; }
.main-content { width: 100%; max-width: 100%; }

/* Links: theme colors everywhere (desktop + mobile), no blue underline */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Header - offset so title/actions don't sit under sidebar */
.main-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    height: var(--header-height);
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-subtle);
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
}
body.sidebar-collapsed .main-header { margin-left: var(--sidebar-width-collapsed); }
.header-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    z-index: 101;
    position: relative;
}
.header-toggle:hover { background: var(--hover-bg); }
.header-toggle:active { background: var(--hover-bg-strong); }
.header-toggle:focus { outline: none; }
.header-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.main-title { flex: 1; font-size: 1.25rem; font-weight: 600; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
/* Header user dropdown */
.header-user-dropdown { position: relative; }
.header-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.header-user-trigger:hover { background: var(--hover-bg); }
.header-user-trigger:focus { outline: none; border-color: var(--primary); }
.header-user-trigger[aria-expanded="true"] { background: var(--hover-bg); }
.header-user-trigger[aria-expanded="true"] .header-user-chevron { transform: rotate(180deg); }
.header-user-chevron { font-size: 0.7rem; color: var(--text-muted); transition: transform 0.2s ease; margin-left: 0.25rem; }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-name { font-weight: 500; }
.user-role { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.25rem; }
.header-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.35rem;
    min-width: 180px;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    padding: 0.35rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 150;
}
.header-user-dropdown.open .header-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.header-user-menu-item:hover { background: var(--hover-bg); }
.header-user-menu-item i { width: 1.1rem; text-align: center; color: var(--text-muted); }
.header-user-menu-item:hover i { color: var(--primary); }
[data-theme="light"] .header-user-menu {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
[data-theme="light"] .header-user-trigger:hover {
    background: var(--hover-bg);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 200;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
}
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 60px;
    transition: padding 0.25s ease;
}
.sidebar.collapsed .sidebar-brand {
    padding: 1rem 0.75rem;
    justify-content: center;
}
.sidebar.collapsed .sidebar-brand-icon { font-size: 1.75rem; }
.sidebar.collapsed .sidebar-brand-icon.sidebar-brand-favicon { width: 1.75rem; height: 1.75rem; }
.sidebar-brand-icon { font-size: 1.5rem; flex-shrink: 0; }
.sidebar-brand-icon.sidebar-brand-favicon { width: 1.5rem; height: 1.5rem; object-fit: contain; display: block; }
.sidebar-brand-text { font-size: 1.25rem; font-weight: 700; white-space: nowrap; transition: opacity 0.2s ease; }
.sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 0; }
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-item-sep { border-top: 1px solid var(--border-subtle); margin-top: 0.5rem; padding-top: 0.5rem; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s, padding 0.25s ease;
}
.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.75rem;
}
.sidebar-link:hover { background: var(--hover-bg); }
.sidebar-link.active { background: var(--primary); color: #fff; }
.sidebar-link i { width: 1.25rem; text-align: center; flex-shrink: 0; font-size: 1.1rem; }
.sidebar-link span { white-space: nowrap; }
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link i { font-size: 1.35rem; width: 1.5rem; }
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.sidebar.collapsed .sidebar-footer { padding: 1rem 0.75rem; display: flex; justify-content: center; }
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, padding 0.25s ease;
}
.sidebar-collapse-btn:hover { background: var(--hover-bg-strong); }
.sidebar-collapse-btn i { width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar.collapsed .sidebar-collapse-btn { justify-content: center; padding: 0.75rem; }
.sidebar.collapsed .sidebar-collapse-btn i { font-size: 1.35rem; width: 1.5rem; }
.sidebar.collapsed .sidebar-collapse-btn .sidebar-collapse-label { display: none; }
.sidebar.collapsed .sidebar-collapse-btn .sidebar-icon-collapse { display: none; }
.sidebar-collapse-btn .sidebar-icon-expand { display: none; }
.sidebar.collapsed .sidebar-collapse-btn .sidebar-icon-expand { display: inline-block; }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.visible { display: block; }
@media (max-width: 992px) {
    .sidebar-overlay.visible { 
        display: block;
        animation: fadeIn 0.2s ease;
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Content */
.app-content-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    transition: margin-left 0.25s ease;
}
.sidebar.collapsed ~ .app-content-wrap,
body.sidebar-collapsed .app-content-wrap { margin-left: var(--sidebar-width-collapsed); }
.main-footer { padding: 1rem 1.5rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border-subtle); margin-left: var(--sidebar-width); transition: margin-left 0.25s ease; }
.sidebar.collapsed ~ .main-footer,
body.sidebar-collapsed .main-footer { margin-left: var(--sidebar-width-collapsed); }
.main-footer a.footer-link { color: var(--primary); text-decoration: none; }
.main-footer a.footer-link:hover { text-decoration: underline; }
.main-footer .footer-brand-icon { height: 1.1em; width: auto; vertical-align: middle; margin-right: 0.25rem; }

/* App-wide offline banner – NO CONNECTION: visible on all pages/views, above content, respects sidebar */
.app-offline-banner {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    color: #1c1917;
    border: 2px solid rgba(180, 83, 9, 0.7);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 8px;
    margin: 0 1rem 0.75rem;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
    box-shadow: 0 3px 12px rgba(217, 119, 6, 0.45);
    position: relative;
    z-index: 9999;
}
body.sidebar-collapsed .app-offline-banner { margin-left: var(--sidebar-width-collapsed); }
.app-offline-banner.app-offline-banner-visible { display: flex; }
.app-offline-banner-icon { flex-shrink: 0; opacity: 0.95; font-size: 1.1rem; }
.app-offline-banner-text {
    flex: 1;
    text-align: center;
    letter-spacing: 0.02em;
}
.app-offline-banner-text strong { font-weight: 700; font-size: 1rem; }
.app-offline-banner #app-offline-pending-count { font-weight: 600; }
.app-offline-banner-close {
    flex-shrink: 0;
    width: 1.25rem; height: 1.25rem;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.85;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
}
.app-offline-banner-close:hover { opacity: 1; background: rgba(0,0,0,0.12); }
.app-offline-banner-close:focus { outline: 2px solid currentColor; outline-offset: 2px; }
[data-theme="light"] .app-offline-banner {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: #1c1917;
    border-color: rgba(180, 83, 9, 0.4);
}
[data-theme="light"] .app-offline-banner-close:hover { background: rgba(0,0,0,0.08); }

/* Page layout */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-title { margin: 0; font-size: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Cards & Table - elegant, rounded */
.card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.card-header .card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.card-body {
    margin-top: 0;
}
/* All table containers: horizontally scrollable and extendable on all devices */
.table-wrap,
.inner-table-scroll,
.financial-table-scroll,
.perf-calc-table-scroll,
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.table-wrap {
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}
/* Allow table wrappers to shrink inside flex/grid so horizontal scroll appears */
.app-content-wrap .table-wrap,
.app-content-wrap .inner-table-scroll,
.app-content-wrap .financial-table-scroll,
.app-content-wrap .perf-calc-table-scroll,
.card .table-wrap,
.card .inner-table-scroll,
.card .financial-table-scroll,
.card .perf-calc-table-scroll {
    min-width: 0;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border-radius: 10px;
    overflow: hidden;
}
.data-table th,
.data-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
.data-table th {
    background: var(--hover-bg-strong);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.data-table tbody tr {
    transition: background 0.15s ease;
}
.data-table tbody tr:hover { background: var(--hover-bg); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .actions { white-space: nowrap; }
.data-table .actions .btn-icon { margin: 0 3px; }

/* Shared: filter-style multiselect checkboxes (List Excursions, Setting Voucher, Setting Invoices) */
.filter-multiselect-group { margin-bottom: 1rem; }
.filter-multiselect-group .filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.filter-multiselect-group .filter-label i {
    margin-right: 0.4rem;
    color: var(--primary);
    opacity: 0.9;
}
.filter-multiselect-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 130px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}
.filter-multiselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.filter-multiselect-chip:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.filter-multiselect-chip input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.filter-multiselect-chip:has(input:checked) {
    background: rgba(14,165,233,0.2);
    border-color: rgba(14,165,233,0.5);
}

/* Currency Add/Edit – Default for checkboxes on one line */
.currency-default-checkboxes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.currency-default-checkboxes .filter-multiselect-chip {
    flex-shrink: 0;
}

.filter-multiselect-empty {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Light theme: filter-multiselect (Discount/Supplement applicable-to chips) */
[data-theme="light"] .filter-multiselect-wrap {
    background: var(--hover-bg);
    border-color: var(--border-default);
}
[data-theme="light"] .filter-multiselect-chip {
    background: rgba(255,255,255,0.9);
    border-color: var(--border-default);
    color: var(--text);
}
[data-theme="light"] .filter-multiselect-chip:hover {
    background: var(--hover-bg-strong);
    border-color: var(--input-border-color);
}
[data-theme="light"] .filter-multiselect-chip:has(input:checked) {
    background: rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.4);
}

/* Financial / Purchase Order – shared filters (collapsible card + chip multiselect) */
.financial-filters-card .pos-card-title { font-size: 1rem; margin-bottom: 1rem; }
.financial-filters-form .filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}
.financial-filters-form .form-group { margin-bottom: 0; }
.financial-filters-form .form-group label {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
    display: block;
    color: var(--text-muted);
}
.financial-filters-form .filters-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 768px) {
    .financial-filters-form .filters-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}
@media (max-width: 480px) {
    .financial-filters-form .filters-grid { grid-template-columns: 1fr; }
}
.financial-filters-collapsible { margin-top: 0; }
.financial-filters-collapsible summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.financial-filters-collapsible summary::-webkit-details-marker { display: none; }
.financial-filters-collapsible .financial-filters-chevron { transition: transform 0.2s ease; margin-left: auto; }
.financial-filters-collapsible[open] .financial-filters-chevron { transform: rotate(180deg); }
.financial-filters-collapsible .financial-filters-form { margin-top: 1rem; }
.date-type-group { grid-column: 1 / -1; }
.date-type-toggle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.date-type-toggle .btn { min-width: 140px; }
.financial-filters-form .financial-multiselect-group { margin-bottom: 0; }
.financial-filters-form .financial-multiselect-group .filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    display: block;
    color: var(--text-muted);
}
.financial-filters-form .financial-multiselect-group .filter-label i { margin-right: 0.35rem; color: var(--primary); opacity: 0.9; }
.financial-filters-form .financial-multiselect-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 100px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}
.financial-filters-form .financial-multiselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    white-space: nowrap;
}
.financial-filters-form .financial-multiselect-chip:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.18); }
.financial-filters-form .financial-multiselect-chip input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.financial-filters-form .financial-multiselect-chip:has(input:checked) { background: rgba(14,165,233,0.2); border-color: rgba(14,165,233,0.5); }
.financial-filters-form .financial-multiselect-empty { font-size: 0.85rem; color: var(--text-muted); }

/* Provider Services List & Provider List: extendable tables with horizontal scroll */
.provider-services-list-table-wrap,
.provider-list-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
}
.card .provider-services-list-table-wrap,
.card .provider-list-table-wrap {
    min-width: 0;
}
.provider-services-list-table-wrap .data-table {
    min-width: 720px;
    width: 100%;
}
.provider-list-table-wrap .provider-list-table {
    min-width: 1680px;
    width: 100%;
}
.provider-list-table .text-small {
    font-size: 0.85rem;
    max-width: 120px;
}
.provider-list-cell-list {
    max-width: 160px;
    padding: 0.35rem 0.5rem;
    vertical-align: top;
}
.provider-list-cell-scroll {
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0;
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-word;
}
.provider-list-cell-scroll::-webkit-scrollbar { width: 5px; }
.provider-list-cell-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* Internal Cost table (Settings Profit): extendable with horizontal scroll */
.internal-cost-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
}
.card .internal-cost-table-wrap {
    min-width: 0;
}
.internal-cost-table-wrap .data-table {
    min-width: 560px;
    width: 100%;
}

/* Buttons - elegant, rounded, subtle shadow */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 1;
}
.btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; border-radius: 8px; }
.btn-primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); color: #fff; }
.btn-secondary { background: linear-gradient(180deg, #475569 0%, #334155 100%); color: #fff; border-color: transparent; }
.btn-outline { background: transparent; border: 1px solid var(--border-default); color: var(--text); box-shadow: none; }
.btn-outline:hover { background: var(--hover-bg); border-color: var(--primary); }
/* Action buttons (table icons) - elegant pill style */
.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0,0,0,0.28);
}
.btn-icon:active { transform: scale(0.98); }
.btn-icon.btn-view { background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%); color: #fff; }
.btn-icon.btn-edit { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.btn-icon.btn-delete { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); color: #fff; }
.btn-icon.btn-invoice { background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%); color: #fff; }
.btn-icon i { margin: 0; font-size: 0.95rem; }
/* Ensure btn-icon buttons work in both themes */
[data-theme="light"] .btn-icon.btn-edit { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); color: #fff; }
[data-theme="light"] .btn-icon.btn-delete { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); color: #fff; }
[data-theme="light"] .btn-icon.btn-view { background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%); color: #fff; }
[data-theme="light"] .btn-icon.btn-invoice { background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%); color: #fff; }
.btn-edit { background: var(--warning); color: #000; text-decoration: none; border: 1px solid rgba(0,0,0,0.1); }
.btn-edit:hover { opacity: 0.9; color: #000; text-decoration: none; }
a.btn { text-decoration: none; }
a.btn:hover { text-decoration: none; }


/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; color: var(--text-muted); font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--input-border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95rem;
}
.form-control:focus { outline: none; border-color: var(--primary); }
select.form-control { cursor: pointer; }
/* Date input calendar icon: white for dark theme, black for light theme */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2);
    cursor: pointer;
}
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0);
}
/* Firefox date input calendar icon */
input[type="date"]::-moz-calendar-picker-indicator {
    filter: invert(1) brightness(2);
    cursor: pointer;
}
[data-theme="light"] input[type="date"]::-moz-calendar-picker-indicator {
    filter: invert(0);
}
select.form-control-multiselect { min-height: 6rem; }
select.form-control-multiselect option { padding: 0.25rem 0; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: normal;
    color: var(--text);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.checkbox-label:hover { background: var(--hover-bg); }
.checkbox-label:has(input:checked) {
    background: rgba(14,165,233,0.12);
    border-color: rgba(14,165,233,0.25);
}
[data-theme="light"] .checkbox-label:has(input:checked) {
    background: rgba(2, 132, 199, 0.15);
    border-color: rgba(2, 132, 199, 0.4);
    color: var(--text);
}
.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.checkbox-label input[type="checkbox"]:focus-visible,
.checkbox-label input[type="radio"]:focus-visible {
    outline: 2px solid rgba(14,165,233,0.7);
    outline-offset: 2px;
}

/* Note & Payment cards (invoices, proforma, purchase order) – theme-aligned checkboxes, minimal style */
.note-payment-card .checkbox-label {
    padding: 0;
    border: none;
    background: transparent;
}
.note-payment-card .checkbox-label:hover { background: var(--hover-bg); border-radius: 6px; }
.note-payment-card .checkbox-label:has(input:checked) { background: transparent; border-color: transparent; }

/* Provider Services List – Category checkboxes (chip style, aligned with Provider form / List Excursions) */
.provider-service-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}
.provider-service-categories .category-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--hover-bg);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    margin: 0;
    font-weight: 500;
}
.provider-service-categories .category-checkbox-label:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
[data-theme="light"] .provider-service-categories .category-checkbox-label:hover {
    background: var(--hover-bg);
    border-color: var(--border-default);
}
.provider-service-categories .category-checkbox-label input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.provider-service-categories .category-checkbox-label:has(input:checked) {
    background: rgba(14,165,233,0.2);
    border-color: rgba(14,165,233,0.5);
}
[data-theme="light"] .provider-service-categories .category-checkbox-label:has(input:checked) {
    background: rgba(2, 132, 199, 0.15);
    border-color: rgba(2, 132, 199, 0.4);
    color: var(--text);
}

/* Internal Cost – Category checkboxes (inline, same style as Provider Services / List Excursions) */
.internal-cost-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}
.internal-cost-categories .category-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    margin: 0;
    font-weight: 500;
}
.internal-cost-categories .category-checkbox-label:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
[data-theme="light"] .internal-cost-categories .category-checkbox-label:hover {
    background: var(--hover-bg);
    border-color: var(--border-default);
}
.internal-cost-categories .category-checkbox-label input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.internal-cost-categories .category-checkbox-label:has(input:checked) {
    background: rgba(14,165,233,0.2);
    border-color: rgba(14,165,233,0.5);
}
[data-theme="light"] .internal-cost-categories .category-checkbox-label:has(input:checked) {
    background: rgba(2, 132, 199, 0.15);
    border-color: rgba(2, 132, 199, 0.4);
    color: var(--text);
}

/* Internal Cost – Adult / Child / Qty Single Cost on same line */
.internal-cost-costs-row .internal-cost-costs-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.internal-cost-costs-row .internal-cost-costs-inline .form-control {
    width: 120px;
    min-width: 100px;
}

.form-row-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* Currency selector (Financial, Profit, Purchase Order – same design) */
.financial-currency-form,
.po-currency-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.financial-currency-form .financial-currency-radios,
.financial-currency-form .po-currency-radios,
.po-currency-form .financial-currency-radios,
.po-currency-form .po-currency-radios {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.financial-currency-form .financial-multiselect-chip,
.po-currency-form .financial-multiselect-chip {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    color: var(--text);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.financial-currency-form .financial-multiselect-chip:hover,
.po-currency-form .financial-multiselect-chip:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
}
.financial-currency-form .financial-multiselect-chip input[type="radio"],
.po-currency-form .financial-multiselect-chip input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}
.financial-currency-form .financial-multiselect-chip:has(input:checked),
.po-currency-form .financial-multiselect-chip:has(input:checked) {
    background: rgba(14,165,233,0.2);
    border-color: rgba(14,165,233,0.5);
}
.financial-currency-default-badge,
.po-currency-default-badge {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.85rem;
}

/* Alerts – light, simple, uniform */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
    border: 1px solid transparent;
    box-shadow: none;
}
.alert:only-child { margin-bottom: 0; }
.alert a { color: var(--primary); text-decoration: underline; }
.alert a:hover { color: #38bdf8; }
.alert-dismissible,
.alert:has(.alert-close) { position: relative; padding-right: 2.25rem; }
.alert-close {
    position: absolute; top: 0.5rem; right: 0.5rem; width: 1.25rem; height: 1.25rem;
    padding: 0; border: none; background: transparent; color: inherit; opacity: 0.75;
    cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; line-height: 1;
}
.alert-close:hover { opacity: 1; background: rgba(255,255,255,0.12); }
[data-theme="light"] .alert-close:hover { background: rgba(0,0,0,0.08); }
.alert-success {
    background: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.35);
}
[data-theme="light"] .alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.3);
}
.alert-danger {
    background: rgba(244, 63, 94, 0.18);
    color: #fecdd3;
    border-color: rgba(244, 63, 94, 0.35);
}
[data-theme="light"] .alert-danger {
    background: rgba(244, 63, 94, 0.12);
    color: #991b1b;
    border-color: rgba(244, 63, 94, 0.3);
}
.alert-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fef3c7;
    border-color: rgba(245, 158, 11, 0.35);
}
[data-theme="light"] .alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.3);
}
.alert-info {
    background: rgba(14, 165, 233, 0.18);
    color: #bae6fd;
    border-color: rgba(14, 165, 233, 0.35);
}
[data-theme="light"] .alert-info {
    background: rgba(14, 165, 233, 0.12);
    color: #0c4a6e;
    border-color: rgba(14, 165, 233, 0.3);
}
.text-danger { color: var(--danger); }
.mb-3 { margin-bottom: 1rem; }

/* Empty monitored fields highlight (red - replaces orange) - rows and header */
.row-empty-field,
.sales-group-header.row-empty-field,
.guest-group-header.row-empty-field {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 2px solid var(--danger) !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.4);
}
.row-empty-field td,
.sales-group-header.row-empty-field td,
.guest-group-header.row-empty-field td {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Same-day excursions – same light style as other alerts */
.alert-same-day-excursions {
    background: rgba(131, 251, 247, 0.18) !important;
    color: #ccfbf1;
    border: 1px solid rgba(131, 251, 247, 0.4) !important;
}
[data-theme="light"] .alert-same-day-excursions {
    background: rgba(131, 251, 247, 0.12) !important;
    color: #134e4a !important;
    border: 1px solid rgba(131, 251, 247, 0.3) !important;
}
.alert-same-day-excursions .alert-close { color: inherit; opacity: 0.8; }
.row-same-day-excursions,
.sales-group-header.row-same-day-excursions,
.guest-group-header.row-same-day-excursions {
    background: rgba(131, 251, 247, 0.25) !important;
}
.row-same-day-excursions td,
.sales-group-header.row-same-day-excursions td,
.guest-group-header.row-same-day-excursions td {
    border-color: rgba(131, 251, 247, 0.4) !important;
}
/* When header has both empty and same-day, red (empty) takes precedence */
.sales-group-header.row-empty-field.row-same-day-excursions,
.guest-group-header.row-empty-field.row-same-day-excursions {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: var(--danger) !important;
}
.sales-group-header.row-empty-field.row-same-day-excursions td,
.guest-group-header.row-empty-field.row-same-day-excursions td {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Table highlights legend – compact, low profile */
.table-highlights-legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
    padding: 0.35rem 0; margin-bottom: 0.5rem; font-size: 0.72rem; color: var(--text-muted);
    opacity: 0.9;
}
.table-highlights-legend .legend-label { font-weight: 600; margin-right: 0.15rem; }
.table-highlights-legend .legend-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.table-highlights-legend .legend-swatch {
    display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 2px; flex-shrink: 0;
}
.table-highlights-legend .legend-red .legend-swatch { background: rgba(239, 68, 68, 0.4); border: 1px solid var(--danger); }
.table-highlights-legend .legend-cyan .legend-swatch { background: rgba(131, 251, 247, 0.4); border: 1px solid rgba(131, 251, 247, 0.6); }

/* Duplicate ticket / import duplicate row highlight (red background + border) - overrides empty when both apply */
.row-duplicate-ticket,
.import-preview-row-duplicate {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 2px solid var(--danger) !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.4);
}
.row-duplicate-ticket td,
.import-preview-row-duplicate td {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Status badges - Paid=Green, Cancelled=Red, Refunded=Orange */
.badge { display: inline-block; padding: 0.3rem 0.65rem; border-radius: 6px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-success { background: rgba(34,197,94,0.35); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
[data-theme="light"] .badge-success { background: rgba(34,197,94,0.15); color: #065f46; border: 1px solid rgba(34,197,94,0.3); }
.badge-danger { background: rgba(239,68,68,0.35); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
[data-theme="light"] .badge-danger { background: rgba(239,68,68,0.15); color: #991b1b; border: 1px solid rgba(239,68,68,0.3); }
.badge-warning { background: rgba(234,179,8,0.3); color: #fde047; border: 1px solid rgba(234,179,8,0.4); }
[data-theme="light"] .badge-warning { background: rgba(234,179,8,0.15); color: #854d0e; border: 1px solid rgba(234,179,8,0.3); }
.badge-refunded { background: rgba(249,115,22,0.35); color: #fdba74; border: 1px solid rgba(249,115,22,0.45); }
[data-theme="light"] .badge-refunded { background: rgba(249,115,22,0.15); color: #9a3412; border: 1px solid rgba(249,115,22,0.3); }
.badge-info { background: rgba(14,165,233,0.3); color: #7dd3fc; }
[data-theme="light"] .badge-info { background: rgba(14,165,233,0.15); color: #0c4a6e; border: 1px solid rgba(14,165,233,0.3); }
.badge-secondary { background: rgba(255,255,255,0.1); color: var(--text-muted); }
[data-theme="light"] .badge-secondary { background: rgba(0,0,0,0.08); color: var(--text-muted); }
/* Settings Weather – URL as visible badge */
.weather-link-url-badge { text-decoration: none; }
.weather-link-url-badge:hover .badge { opacity: 0.9; }
.weather-link-url-badge .badge { transition: opacity 0.15s ease; max-width: 100%; }
/* Settings Useful Links – URL as visible badge */
.useful-link-url-badge { text-decoration: none; }
.useful-link-url-badge:hover .badge { opacity: 0.9; }
.useful-link-url-badge .badge { transition: opacity 0.15s ease; max-width: 100%; }
/* Bootstrap-compatible background classes for badges (used in Language Management) */
.bg-success { background-color: rgba(34,197,94,0.35) !important; color: #86efac !important; }
[data-theme="light"] .bg-success { background-color: rgba(34,197,94,0.15) !important; color: #065f46 !important; }
.bg-info { background-color: rgba(14,165,233,0.3) !important; color: #7dd3fc !important; }
[data-theme="light"] .bg-info { background-color: rgba(14,165,233,0.15) !important; color: #0c4a6e !important; }
.bg-secondary { background-color: rgba(255,255,255,0.1) !important; color: var(--text-muted) !important; }
[data-theme="light"] .bg-secondary { background-color: rgba(0,0,0,0.08) !important; color: var(--text-muted) !important; }
.status-badge.bg-success { background-color: rgba(34,197,94,0.35) !important; color: #86efac !important; border: 1px solid rgba(34,197,94,0.4); }
[data-theme="light"] .status-badge.bg-success { background-color: rgba(34,197,94,0.15) !important; color: #065f46 !important; border: 1px solid rgba(34,197,94,0.3); }
.status-badge.bg-info { background-color: rgba(14,165,233,0.3) !important; color: #7dd3fc !important; border: 1px solid rgba(14,165,233,0.4); }
[data-theme="light"] .status-badge.bg-info { background-color: rgba(14,165,233,0.15) !important; color: #0c4a6e !important; border: 1px solid rgba(14,165,233,0.3); }
.status-badge.bg-secondary { background-color: rgba(255,255,255,0.1) !important; color: var(--text-muted) !important; border: 1px solid rgba(255,255,255,0.15); }
[data-theme="light"] .status-badge.bg-secondary { background-color: rgba(0,0,0,0.08) !important; color: var(--text-muted) !important; border: 1px solid rgba(0,0,0,0.12); }
/* Role badges - distinct colors per role */
.badge-role-admin { background: rgba(139,92,246,0.35); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.45); }
[data-theme="light"] .badge-role-admin { background: rgba(139,92,246,0.15); color: #5b21b6; border: 1px solid rgba(139,92,246,0.3); }
.badge-role-sales { background: rgba(34,197,94,0.35); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
[data-theme="light"] .badge-role-sales { background: rgba(34,197,94,0.15); color: #065f46; border: 1px solid rgba(34,197,94,0.3); }
.badge-role-office { background: rgba(14,165,233,0.3); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.4); }
[data-theme="light"] .badge-role-office { background: rgba(14,165,233,0.15); color: #0c4a6e; border: 1px solid rgba(14,165,233,0.3); }
.badge-role-financial { background: rgba(245,158,11,0.35); color: #fde047; border: 1px solid rgba(245,158,11,0.45); }
[data-theme="light"] .badge-role-financial { background: rgba(245,158,11,0.15); color: #854d0e; border: 1px solid rgba(245,158,11,0.3); }
.badge-role-user { background: rgba(148,163,184,0.35); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.4); }
[data-theme="light"] .badge-role-user { background: rgba(148,163,184,0.15); color: #334155; border: 1px solid rgba(148,163,184,0.3); }
.badge-role-guide { background: rgba(20,184,166,0.35); color: #5eead4; border: 1px solid rgba(20,184,166,0.4); }
[data-theme="light"] .badge-role-guide { background: rgba(20,184,166,0.15); color: #134e4a; border: 1px solid rgba(20,184,166,0.3); }
/* Section permissions (View / Edit) badges */
.badge-perm-view { background: rgba(34,197,94,0.35); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
[data-theme="light"] .badge-perm-view { background: rgba(34,197,94,0.15); color: #065f46; border: 1px solid rgba(34,197,94,0.3); }
.badge-perm-edit { background: rgba(14,165,233,0.3); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.4); }
[data-theme="light"] .badge-perm-edit { background: rgba(14,165,233,0.15); color: #0c4a6e; border: 1px solid rgba(14,165,233,0.3); }
.badge-perm-no { background: rgba(255,255,255,0.08); color: var(--text-muted); font-weight: 500; }
[data-theme="light"] .badge-perm-no { background: rgba(0,0,0,0.08); color: var(--text-muted); }
.section-permissions-details .summary-badges,
.permission-details .summary-badges { display: inline-flex; gap: 0.35rem; margin-left: 0.5rem; vertical-align: middle; }
.section-permissions-table th .badge { font-size: 0.72rem; }

/* Tour operator logo in guest/sales-history table – larger size */
.guest-to-logo {
    height: 36px; max-width: 96px; object-fit: contain; display: inline-block; vertical-align: middle;
}

/* Programs badges – excursions purchased by guest */
.guest-programs-cell { vertical-align: middle; }
.guest-programs-badges {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem;
}
.badge-programs {
    background: rgba(14,165,233,0.25); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.35);
    font-size: 0.72rem; padding: 0.2rem 0.5rem; white-space: nowrap;
}
[data-theme="light"] .badge-programs {
    background: rgba(14,165,233,0.15); color: #0c4a6e; border: 1px solid rgba(14,165,233,0.3);
}

/* Permission cards – separate, distinct, collapsed by default */
.card-permissions { margin-top: 1.5rem; }
.card-permissions .permission-details,
.card-permissions .section-permissions-details { margin: 0; }
.card-permissions .permission-details summary,
.card-permissions .section-permissions-details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.card-permissions .permission-details summary::-webkit-details-marker,
.card-permissions .section-permissions-details summary::-webkit-details-marker { display: none; }
.card-permissions .permission-details .summary-icon,
.card-permissions .section-permissions-details .summary-icon { transition: transform 0.2s ease; }
.card-permissions .permission-details[open] .summary-icon,
.card-permissions .section-permissions-details[open] .summary-icon { transform: rotate(180deg); }
.card-permissions .section-permissions-table { font-size: 0.9rem; }
.button-permissions-table .button-perm-section-header,
.button-visibility-table .button-perm-section-header {
    font-weight: 600; color: var(--primary); background: rgba(14,165,233,0.12);
    padding: 0.6rem 0.85rem; border-top: 1px solid rgba(255,255,255,0.08);
}
.button-permissions-table .button-perm-section-row:first-child .button-perm-section-header,
.button-visibility-table .button-perm-section-row:first-child .button-perm-section-header { border-top: none; }
.button-permissions-table tbody tr:not(.button-perm-section-row) td,
.button-visibility-table tbody tr:not(.button-perm-section-row) td {
    padding: 0.5rem 0.75rem; vertical-align: middle;
}
.section-visibility-table .section-visibility-group-header {
    font-weight: 600; color: var(--primary); background: rgba(14,165,233,0.12);
    padding: 0.5rem 0.75rem; border-top: 1px solid rgba(255,255,255,0.08);
}
.section-visibility-table .section-visibility-group-row:first-child .section-visibility-group-header { border-top: none; }
.badge-special-status { background: rgba(234,179,8,0.25); color: var(--text); font-size: 0.7rem; }

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--content-bg);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.08);
}
.login-logo { display: flex; justify-content: center; margin: 0 0 0.85rem; }
.login-logo img { max-width: 170px; width: 100%; height: auto; display: block; object-fit: contain; }
.login-card h1 { margin: 0 0 1.5rem; text-align: center; font-size: 1.5rem; }
.login-card .form-group { margin-bottom: 1.25rem; }
.login-card .btn { width: 100%; justify-content: center; padding: 0.75rem; margin-top: 0.5rem; }

/* Install wizard – same look as app (dark theme, cards, buttons) */
.install-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    background: var(--content-bg);
}
.install-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 560px;
}
.install-brand-icon { font-size: 1.5rem; flex-shrink: 0; }
.install-brand-text { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; color: var(--text); }
.install-title { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; margin-left: 0.25rem; }
.install-steps {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 560px;
}
.install-step-pill {
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(0,0,0,0.25);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.06);
}
.install-step-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}
.install-step-pill.done {
    background: rgba(16, 185, 129, 0.25);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}
.install-card {
    width: 100%;
    max-width: 560px;
}
.install-card .card { margin-bottom: 0; }
.install-card .card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1.1rem;
}
.install-card .card-title i { color: var(--primary); }
.install-ok { color: var(--success); font-weight: 500; }
.install-err { color: var(--danger); }
.install-tip {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    line-height: 1.5;
}
.install-tip ul { margin: 0.5rem 0 0 1rem; padding-left: 1.25rem; }
.install-tip li { margin-bottom: 0.35rem; }
.install-tip code { background: rgba(0,0,0,0.3); padding: 0.15em 0.4em; border-radius: 6px; font-size: 0.88em; }
.install-tip-access-denied { border-color: var(--danger); background: rgba(244, 63, 94, 0.08); }
.install-card .btn { margin-top: 1rem; }
.install-card .btn + .btn { margin-left: 0.5rem; }

/* Dashboard tiles */
.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.tile {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}
.tile-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.tile-label { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Inner / expanded tables (Sales History, Guest) - same elegant look */
.inner-table, .full-sale-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    border-radius: 10px;
    overflow: hidden;
}
.inner-table th, .full-sale-table th,
.inner-table td, .full-sale-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.inner-table th, .full-sale-table th {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}
.inner-table tbody tr:hover, .full-sale-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}
.inner-table .btn-icon, .full-sale-table .btn-icon {
    width: 32px;
    height: 32px;
    margin: 0 2px;
}

/* Pick up column: min width so it doesn't squeeze; person columns (Ad/Ch/Inf/Free/Qty): centered and readable */
.full-sale-table .col-pickup,
.inner-table.full-sale-table .col-pickup {
    min-width: 11rem;
    max-width: 14rem;
}
.full-sale-table .col-pax,
.inner-table.full-sale-table .col-pax {
    min-width: 2.75rem;
    width: 2.75rem;
    text-align: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    white-space: nowrap;
}

/* Line Price, Sub Total, Discount, Supplement, Amount Cancellation, Type, Motivation, Amount Received, by card, Payment: centered and readable */
.full-sale-table .col-center,
.inner-table.full-sale-table .col-center {
    text-align: center;
    min-width: 4.5rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

/* Sale date and Notes: wider columns so they are not stuck together */
.full-sale-table .col-saledate,
.inner-table.full-sale-table .col-saledate {
    text-align: center;
    min-width: 8rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.full-sale-table .col-notes,
.inner-table.full-sale-table .col-notes {
    text-align: center;
    min-width: 10rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Recap totals row: align with centered columns */
.full-sale-table .guest-summary-row .col-center,
.full-sale-table .sales-summary-row .col-center,
.inner-table.full-sale-table .guest-summary-row .col-center,
.inner-table.full-sale-table .sales-summary-row .col-center {
    text-align: center;
}

/* Responsive - full app adaptable to all devices */
@media (max-width: 992px) {
    .main-header { margin-left: 0 !important; }
    .app-offline-banner { margin-left: 0 !important; }
    .header-toggle { z-index: 250; position: relative; }
    .app-content-wrap { margin-left: 0 !important; padding: 1rem; padding-top: calc(var(--header-height) + 0.5rem); }
    .main-footer { margin-left: 0 !important; }
    .sidebar {
        width: var(--sidebar-width) !important;
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { z-index: 199; }
    .sidebar-overlay.visible { display: block; }
    body.sidebar-collapsed .app-content-wrap { margin-left: 0 !important; }
    body.sidebar-collapsed .main-footer { margin-left: 0 !important; }
    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .sidebar-link span { display: unset; opacity: unset; width: unset; height: unset; }
    .sidebar.collapsed .sidebar-brand { justify-content: flex-start; padding: 1.25rem 1.5rem; }
    .sidebar.collapsed .sidebar-link { justify-content: flex-start; padding: 0.75rem 1.5rem; }
    .sidebar.collapsed .sidebar-collapse-btn .sidebar-collapse-label,
    .sidebar.collapsed .sidebar-collapse-btn .sidebar-icon-collapse { display: unset; }
    .sidebar.collapsed .sidebar-collapse-btn .sidebar-icon-expand { display: none; }
    .sidebar.collapsed .sidebar-footer { justify-content: flex-start; }
    .card { border-radius: 12px; padding: 1.25rem; }
    .table-wrap { border-radius: 8px; }
}
@media (max-width: 768px) {
    .main-header { flex-wrap: wrap; height: auto; min-height: var(--header-height); padding: 0.75rem 1rem; gap: 0.5rem; }
    .main-title { font-size: 1.1rem; }
    .header-actions { gap: 0.5rem; }
    .header-actions .user-name { display: none; }
    .header-actions .user-role { display: none; }
    .app-content-wrap { padding: 0.75rem; max-width: 100%; }
    .data-table th, .data-table td { padding: 0.55rem 0.5rem; font-size: 0.8rem; }
    .data-table .btn-icon { width: 32px; height: 32px; min-width: 32px; min-height: 32px; font-size: 0.85rem; }
    .inner-table th, .inner-table td, .full-sale-table th, .full-sale-table td { padding: 0.5rem 0.4rem; font-size: 0.78rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .page-title { font-size: 1.25rem; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; min-width: 0; justify-content: center; }
    .card { padding: 1rem; border-radius: 12px; }
    .btn { padding: 0.5rem 0.85rem; font-size: 0.85rem; min-height: 44px; touch-action: manipulation; }
    .btn-sm { min-height: 42px; padding: 0.45rem 0.75rem; }
    .dashboard-tiles { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .tile { padding: 1rem; }
    .tile-value { font-size: 1.5rem; }
    .main-footer { padding: 0.75rem 1rem; font-size: 0.8rem; }
    .badge { padding: 0.25rem 0.5rem; font-size: 0.72rem; }
}
@media (max-width: 576px) {
    html { font-size: 15px; }
    .main-header { padding: 0.5rem 0.75rem; }
    .app-content-wrap { padding: 0.5rem; }
    .card { padding: 0.85rem; border-radius: 10px; margin-bottom: 1rem; }
    .dashboard-tiles { grid-template-columns: 1fr; }
    .table-wrap {
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
        padding: 0 0.25rem;
        border-radius: 8px;
    }
    .page-actions { flex-direction: column; }
    .page-actions .btn { width: 100%; min-height: 44px; }
    .data-table th, .data-table td { padding: 0.45rem 0.35rem; font-size: 0.75rem; }
    .data-table .btn-icon { width: 30px; height: 30px; min-width: 30px; min-height: 30px; }
    .btn-icon:hover { transform: none; }
    .btn:hover { transform: none; }
}
@media (min-width: 1200px) {
    .app-content-wrap { max-width: 1600px; margin-left: var(--sidebar-width); }
}
@media (min-width: 1400px) {
    .app-content-wrap { max-width: 90%; }
}

/* Guide (Profile Info modal) */
.guida-content { max-width: 100%; }
.guida-content .guida-logo { text-align: center; margin: 0 0 1rem; }
.guida-content .guida-logo img { max-width: 280px; height: auto; display: inline-block; }
.guida-content .guida-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9rem; }
.guida-content .guida-table th, .guida-content .guida-table td { border: 1px solid rgba(255,255,255,0.15); padding: 0.4rem 0.6rem; text-align: left; }
.guida-content .guida-table th { background: rgba(0,0,0,0.2); font-weight: 600; }

/* User status toggle (On/Off) - Add User / Edit User - dinamico, arrotondato, in linea con l'app */
.user-status-toggle-wrap {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    vertical-align: middle;
}
.user-status-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 36px;
    padding: 0 1rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    -webkit-tap-highlight-color: transparent;
    background: #10b981;
    color: #fff;
}
.user-status-btn.user-status-on {
    background: #10b981 !important;
    color: #fff !important;
}
.user-status-btn.user-status-on:hover {
    background: #059669 !important;
    color: #fff !important;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.4);
}
.user-status-btn.user-status-off {
    background: #f43f5e !important;
    color: #fff !important;
}
.user-status-btn.user-status-off:hover {
    background: #e11d48 !important;
    color: #fff !important;
    box-shadow: 0 2px 12px rgba(244, 63, 94, 0.4);
}
.user-status-on .user-status-off,
.user-status-off .user-status-on {
    display: none;
}
.user-status-on .user-status-on,
.user-status-off .user-status-off {
    display: inline;
}

/* User online/offline indicator - Users table */
.user-online-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
}
.user-online-indicator i.user-online {
    color: #22c55e;
    font-size: 0.9rem;
}
.user-online-indicator i.user-offline {
    color: #ef4444;
    font-size: 0.9rem;
}

/* User status badges in table - Active (green) / Disabled (red) */
.badge-status-active {
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
}
.badge-status-inactive {
    background: rgba(244, 63, 94, 0.25);
    color: #f43f5e;
}

/* Theme switch (Profile + header dropdown) – Theme Dark / Light with moon/sun icons */
.theme-switch-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.theme-switch-wrap label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}
.theme-switch-dl {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.theme-switch {
    position: relative;
    width: 56px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--border-default);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    border: none;
}
.theme-switch-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    z-index: 1;
    transition: color 0.2s ease;
}
.theme-switch-icon-dark { margin-right: 0; }
.theme-switch-icon-light { margin-left: 0; }
[data-theme="light"] .theme-switch-icon-dark { color: var(--text-muted); opacity: 0.7; }
[data-theme="light"] .theme-switch-icon-light { color: var(--primary); }
:root:not([data-theme="light"]) .theme-switch-icon-dark { color: var(--primary); }
:root:not([data-theme="light"]) .theme-switch-icon-light { color: var(--text-muted); opacity: 0.7; }
.theme-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text);
    transition: transform 0.2s ease;
    pointer-events: none;
}
[data-theme="light"] .theme-switch {
    background: var(--primary);
}
[data-theme="light"] .theme-switch::after {
    transform: translateX(24px);
}
.theme-switch:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.header-user-menu .theme-switch-row {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border-subtle);
}
.header-user-menu .theme-switch-wrap {
    padding: 0;
    margin: 0;
}
.header-user-menu .theme-switch-wrap label {
    font-size: 0.85rem;
}
.header-user-menu .theme-switch-dl {
    display: none;
}

/* Guest list (guest/index.php) – group header, detail table, summary row */
.guest-group-header { cursor: pointer; }
.guest-group-header:hover { background: rgba(255,255,255,0.06) !important; }
.guest-group-header .toggle-icon { transition: transform 0.2s; }
.guest-group-header.expanded .toggle-icon { transform: rotate(90deg); }
.guest-group-detail td { padding: 0 !important; vertical-align: top; background: rgba(0,0,0,0.15); }
.guest-group-detail .inner-table { width: 100%; border: 0; }
.guest-group-detail .inner-table th { padding: 0.5rem 1rem; font-size: 0.85rem; }
.guest-group-detail .inner-table td { padding: 0.5rem 1rem; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.guest-group-detail .sale-row { background: rgba(255,255,255,0.03); }
.guest-group-detail .item-row td { padding-left: 0.5rem; }
.inner-table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; margin: 0.5rem 0; }
.full-sale-table { min-width: 1400px; }
.full-sale-table th, .full-sale-table td { white-space: nowrap; }
.guest-summary-row { background: rgba(255,255,255,0.06); font-weight: 600; }
.guest-summary-row td { border-top: 2px solid rgba(255,255,255,0.2); }

/* Guest – import modal */
.import-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.import-modal-card { background: #1e293b; border-radius: 10px; padding: 1.5rem; max-width: 420px; width: 100%; border: 1px solid rgba(255,255,255,0.15); }
.import-modal-title { margin: 0 0 1rem 0; font-size: 1.1rem; }
.import-modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Guest – cancel/refund modal */
.refund-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.refund-modal-card { background: #1e293b; border-radius: 10px; padding: 1.5rem; max-width: 420px; width: 100%; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.refund-modal-title { margin: 0 0 1rem 0; font-size: 1.1rem; }
.refund-modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }
.refund-modal-overlay .form-hint { font-size: 0.85rem; color: var(--text-muted); display: block; margin-top: 0.25rem; }
.cancel-option.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Inline form (e.g. delete button in table) */
.form-inline { display: inline; }

/* Toast notifications */
.pos-toast-container { position: fixed; bottom: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; max-width: 90vw; pointer-events: none; }
.pos-toast-container > * { pointer-events: auto; }
.pos-toast { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); opacity: 0; transform: translateX(100%); transition: opacity 0.3s ease, transform 0.3s ease; min-width: 260px; max-width: 380px; }
.pos-toast-visible { opacity: 1; transform: translateX(0); }
.pos-toast-success { background: var(--success); color: #fff; }
.pos-toast-error { background: var(--danger); color: #fff; }
.pos-toast-info { background: var(--primary); color: #fff; }
.pos-toast-icon { flex-shrink: 0; font-size: 1.1rem; }
.pos-toast-message { flex: 1; font-size: 0.9rem; }
.pos-toast-btn { margin-left: 0.5rem; padding: 0.25rem 0.5rem; border: 1px solid rgba(255,255,255,0.8); background: transparent; color: #fff; border-radius: 4px; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.pos-toast-btn:hover { background: rgba(255,255,255,0.2); }

/* Touch targets ≥ 44px (mobile) */
@media (max-width: 768px) {
    .btn, .pos-cat-btn, .pos-excursion-item, .header-toggle, .header-user-trigger { min-height: 44px; min-width: 44px; }
    .btn.btn-sm { min-height: 40px; }
}
