:root {
    --sales-sidebar: #122832;
    --sales-sidebar-soft: #1d3c48;
    --sales-sidebar-active: #1d3c48;
    --sales-accent: #e2a93b;
    --sales-primary: #176b87;
    --sales-primary-dark: #0f4f63;
    --sales-bg: #f4f6f8;
    --sales-surface: #fff;
    --sales-border: #dce4ea;
    --sales-text: #172026;
    --sales-muted: #667782;
}

body { background: var(--sales-bg); color: var(--sales-text); font-family: Arial, Helvetica, sans-serif; font-size: 14px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; background: var(--sales-sidebar); color: #eaf3f6; z-index: 1030; box-shadow: 12px 0 30px rgba(15,36,46,.14); }
.app-main { margin-left: 264px; padding: 28px; min-height: 100vh; min-width: 0; }
.app-main.is-loading { cursor: progress; opacity: .72; pointer-events: none; transition: opacity .16s ease; }
.sidebar-inner { display: flex; flex-direction: column; min-height: 100vh; width: 100%; padding: 0; }
.sidebar-brand { display: flex; height: 76px; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand:hover { color: #fff; }
.brand-mark { width: 42px; height: 42px; border-radius: 8px; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 42px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand strong { display: block; font-size: 18px; line-height: 1.1; }
.sidebar-brand small, .sidebar-user small { display: block; color: rgba(234,243,246,.72); font-size: .76rem; margin-top: 3px; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 6px; overflow-y: auto; padding: 16px 12px; }
.sidebar-link, .sidebar-group { width: 100%; border: 0; border-radius: 8px; color: rgba(234,243,246,.82); background: transparent; text-decoration: none; padding: 11px 12px; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.sidebar-link { justify-content: flex-start; }
.sidebar-link span, .sidebar-group span { display: inline-flex; align-items: center; gap: 10px; min-width: 0; line-height: 1.25; }
.sidebar-link i, .sidebar-group i { display: inline-grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 6px; background: rgba(255,255,255,.09); color: #dce9ed; font-size: 12px; }
.sidebar-link:hover, .sidebar-group:hover, .sidebar-link.active, .sidebar-group:not(.collapsed) { background: var(--sales-sidebar-soft); color: #fff; }
.sidebar-group::after { content: "\f282"; font-family: "bootstrap-icons"; width: auto; height: auto; border: 0; font-size: .75rem; line-height: 1; transition: transform .18s ease; }
.sidebar-group:not(.collapsed)::after { transform: rotate(180deg); }
.sidebar-submenu { padding: 4px 0 8px 44px; }
.sidebar-submenu a { display: block; color: rgba(234,243,246,.72); text-decoration: none; border-left: 2px solid rgba(226,169,59,.3); padding: 8px 10px; font-size: 13px; font-weight: 650; }
.sidebar-submenu a:hover, .sidebar-submenu a.active { border-color: var(--sales-accent); color: #fff; }
.sidebar-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); background: transparent; padding: 16px 20px 20px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.sidebar-user strong { display: block; color: #fff; }
.sidebar-user small { color: rgba(234,243,246,.72); margin-bottom: 8px; }
.sidebar-user .btn { width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.page-head h1 { margin: 0; color: var(--sales-text); font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: 0; }
.page-head p { color: var(--sales-muted) !important; margin: 6px 0 0; font-size: 14px; }
.panel { background: var(--sales-surface); border: 1px solid var(--sales-border); border-radius: 8px; padding: 16px; box-shadow: 0 16px 34px rgba(15,36,46,.07); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid #e6eaf2; border-radius: 8px; padding: 16px; }
.stat-card span { color: #64748b; font-size: 13px; }
.stat-card strong { display: block; font-size: 28px; margin-top: 6px; }
.table td, .table th { vertical-align: middle; }
.work-panel { background: var(--sales-surface); border: 1px solid var(--sales-border); border-radius: 8px; padding: 16px; box-shadow: 0 16px 34px rgba(15,36,46,.07); }
.list-filter .form-label { color: #304156; font-size: 13px; font-weight: 800; }
.list-filter .btn,
.list-filter .form-control,
.list-filter .form-select { min-height: 38px; border-color: #cbd8ea; border-radius: 8px; }
.list-filter [data-list-filter-mode-toggle],
.list-filter .btn[type="submit"],
.list-filter .btn-light { min-width: 44px; min-height: 38px; display: inline-grid; place-items: center; padding-inline: 10px; }
.btn, .form-control, .form-select { border-radius: 8px; font-size: 14px; }
.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { --bs-btn-bg: var(--sales-primary); --bs-btn-border-color: var(--sales-primary); --bs-btn-hover-bg: var(--sales-primary-dark); --bs-btn-hover-border-color: var(--sales-primary-dark); --bs-btn-active-bg: var(--sales-primary-dark); --bs-btn-active-border-color: var(--sales-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--sales-primary); --bs-btn-border-color: var(--sales-primary); --bs-btn-hover-bg: var(--sales-primary); --bs-btn-hover-border-color: var(--sales-primary); }
.currency-input { font-variant-numeric: tabular-nums; }
.batch-field-toggle { align-items: center; display: flex; gap: 8px; font-weight: 700; min-height: 28px; }
.batch-mobile-bar { align-items: center; background: #172033; border-radius: 8px 8px 0 0; bottom: 0; box-shadow: 0 -10px 28px rgba(15,23,42,.18); color: #fff; display: flex; justify-content: space-between; left: 16px; padding: 12px 14px; position: fixed; right: 16px; z-index: 1040; }
.batch-mobile-bar[hidden] { display: none; }
.batch-mobile-bar span { color: #cbd5e1; font-size: 13px; }
.table-wrap { width: 100%; max-width: 100%; border: 1px solid var(--sales-border); border-radius: 8px; overflow-x: auto; }
.panel.table-wrap { padding: 12px; }
.table-wrap .sales-table { margin-bottom: 0; min-width: 760px; }
.panel.table-wrap .sales-table { border: 1px solid var(--sales-border); border-radius: 8px; overflow: hidden; }
.table-wrap .table > :not(caption) > * > * { padding: 10px 12px; font-size: 14px; }
.sales-table thead th { background: #edf3f6; border-bottom-color: #c8d8e6; color: #4d5f69; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; white-space: nowrap; }
.sales-table tbody td { color: #334155; }
.server-row-number { width: 56px; text-align: center; }
.server-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow-x: auto; }
.server-pagination-info { flex: 1 1 auto; min-width: 180px; color: #64748b; font-size: 13px; font-weight: 700; }
.server-pagination .pagination { flex: 0 0 auto; flex-wrap: nowrap; }
.server-pagination .page-link { min-height: 32px; display: inline-flex; align-items: center; color: #304156; border-color: #d9e2ef; padding: 8px 12px; }
.server-pagination .page-item.active .page-link { background: #1677f2; border-color: #1677f2; color: #fff; }
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { min-height: 38px; border: 1px solid #dbe4ef; border-radius: .5rem; background: #fff; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: .75rem; padding-right: 2rem; color: #263448; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: .5rem; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #8a9aaf; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple { border-color: #9bbce8; background: #fff; box-shadow: 0 0 0 .2rem rgba(64,123,191,.12); }
.select2-dropdown { overflow: hidden; border-color: #dbe4ef; border-radius: .65rem; box-shadow: 0 16px 34px rgba(15,36,46,.12); }
.select2-container--default .select2-search--dropdown { padding: 10px; background: #f8fbff; }
.select2-container--default .select2-search--dropdown .select2-search__field { min-height: 36px; padding: .45rem .65rem; border: 1px solid #dbe4ef; border-radius: .5rem; outline: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: #9bbce8; box-shadow: 0 0 0 .18rem rgba(64,123,191,.11); }
.select2-container--default .select2-results__option { padding: .55rem .75rem; color: #263448; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: #edf5ff; color: #1d4f8f; }
.select2-container--default .select2-results__option--selected { background: #f1f6fb; color: #1f3f64; }
.mobile-topbar { position: sticky; top: 0; z-index: 1010; background: #172033; color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 12px; }
@media (max-width: 991.98px) { .app-sidebar { display: none; } .app-main { margin-left: 0; padding: 14px 14px 92px; } .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .app-main { width: 100%; max-width: 100%; padding: 12px 10px calc(132px + env(safe-area-inset-bottom)); overflow-x: hidden; }
    .row { min-width: 0; }
    .page-head, .server-pagination { min-width: 0; flex-wrap: wrap; }
    .page-head > *, .server-pagination > * { min-width: 0; max-width: 100%; }
    .work-panel, .panel, .table-wrap { width: 100%; max-width: 100%; min-width: 0; padding: 12px; overflow: visible; }
    .select2-container { max-width: 100%; }
    .server-pagination { align-items: flex-start; flex-direction: column; }
    .server-pagination .pagination { flex-wrap: wrap; }
    .table-wrap { overflow-x: visible; }
    .table-wrap .sales-table,
    .table-wrap .sales-table thead,
    .table-wrap .sales-table tbody,
    .table-wrap .sales-table tr,
    .table-wrap .sales-table th,
    .table-wrap .sales-table td { display: block; width: 100%; min-width: 0; }
    .table-wrap .sales-table thead { display: none; }
    .table-wrap .sales-table tbody tr { background: #fff; border: 1px solid #d9e2ef; border-radius: 8px; margin-bottom: 12px; padding: 10px 12px; position: relative; }
    .table-wrap .sales-table tbody tr:has([data-batch-unit-check]) .server-row-number { padding-left: 42px; }
    .table-wrap .sales-table tbody td { border: 0; display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; text-align: right; }
    .table-wrap .sales-table tbody td::before { color: #64748b; content: attr(data-label); flex: 0 0 42%; font-weight: 700; text-align: left; }
    .table-wrap .sales-table tbody td:has([data-batch-unit-check]) { align-items: center; background: transparent; display: flex; flex-direction: column; gap: 4px; left: 8px; padding: 0; position: absolute; top: 12px; width: 36px; }
    .table-wrap .sales-table tbody td:has([data-batch-unit-check])::before { color: #64748b; content: 'Checklist'; display: block; flex: 0 0 auto; font-size: 10px; font-weight: 700; line-height: 1; text-align: center; }
    .table-wrap .sales-table tbody td:has([data-batch-unit-check]) .form-check-input { height: 24px; margin: 0; width: 24px; }
    .table-wrap .sales-table tbody td:last-child { justify-content: flex-end; }
    .table-wrap .sales-table tbody td:last-child::before { display: none; }
    .batch-unit-modal .modal-body { padding-bottom: 96px; }
    .batch-unit-modal .modal-footer { background: #fff; border-top: 1px solid #e5edf6; bottom: 0; left: 0; position: sticky; right: 0; }
    .batch-field-grid > [class*="col-"] { border: 1px solid #e5edf6; border-radius: 8px; padding: 12px; }
    .batch-field-toggle { font-size: 15px; }
    .batch-field-toggle .form-check-input { height: 20px; width: 20px; }
}
@media (max-width: 575.98px) { .stat-grid { grid-template-columns: 1fr; } .page-head { align-items: stretch; flex-direction: column; } }

/* Site plan editor */
.siteplan-legend{display:flex;flex-wrap:wrap;gap:12px}.siteplan-legend span{align-items:center;display:inline-flex;font-size:13px;gap:6px}.siteplan-legend i{border-radius:3px;display:inline-block;height:13px;width:13px}.siteplan-scroll{background:#e2e8f0;border-radius:10px;max-height:75vh;overflow:auto;padding:10px}.siteplan-stage{background:#fff;display:block;line-height:0;margin:auto;max-width:1400px;position:relative;width:100%}.siteplan-stage canvas,.siteplan-stage>img{display:block;height:auto;width:100%}.siteplan-stage svg{height:100%;inset:0;position:absolute;width:100%;z-index:2}.siteplan-stage svg polygon{cursor:pointer;stroke-width:2}.siteplan-stage [data-draft-polygon]{fill:#2563eb33;pointer-events:none;stroke:none}.siteplan-stage [data-draft-line]{fill:none;pointer-events:none;stroke:#2563eb;stroke-dasharray:7 5;stroke-width:2;vector-effect:non-scaling-stroke}.siteplan-stage [data-siteplan-labels]{inset:0;pointer-events:none;position:absolute;z-index:3}.siteplan-stage [data-siteplan-labels] span{color:#0f172a;font-size:11px;font-weight:800;line-height:1;position:absolute;text-shadow:0 1px 2px #fff;transform:translate(-50%,-50%);white-space:nowrap}.siteplan-stage.drawing{cursor:crosshair}.siteplan-stage.drawing [data-saved-paths]{pointer-events:none}.siteplan-vertex{background:#2563eb;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #2563eb;height:10px;pointer-events:none;position:absolute;transform:translate(-50%,-50%);width:10px;z-index:4}.siteplan-vertex.first{background:#fff;border-color:#2563eb;height:15px;width:15px}[data-siteplan-draw].active{background:#1d4ed8;border-color:#1d4ed8;color:#fff}
@media(max-width:767.98px){.siteplan-scroll{max-height:68vh;padding:5px}.siteplan-stage{min-width:700px}.siteplan-stage [data-siteplan-labels] span{font-size:10px}}
.siteplan-stage svg polygon.is-locked{cursor:not-allowed}.siteplan-stage svg polygon.selected{filter:drop-shadow(0 0 5px #2563eb);stroke:#1d4ed8;stroke-width:4}.siteplan-stage [data-sp-booking-labels]{inset:0;pointer-events:none;position:absolute;z-index:3}.siteplan-stage [data-sp-booking-labels] span{color:#0f172a;font-size:11px;font-weight:800;line-height:1;position:absolute;text-shadow:0 1px 2px #fff;transform:translate(-50%,-50%);white-space:nowrap}
[data-siteplan-booking-form] .modal-body{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}[data-sp-booking-wrap].siteplan-scroll{max-height:none;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x pan-y;-webkit-overflow-scrolling:touch}[data-sp-booking-stage],[data-sp-booking-stage] svg{touch-action:pan-x pan-y}
