:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #d9e2ec;
    --border-strong: #c4d0dc;
    --text: #102235;
    --muted: #5f7385;
    --primary: #d6a145;
    --primary-rgb: 31, 95, 139;
    --primary-soft: #e8f0f6;
    --primary-light: #4B8AB3;
    --primary-dark: #194E72;
    --primary-deep: #153E5B;
    --success: #1f7a4f;
    --danger: #9f2f2f;
    --shadow: 0 22px 50px rgba(16, 34, 53, 0.08);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(var(--primary-rgb), 0.1), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, #eef4f9 100%);
}

.auth-shell {
    width: min(100%, 560px);
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-brand strong {
    font-size: 1.35rem;
}

.auth-brand-logo {
    max-width: min(240px, 70vw);
    max-height: 72px;
    object-fit: contain;
}

.auth-locale-switch {
    display: flex;
    justify-content: end;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-card {
    width: min(520px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow);
    padding: 36px;
    display: grid;
    gap: 28px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.auth-card-copy h1,
.topbar-copy h1,
.panel-heading h2 {
    margin: 0;
}

.auth-card-copy p,
.topbar-copy p {
    color: var(--muted);
    margin: 12px 0 0;
    line-height: 1.7;
}

.auth-card-highlight {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.09), rgba(var(--primary-rgb), 0.03));
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}

.auth-card-highlight strong {
    display: block;
    margin-bottom: 4px;
}

.auth-card-highlight p {
    margin: 0;
    color: var(--muted);
}

.auth-highlight-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.form-grid {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.field span {
    font-size: 0.92rem;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text);
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field small {
    color: var(--muted);
    line-height: 1.6;
}

/* Number field with availability indicator */
.number-field-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.number-field-wrapper input {
    flex: 1;
}

.number-field-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    transition: background 0.3s, transform 0.3s;
}

.number-field-indicator.checking {
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    animation: spin 0.6s linear infinite;
}

.number-field-indicator.available {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(31, 122, 79, 0.2);
}

.number-field-indicator.unavailable {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(159, 47, 47, 0.2);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.number-field-message {
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.3s;
}

.number-field-message.available {
    color: var(--success);
}

.number-field-message.unavailable {
    color: var(--danger);
}

.field.is-available input {
    border-color: var(--success);
    background: rgba(31, 122, 79, 0.04);
}

.field.is-danger input {
    border-color: var(--danger);
    background: rgba(159, 47, 47, 0.04);
}

.field-stealth {
    display: none !important;
}

.form-muted-note {
    margin: -6px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-inline-end: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.primary-button,
.ghost-button,
.sidebar-link {
    transition: all 0.2s ease;
}

.primary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.admin-shell {
    min-height: 100vh;
}

.admin-page {
    overflow-x: hidden;
}

.admin-page.sidebar-open {
    overflow: hidden;
}

.admin-page.modal-open {
    overflow: hidden;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 290px;
    z-index: 50;
    background: #ffffff;
    color: var(--text);
    padding: 24px 18px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 20px;
    border-inline-end: 1px solid var(--border);
    box-shadow: 10px 0 30px rgba(16, 34, 53, 0.04);
    overflow-y: auto;
}

[dir='rtl'] .sidebar {
    inset: 0 0 0 auto;
    border-inline-end: none;
    border-inline-start: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(16, 34, 53, 0.04);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-section {
    padding: 0 6px;
}

.sidebar-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-logo-only {
    width: 100%;
    min-height: 54px;
}

.brand-logo {
    max-width: 100%;
    max-height: 54px;
    object-fit: contain;
    display: block;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.1);
}

.brand span {
    display: block;
    font-size: 0.88rem;
    color: var(--muted);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    align-content: start;
}

.sidebar-nav-group {
    display: grid;
    border: 0;
    background: transparent;
}

.sidebar-group-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    cursor: pointer;
}

.sidebar-group-summary::-webkit-details-marker {
    display: none;
}

.sidebar-nav-group[open] .sidebar-group-summary {
    background: rgba(var(--primary-rgb), 0.08);
}

.sidebar-nav-group.is-active[open] .sidebar-group-summary {
    background: var(--primary);
}

.sidebar-group-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-group-icon {
    color: var(--primary);
}

.sidebar-nav-group.is-active[open] .sidebar-group-icon,
.sidebar-nav-group.is-active[open] .sidebar-group-title,
.sidebar-nav-group.is-active[open] .sidebar-group-caret {
    color: #fff;
}

.sidebar-group-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.sidebar-group-caret {
    color: var(--muted);
    transition: transform 0.2s ease;
}

.sidebar-nav-group[open] .sidebar-group-caret {
    transform: rotate(180deg);
}

.sidebar-group-links {
    display: grid;
    gap: 4px;
    padding: 8px 0 10px 18px;
    padding-inline-start: 18px;
    padding-inline-end: 0;
}

.sidebar-link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    color: var(--text);
    border: 0;
    font-size: 0.96rem;
}

.sidebar-link .icon-svg {
    color: var(--primary);
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.sidebar-link.is-active,
.sidebar-link:hover {
    background: var(--primary-soft);
    color: var(--text);
}

.sidebar-link.is-active {
    color: var(--primary);
}

/* ── RTL sidebar fixes ─────────────────────────── */
[dir='rtl'] .sidebar-link {
    flex-direction: row-reverse;
    /* icone à droite du texte */
}

[dir='rtl'] .sidebar-group-main {
    flex-direction: row-reverse;
    /* icone à droite du titre */
}

[dir='rtl'] .sidebar-group-summary {
    flex-direction: row-reverse;
    /* caret à gauche, titre à droite */
}

.sidebar-footer {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.sidebar-footer span {
    font-size: 0.82rem;
    color: var(--muted);
}

.sidebar-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.sidebar-footer-actions form {
    margin: 0;
}

.sidebar-footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--primary);
    cursor: pointer;
}

.sidebar-footer-icon:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

.sidebar-overlay {
    display: none;
}

.icon-svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.icon-with-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icon-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}


.main-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    margin-left: 290px;
}

[dir='rtl'] .main-panel {
    margin-left: 0;
    margin-right: 290px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}

.topbar-heading-row {
    display: flex;
    align-items: start;
    gap: 14px;
}

.topbar-mobile-bar,
.topbar-mobile-tools {
    display: none;
}

.topbar-title-block {
    display: grid;
    gap: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-actions form {
    margin: 0;
}

.user-chip {
    display: grid;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.user-chip span {
    font-size: 0.82rem;
    color: var(--muted);
}

.user-chip-link:hover {
    border-color: var(--border-strong);
    box-shadow: 0 10px 24px rgba(16, 34, 53, 0.08);
}

.desktop-tool-button,
.desktop-profile-trigger {
    min-height: 48px;
    padding: 10px 14px;
    gap: 10px;
}

.desktop-tool-button span {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.desktop-notification-trigger {
    position: relative;
    padding-inline-end: 18px;
}

.topbar-notification-badge {
    position: absolute;
    top: 7px;
    inset-inline-end: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #b83333;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.desktop-profile-trigger {
    display: inline-flex;
    align-items: center;
    min-width: 220px;
    justify-content: space-between;
}

.desktop-profile-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--primary);
    flex: 0 0 34px;
}

.desktop-profile-copy {
    display: grid;
    flex: 1;
    text-align: start;
    gap: 2px;
}

.desktop-profile-copy span {
    font-size: 0.82rem;
    color: var(--muted);
}

.dropdown-caret {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.topbar-dropdown.is-open .dropdown-caret {
    transform: rotate(180deg);
}

.desktop-dropdown-menu {
    min-width: 230px;
}

.icon-button {
    gap: 8px;
}

.topbar-dropdown {
    position: relative;
}

.mobile-tool-button {
    width: 48px;
    height: 48px;
    padding: 0;
    position: relative;
}

.mobile-tool-code {
    position: absolute;
    inset-inline-end: 6px;
    inset-block-end: 5px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--primary);
}

.mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    min-width: 220px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 44px rgba(16, 34, 53, 0.16);
    display: none;
    z-index: 30;
}

.topbar-dropdown.is-open .mobile-dropdown-menu {
    display: grid;
    gap: 8px;
}

.mobile-dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 12px 14px;
    border-radius: 14px;
    display: grid;
    gap: 2px;
    text-align: start;
    color: var(--text);
    cursor: pointer;
}

.mobile-dropdown-item span {
    color: var(--muted);
    font-size: 0.82rem;
}

.notification-item.notification-success {
    border-inline-start: 4px solid var(--success);
}

.notification-item.notification-danger {
    border-inline-start: 4px solid var(--danger);
}

.notification-item.notification-warning {
    border-inline-start: 4px solid #ae7410;
}

.notification-form {
    margin: 0;
    padding: 0;
    display: contents;
}

/* Notification dropdown — scroll interne */
.desktop-notification-menu,
.topbar-dropdown.is-open .mobile-dropdown-menu:has(.notification-item) {
    max-height: min(420px, 70vh);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar fine */
.desktop-notification-menu::-webkit-scrollbar,
.mobile-dropdown-menu::-webkit-scrollbar {
    width: 4px;
}

.desktop-notification-menu::-webkit-scrollbar-track,
.mobile-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.desktop-notification-menu::-webkit-scrollbar-thumb,
.mobile-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
}


.mobile-dropdown-item.is-active,
.mobile-dropdown-item:hover,
.mobile-dropdown-item-plain:hover {
    background: var(--surface-soft);
}

.mobile-dropdown-item-plain {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-dropdown-item-plain span {
    font-size: 0.92rem;
    color: var(--text);
}

.mobile-dropdown-meta {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-soft);
}

.mobile-dropdown-meta span {
    color: var(--muted);
    font-size: 0.82rem;
}

.sidebar-toggle,
.sidebar-close {
    display: none;
}

.content-area {
    padding: 28px;
    display: grid;
    gap: 24px;
}

.content-area>*,
.content-grid>*,
.stats-grid>*,
.dashboard-cards>*,
.dashboard-insights>*,
.cash-grid>*,
.cash-metrics>*,
.grid-2>*,
.grid-3>*,
.detail-grid>*,
.mini-stats>* {
    min-width: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
    align-items: end;
}

.toolbar-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.compact-field span {
    font-size: 0.82rem;
}

.inline-actions,
.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

.table-actions {
    justify-content: end;
}

.table-actions .primary-button,
.table-actions .ghost-button {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 0.88rem;
}

.table-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.table-icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    box-shadow: 0 10px 18px rgba(16, 34, 53, 0.08);
}

.table-icon-button.is-info {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.18);
}

.table-icon-button.is-edit {
    color: #415160;
    background: rgba(95, 115, 133, 0.08);
    border-color: rgba(95, 115, 133, 0.18);
}

.table-icon-button.is-accent {
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.table-icon-button.is-success {
    color: var(--success);
    background: rgba(31, 122, 79, 0.08);
    border-color: rgba(31, 122, 79, 0.18);
}

.table-icon-button.is-danger {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.table-icon-button.is-danger:hover {
    background: #842222;
    border-color: #842222;
    color: #fff;
}

.admin-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 80;
}

.admin-modal.is-open {
    display: block;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 34, 53, 0.58);
    backdrop-filter: blur(4px);
}

.admin-modal-dialog {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 36px 20px;
    display: grid;
    place-items: center;
}

.admin-modal-panel {
    width: min(100%, 920px);
    max-height: calc(100vh - 72px);
    overflow: auto;
}

.admin-modal-panel .panel-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.mini-stats article {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.mini-stats span {
    color: var(--muted);
    font-size: 0.84rem;
}

.mini-stats strong {
    font-size: 1.1rem;
}

.grid-2,
.grid-3,
.grid-4,
.detail-grid,
.checkbox-grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sale-hotel-grid,
.purchase-reservation-grid {
    align-items: end;
}

.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid div {
    display: grid;
    gap: 6px;
}

.detail-grid strong,
.group-label {
    font-size: 0.9rem;
    color: var(--muted);
}

.detail-grid span {
    line-height: 1.7;
}

.field-group {
    display: grid;
    gap: 12px;
}

.checkbox-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.color-picker-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.color-picker-field input[type='color'] {
    width: 56px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.color-picker-field code {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.settings-row-actions {
    white-space: nowrap;
}

.drag-handle {
    cursor: grab;
}

[data-package-price-row].is-dragging,
[data-sale-service-row].is-dragging {
    opacity: 0.55;
}

.settings-media-grid {
    align-items: start;
}

.settings-tabs-shell {
    display: grid;
    gap: 18px;
}

.settings-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    position: sticky;
    top: 88px;
    z-index: 5;
}

.settings-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s ease;
}

.settings-tab-button:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.settings-tab-button.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.18);
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.is-active {
    display: block;
}

.availability-tabs-shell {
    display: grid;
    gap: 18px;
}

.settings-media-preview {
    display: grid;
    place-items: center;
    min-height: 126px;
    padding: 16px;
    border-radius: 18px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-soft);
}

.settings-media-image {
    max-width: 100%;
    max-height: 76px;
    object-fit: contain;
}

.settings-favicon-preview {
    justify-items: start;
}

.settings-favicon-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.checkbox-card,
.checkbox-row {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.checkbox-row {
    min-height: 52px;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.nested-panel {
    box-shadow: none;
    background: var(--surface-soft);
}

.workflow-note,
.package-selection-summary {
    display: flex;
    gap: 10px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--primary-soft);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}

.workflow-note span,
.package-selection-summary span {
    color: var(--muted);
    line-height: 1.7;
}

.small-button {
    min-width: 42px;
}

.line-items-table input,
.line-items-table select {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    background: #eef2f6;
    color: var(--text);
}

.money-balance {
    font-weight: 800;
}

.money-balance.is-positive {
    color: white
}

.money-balance.is-negative {
    color: var(--danger);
}

.data-table .money-balance.is-positive {
    color: var(--success);
}

.data-table .money-balance.is-negative {
    color: var(--danger);
}

.purchase-type-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    background: #f6f9fc;
    border: 1px solid #d8e2f0;
    color: var(--muted);
}

.purchase-type-banner strong {
    color: var(--text);
    font-size: 1rem;
}

.purchase-type-banner[data-type="reservation"] {
    background: #eef8f2;
    border-color: #bfe1cb;
}

.purchase-type-banner[data-type="visa"],
.purchase-type-banner[data-type="transport"] {
    background: #f8f4ec;
    border-color: #e7d4ae;
}

.purchase-reservation-grid {
    align-items: end;
}

.status-paid,
.status-incoming,
.status-open,
.status-confirmed,
.status-new,
.status-free,
.status-active {
    background: rgba(31, 122, 79, 0.12);
    color: var(--success);
}

.status-cancelled,
.status-outgoing,
.status-occupied,
.status-ongoing {
    background: rgba(159, 47, 47, 0.12);
    color: var(--danger);
}

.status-draft,
.status-partially_paid,
.status-paid_partially,
.status-closed,
.status-upcoming {
    background: rgba(196, 138, 22, 0.14);
    color: #ae7410;
}

.status-completed,
.status-inactive {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.print-page {
    background: #fff;
}

.print-shell {
    width: min(960px, calc(100vw - 40px));
    margin: 24px auto;
}

.print-panel {
    box-shadow: none;
}

.print-header {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.7fr);
    gap: 20px;
    align-items: start;
    padding: 22px 24px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
}

.print-company {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.print-logo-wrap {
    width: 92px;
    min-width: 92px;
    min-height: 92px;
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
}

.print-logo {
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.print-company-copy {
    display: grid;
    gap: 8px;
}

.print-company-copy strong {
    font-size: 1.25rem;
}

.print-company-copy span {
    color: var(--muted);
    line-height: 1.55;
}

.print-company-address {
    max-width: 70ch;
}

.print-company-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    margin-top: 2px;
}

.print-company-column {
    display: grid;
    gap: 4px;
    font-size: 0.9rem;
}

.print-company-legal {
    margin-top: 4px;
    font-size: 0.88rem;
}

.print-document-meta {
    display: grid;
    gap: 10px;
    justify-items: end;
    text-align: end;
}

.print-document-reference {
    display: grid;
    gap: 2px;
    justify-items: end;
}

.print-document-reference small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.print-document-reference strong {
    font-size: 1rem;
    line-height: 1.2;
}

.print-document-meta h1 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.2;
}

.print-document-meta span {
    color: var(--muted);
    font-size: 0.92rem;
}

.print-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
}

.flash {
    margin: 20px 28px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    max-width: min(520px, calc(100% - 56px));
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.92rem;
    line-height: 1.4;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.flash.success {
    border-color: rgba(31, 122, 79, 0.24);
    background: rgba(31, 122, 79, 0.08);
}

.flash.error {
    border-color: rgba(159, 47, 47, 0.24);
    background: rgba(159, 47, 47, 0.08);
}

.flash ul {
    margin: 0;
    padding-inline-start: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 22px;
    align-items: end;
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.dashboard-hero-copy h2 {
    margin: 14px 0 8px;
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
}

.dashboard-hero-copy p {
    margin: 0;
    color: var(--muted);
    max-width: 58ch;
}

.dashboard-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(196, 208, 220, 0.7);
}

.dashboard-filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    grid-column: 1 / -1;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-insights {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 22px;
    display: grid;
    gap: 10px;
}

.stat-card span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
}

.stat-card strong {
    font-size: 1.8rem;
    color: #fff;
}

.stat-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.stat-card strong small {
    display: inline-block;
    margin-inline-start: 6px;
    font-size: 0.72em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.money-value {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    direction: ltr;
    unicode-bidi: isolate;
}

.money-number,
.money-currency {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.money-number {
    font-variant-numeric: tabular-nums;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

.stat-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
}

.stat-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.stat-card-primary {
    background: linear-gradient(135deg, #1f5f8b, #2a7ab5);
    border-color: #1a4e73;
}

.stat-card-primary .stat-icon,
.stat-card-primary .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-success {
    background: linear-gradient(135deg, #1f7a4f, #28a36a);
    border-color: #1a6642;
}

.stat-card-success .stat-icon,
.stat-card-success .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-danger {
    background: linear-gradient(135deg, #9f2f2f, #c73d3d);
    border-color: #852727;
}

.stat-card-danger .stat-icon,
.stat-card-danger .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-warning {
    background: linear-gradient(135deg, #c48816, #e8a31e);
    border-color: #a87313;
}

.stat-card-warning .stat-icon,
.stat-card-warning .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-secondary {
    background: linear-gradient(135deg, #536677, #6b8297);
    border-color: #465766;
}

.stat-card-secondary .stat-icon,
.stat-card-secondary .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-slate {
    background: linear-gradient(135deg, #2f4659, #405e77);
    border-color: #26394a;
}

.stat-card-slate .stat-icon,
.stat-card-slate .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-info {
    background: linear-gradient(135deg, #1f5f8b, #3a8bc4);
    border-color: #1a4e73;
}

.stat-card-info .stat-icon,
.stat-card-info .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.currency-groups {
    display: grid;
    gap: 18px;
}

.currency-group {
    border: 1px solid rgba(196, 208, 220, 0.72);
    border-radius: 20px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(249, 251, 255, 0.92), #fff 56%);
}

.currency-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(196, 208, 220, 0.7);
}

.currency-group-head>div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.currency-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

.entity-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
}

.entity-hero-agency {
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.18), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
}

.entity-hero-supplier {
    background:
        radial-gradient(circle at top right, rgba(196, 138, 22, 0.18), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #fff8eb 100%);
}

.entity-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.entity-hero-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 18px 34px rgba(31, 53, 84, 0.1);
}

.entity-hero-supplier .entity-hero-icon {
    color: #ae7410;
}

.entity-hero-icon .icon-svg {
    width: 40px;
    height: 40px;
}

.entity-hero-copy h2 {
    margin: 8px 0 6px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.entity-hero-copy p {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

.entity-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.entity-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.entity-summary-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 8px;
    padding: 22px;
    border-radius: 22px;
    border: 1px solid rgba(196, 208, 220, 0.72);
    background: #fff;
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.06);
}

.entity-summary-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -24px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.34);
}

.entity-summary-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.entity-summary-icon .icon-svg {
    width: 28px;
    height: 28px;
}

.entity-summary-card span {
    color: rgba(255, 255, 255, 0.84);
    font-weight: 600;
}

.entity-summary-card strong {
    color: #fff;
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
}

.entity-summary-card.tone-blue {
    background: linear-gradient(135deg, #1f5ea8 0%, #3e88d6 100%);
}

.entity-summary-card.tone-red {
    background: linear-gradient(135deg, #a81f1f 0%, #b53d3d 100%);
}

.entity-summary-card.tone-green {
    background: linear-gradient(135deg, #0f7a52 0%, #22a06b 100%);
}

.entity-summary-card.tone-amber {
    background: linear-gradient(135deg, #bb7b10 0%, #e0a62a 100%);
}

.entity-summary-card.tone-slate {
    background: linear-gradient(135deg, #31475f 0%, #526b86 100%);
}

.entity-detail-panel,
.entity-note-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f9fbfe 100%);
}

.entity-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.entity-detail-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(196, 208, 220, 0.74);
}

.entity-detail-card-wide {
    grid-column: span 2;
}

.entity-detail-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.entity-detail-card-icon .icon-svg {
    width: 24px;
    height: 24px;
}

.entity-detail-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.entity-detail-card strong {
    font-size: 1rem;
    line-height: 1.55;
}

.entity-note-copy {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

.ring-grid {
    display: grid;
    gap: 18px;
}

.ring-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.ring-card span {
    color: var(--muted);
}

.ring-visual {
    --track: rgba(16, 34, 53, 0.08);
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring-color) var(--progress), var(--track) 0);
}

.ring-center {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    gap: 4px;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(16, 34, 53, 0.06);
}

.ring-center strong {
    font-size: 1.1rem;
}

.ring-primary {
    --ring-color: var(--primary);
}

.ring-warning {
    --ring-color: #ae7410;
}

.ring-success {
    --ring-color: var(--success);
}

.dashboard-chart-section {
    display: block;
    width: 100%;
}

.dashboard-chart-section .panel {
    width: 100%;
}

.dashboard-chart {
    display: flex;
    align-items: end;
    gap: 32px;
    min-height: 450px;
    overflow-x: auto;
    padding-bottom: 8px;
    padding-top: 20px;
}

.dual-bars {
    gap: 20px;
}

.dual-bars .chart-bar {
    width: 56px;
    border-radius: 12px 12px 4px 4px;
}

.chart-bar.sales {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
}

.chart-bar.purchases {
    background: linear-gradient(180deg, #d39b2a 0%, #ae7410 100%);
}

.chart-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.sales {
    background: var(--primary);
}

.legend-dot.purchases {
    background: #ae7410;
}

.legend-dot.free {
    background: var(--success);
}

.legend-dot.occupied {
    background: var(--danger);
}

.legend-dot.selected {
    background: var(--primary-dark);
}

/* ── Dashboard Modern Styles ── */

/* Hero / Filter */
.dash-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
    gap: 22px;
    align-items: end;
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    box-shadow: 0 24px 60px rgba(16, 34, 53, 0.09);
    margin-bottom: 24px;
}

.dash-hero-copy h2 {
    margin: 14px 0 8px;
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
}

.dash-hero-copy p {
    margin: 0;
    color: var(--muted);
    max-width: 58ch;
}

.dash-hero-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(196, 208, 220, 0.7);
}

.dash-hero-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    grid-column: 1 / -1;
}

.dash-shortcuts-panel {
    margin-bottom: 24px;
}

.dash-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dash-shortcut-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 140px;
    padding: 22px;
    border-radius: 22px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(16, 34, 53, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-shortcut-card::after {
    content: '';
    position: absolute;
    inset: auto -30px -30px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.dash-shortcut-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 46px rgba(16, 34, 53, 0.16);
}

.dash-shortcut-icon {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(4px);
}

.dash-shortcut-icon .icon-svg {
    width: 38px;
    height: 38px;
    color: #fff;
}

.dash-shortcut-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
}

.dash-shortcut-label {
    font-size: 0.92rem;
    font-weight: 700;
    opacity: 0.94;
}

.dash-shortcut-count {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1;
    color: #fff;
}

.dash-shortcut-copy small {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.88);
}

.dash-shortcut-primary {
    background: linear-gradient(135deg, #1f5f8b 0%, #3c8fcc 100%);
}

.dash-shortcut-success {
    background: linear-gradient(135deg, #1f7a4f 0%, #2ab56f 100%);
}

.dash-shortcut-info {
    background: linear-gradient(135deg, #176b93 0%, #2da7da 100%);
}

.dash-shortcut-warning {
    background: linear-gradient(135deg, #c48816 0%, #f0b030 100%);
}

.dash-shortcut-danger {
    background: linear-gradient(135deg, #9f2f2f 0%, #d64f4f 100%);
}

.dash-shortcut-secondary {
    background: linear-gradient(135deg, #536677 0%, #768ea6 100%);
}

/* Stat Cards Grid */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.dash-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px 16px;
    border-radius: 18px;
    color: #fff;
    overflow: hidden;
    min-height: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.dash-card-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.dash-card-icon .icon-svg {
    width: 26px;
    height: 26px;
}

.dash-card-body {
    flex: 1;
    min-width: 0;
}

.dash-card-label {
    display: block;
    font-size: 0.82rem;
    opacity: 0.85;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-card-value {
    font-size: 1.35rem;
    line-height: 1.2;
    display: block;
}

.dash-card-value .money-currency {
    font-size: 0.65em;
    opacity: 0.75;
    font-weight: 600;
}

.dash-card-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.12);
}

.dash-card-bar span {
    display: block;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 0 2px 0 0;
    transition: width 0.6s ease;
}

/* Card colors */
.dash-card-primary {
    background: linear-gradient(135deg, #1f5f8b 0%, #2a7ab5 100%);
}

.dash-card-success {
    background: linear-gradient(135deg, #1f7a4f 0%, #28a36a 100%);
}

.dash-card-danger {
    background: linear-gradient(135deg, #9f2f2f 0%, #c73d3d 100%);
}

.dash-card-warning {
    background: linear-gradient(135deg, #c48816 0%, #e8a31e 100%);
}

.dash-card-secondary {
    background: linear-gradient(135deg, #536677 0%, #6b8297 100%);
}

.dash-card-slate {
    background: linear-gradient(135deg, #2f4659 0%, #405e77 100%);
}

.dash-card-info {
    background: linear-gradient(135deg, #1f5f8b 0%, #3a8bc4 100%);
}

/* Middle Section */
.dash-mid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.dash-rings-panel {
    align-self: start;
}

.dash-rings {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 18px;
}

.dash-ring-item {
    display: grid;
    justify-items: center;
    gap: 12px;
    text-align: center;
}

.dash-ring-item span {
    color: var(--muted);
    font-size: 0.84rem;
}

/* Ring */
.dash-ring {
    --track: rgba(16, 34, 53, 0.08);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring-color) var(--p), var(--track) 0);
}

.dash-ring-inner {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    gap: 2px;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(16, 34, 53, 0.06);
}

.dash-ring-inner strong {
    font-size: 1rem;
    display: block;
}

.dash-ring-inner .icon-svg {
    width: 18px;
    height: 18px;
}

.dash-ring-primary {
    --ring-color: var(--primary);
}

.dash-ring-warning {
    --ring-color: #ae7410;
}

.dash-ring-success {
    --ring-color: var(--success);
}

/* Chart Panel */
.dash-chart-panel {
    overflow: hidden;
}

.dash-chart-panel .panel-heading {
    margin-bottom: 8px;
}

.dash-chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.84rem;
}

.dash-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Chart */
.dash-chart {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    min-height: 340px;
    overflow-x: auto;
    padding: 20px 0 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.85) 0%, rgba(255, 255, 255, 0.95) 100%),
        repeating-linear-gradient(0deg, transparent 0 54px, rgba(148, 163, 184, 0.14) 55px 56px);
}

.dash-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 74px;
}

.dash-chart-lbl {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 280px;
}

.dash-chart-bar {
    width: 40px;
    border-radius: 8px 8px 3px 3px;
    transition: height 0.5s ease;
    min-height: 0;
    box-shadow: 0 8px 18px rgba(16, 34, 53, 0.13);
}

.dash-chart-bar.sales {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
}

.dash-chart-bar.purchases {
    background: linear-gradient(180deg, #d39b2a 0%, #ae7410 100%);
}

/* Bottom Section */
.dash-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.dash-groups {
    display: grid;
    gap: 14px;
}

.dash-group {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--surface-soft);
}

.dash-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.dash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(16, 34, 53, 0.06);
}

.dash-row:last-child {
    border-bottom: 0;
}

.dash-row-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.dash-row-info strong {
    display: block;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-row-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 34, 53, 0.06);
    max-width: 160px;
    margin-top: 4px;
}

.dash-row-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
    transition: width 0.5s ease;
}

.dash-row-bar.warning span {
    background: linear-gradient(90deg, #d39b2a 0%, #ae7410 100%);
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .dash-shortcuts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-mid {
        grid-template-columns: 1fr;
    }

    .dash-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .dash-hero {
        grid-template-columns: 1fr;
    }

    .dash-hero-filter {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .dash-shortcuts {
        grid-template-columns: 1fr;
    }

    .dash-shortcut-card {
        min-height: 124px;
        padding: 18px;
    }

    .dash-shortcut-icon {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }

    .dash-shortcut-icon .icon-svg {
        width: 32px;
        height: 32px;
    }

    .dash-cards {
        grid-template-columns: 1fr;
    }

    .dash-card-value {
        font-size: 1.1rem;
    }

    .dash-chart {
        gap: 18px;
        min-height: 280px;
    }

    .dash-chart-bars {
        height: 220px;
    }

    .dash-chart-bar {
        width: 30px;
    }
}

.rank-cell {
    display: grid;
    gap: 8px;
}

.inline-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 34, 53, 0.08);
}

.inline-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
}

.inline-progress.warning span {
    background: linear-gradient(90deg, #d39b2a 0%, #ae7410 100%);
}

.stat-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.stat-card strong small {
    display: inline-block;
    margin-inline-start: 6px;
    font-size: 0.72em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.money-value {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    direction: ltr;
    unicode-bidi: isolate;
}

.money-number,
.money-currency {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.money-number {
    font-variant-numeric: tabular-nums;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
}

.stat-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
}

.stat-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.stat-card-primary {
    background: linear-gradient(135deg, #1f5f8b, #2a7ab5);
    border-color: #1a4e73;
}

.stat-card-primary .stat-icon,
.stat-card-primary .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-success {
    background: linear-gradient(135deg, #1f7a4f, #28a36a);
    border-color: #1a6642;
}

.stat-card-success .stat-icon,
.stat-card-success .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-danger {
    background: linear-gradient(135deg, #9f2f2f, #c73d3d);
    border-color: #852727;
}

.stat-card-danger .stat-icon,
.stat-card-danger .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-warning {
    background: linear-gradient(135deg, #c48816, #e8a31e);
    border-color: #a87313;
}

.stat-card-warning .stat-icon,
.stat-card-warning .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-secondary {
    background: linear-gradient(135deg, #536677, #6b8297);
    border-color: #465766;
}

.stat-card-secondary .stat-icon,
.stat-card-secondary .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-slate {
    background: linear-gradient(135deg, #2f4659, #405e77);
    border-color: #26394a;
}

.stat-card-slate .stat-icon,
.stat-card-slate .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-card-info {
    background: linear-gradient(135deg, #1f5f8b, #3a8bc4);
    border-color: #1a4e73;
}

.stat-card-info .stat-icon,
.stat-card-info .stat-progress span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.currency-groups {
    display: grid;
    gap: 18px;
}

.currency-group {
    border: 1px solid rgba(196, 208, 220, 0.72);
    border-radius: 20px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(249, 251, 255, 0.92), #fff 56%);
}

.currency-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(196, 208, 220, 0.7);
}

.currency-group-head>div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.currency-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

.entity-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
}

.entity-hero-agency {
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.18), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
}

.entity-hero-supplier {
    background:
        radial-gradient(circle at top right, rgba(196, 138, 22, 0.18), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #fff8eb 100%);
}

.entity-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.entity-hero-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 18px 34px rgba(31, 53, 84, 0.1);
}

.entity-hero-supplier .entity-hero-icon {
    color: #ae7410;
}

.entity-hero-icon .icon-svg {
    width: 40px;
    height: 40px;
}

.entity-hero-copy h2 {
    margin: 8px 0 6px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.entity-hero-copy p {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

.entity-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.entity-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.entity-summary-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 8px;
    padding: 22px;
    border-radius: 22px;
    border: 1px solid rgba(196, 208, 220, 0.72);
    background: #fff;
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.06);
}

.entity-summary-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -24px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.34);
}

.entity-summary-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.entity-summary-icon .icon-svg {
    width: 28px;
    height: 28px;
}

.entity-summary-card span {
    color: rgba(255, 255, 255, 0.84);
    font-weight: 600;
}

.entity-summary-card strong {
    color: #fff;
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
}

.entity-summary-card.tone-blue {
    background: linear-gradient(135deg, #1f5ea8 0%, #3e88d6 100%);
}

.entity-summary-card.tone-red {
    background: linear-gradient(135deg, #a81f1f 0%, #b53d3d 100%);
}

.entity-summary-card.tone-green {
    background: linear-gradient(135deg, #0f7a52 0%, #22a06b 100%);
}

.entity-summary-card.tone-amber {
    background: linear-gradient(135deg, #bb7b10 0%, #e0a62a 100%);
}

.entity-summary-card.tone-slate {
    background: linear-gradient(135deg, #31475f 0%, #526b86 100%);
}

.entity-detail-panel,
.entity-note-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f9fbfe 100%);
}

.entity-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.entity-detail-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(196, 208, 220, 0.74);
}

.entity-detail-card-wide {
    grid-column: span 2;
}

.entity-detail-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.entity-detail-card-icon .icon-svg {
    width: 24px;
    height: 24px;
}

.entity-detail-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.entity-detail-card strong {
    font-size: 1rem;
    line-height: 1.55;
}

.entity-note-copy {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

.ring-grid {
    display: grid;
    gap: 18px;
}

.ring-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.ring-card span {
    color: var(--muted);
}

.ring-visual {
    --track: rgba(16, 34, 53, 0.08);
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring-color) var(--progress), var(--track) 0);
}

.ring-center {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    gap: 4px;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(16, 34, 53, 0.06);
}

.ring-center strong {
    font-size: 1.1rem;
}

.ring-primary {
    --ring-color: var(--primary);
}

.ring-warning {
    --ring-color: #ae7410;
}

.ring-success {
    --ring-color: var(--success);
}

.chart-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.sales {
    background: var(--primary);
}

.legend-dot.purchases {
    background: #ae7410;
}

.legend-dot.free {
    background: var(--success);
}

.legend-dot.occupied {
    background: var(--danger);
}

.legend-dot.selected {
    background: var(--primary-dark);
}

.rank-cell {
    display: grid;
    gap: 8px;
}

.inline-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16, 34, 53, 0.08);
}

.inline-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
}

.inline-progress.warning span {
    background: linear-gradient(90deg, #d39b2a 0%, #ae7410 100%);
}

.content-grid {

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.availability-planning-panel {
    overflow: hidden;
}

.availability-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.availability-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.availability-planning-toolbar {
    align-items: end;
}

.availability-planning-head-actions {
    align-items: center;
    justify-content: flex-end;
}

.availability-planning-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    grid-column: 1 / -1;
}

.availability-planning-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.availability-planning-summary span {
    color: var(--muted);
}

.availability-calendar-shell {
    overflow-x: auto;
    padding-bottom: 8px;
}

#availability-planning-wrap:fullscreen {
    padding: 20px;
    background: #fff;
    overflow: auto;
    width: 100%;
    height: 100%;
}

#availability-planning-wrap:-webkit-full-screen {
    padding: 20px;
    background: #fff;
    overflow: auto;
    width: 100%;
    height: 100%;
}

.availability-calendar-grid {
    --room-column-width: 190px;
    --day-column-width: 72px;
    display: grid;
    grid-template-columns: var(--room-column-width) minmax(calc(var(--calendar-days) * var(--day-column-width)), 1fr);
    min-width: calc(var(--room-column-width) + (var(--calendar-days) * var(--day-column-width)));
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface-soft);
}

.availability-calendar-corner {
    position: sticky;
    left: 0;
    z-index: 4;
    display: grid;
    place-items: center start;
    padding: 14px 18px;
    background: #f4f7fb;
    border-inline-end: 1px solid var(--border);
    font-weight: 800;
}

.availability-calendar-head {
    display: grid;
    grid-template-columns: repeat(var(--calendar-days), minmax(var(--day-column-width), 1fr));
    background: #f4f7fb;
}

.availability-calendar-day {
    min-height: 68px;
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 10px 6px;
    border-inline-end: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.availability-calendar-day strong {
    font-size: 1rem;
}

.availability-calendar-day span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.availability-calendar-day.is-weekend {
    background: rgba(16, 34, 53, 0.03);
}

.availability-calendar-day.is-today {
    background: rgba(var(--primary-rgb), 0.12);
}

.availability-calendar-room {
    position: sticky;
    left: 0;
    z-index: 3;
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 88px;
    padding: 14px 18px;
    border-inline-end: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.availability-calendar-room span {
    color: var(--muted);
    font-size: 0.82rem;
}

.availability-calendar-room.is-free {
    background: linear-gradient(180deg, rgba(31, 122, 79, 0.07), #fff);
}

.availability-calendar-room.is-occupied {
    background: linear-gradient(180deg, rgba(159, 47, 47, 0.07), #fff);
}

.availability-calendar-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--calendar-days), minmax(var(--day-column-width), 1fr));
    min-height: 88px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.availability-calendar-cell {
    border-inline-end: 1px solid rgba(16, 34, 53, 0.06);
    background: rgba(255, 255, 255, 0.7);
}

.availability-calendar-cell-link {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 72px;
    color: transparent;
    transition: background 0.18s ease, color 0.18s ease;
}

.availability-calendar-cell-link span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    font-size: 1rem;
    font-weight: 800;
}

.availability-calendar-cell-link:hover {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.availability-calendar-cell.is-weekend {
    background: rgba(16, 34, 53, 0.03);
}

.availability-calendar-cell.is-today {
    background: rgba(var(--primary-rgb), 0.08);
}

.availability-calendar-event {
    z-index: 2;
    align-self: center;
    min-height: 54px;
    margin: 5px 6px;
    padding: 10px 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(159, 47, 47, 0.92), rgba(122, 27, 27, 0.96));
    box-shadow: 0 14px 24px rgba(159, 47, 47, 0.18);
    color: #fff;
    display: grid;
    gap: 3px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.availability-calendar-event strong,
.availability-calendar-event span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.availability-calendar-event span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.88);
}

.availability-calendar-event.is-selected-package {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 14px 24px rgba(var(--primary-rgb), 0.2);
}

.availability-calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(16, 34, 53, 0.22);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.profile-summary,
.profile-panels {
    display: grid;
    gap: 18px;
}

.profile-summary {
    position: sticky;
    top: 108px;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.9rem;
    font-weight: 800;
}

.profile-summary-copy h2 {
    margin: 10px 0 8px;
}

.profile-summary-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.profile-summary-grid {
    display: grid;
    gap: 14px;
    margin: 0;
}

.profile-summary-grid div {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.profile-summary-grid dt {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-summary-grid dd {
    margin: 0;
    font-weight: 700;
    line-height: 1.6;
}

.cash-shell,
.cash-main-column,
.cash-side-column {
    display: grid;
    gap: 24px;
}

.cash-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 380px);
    gap: 20px;
    align-items: stretch;
}

.cash-hero-copy {
    display: grid;
    align-content: center;
    gap: 14px;
}

.cash-hero-copy h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.cash-hero-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
    max-width: 60ch;
}

.cash-balance-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    background: #11283c;
    color: #f5f8fc;
}

.cash-balance-card>span {
    color: #aac0d5;
    font-size: 0.9rem;
    font-weight: 700;
}

.cash-balance-card>strong {
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1;
}

.cash-balance-meta {
    display: grid;
    gap: 12px;
}

.cash-balance-meta div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.cash-balance-meta span {
    color: #aac0d5;
}

.cash-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.cash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.collapsible-panel {
    padding: 0;
    overflow: hidden;
}

.collapsible-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    cursor: pointer;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary strong {
    display: block;
    margin-bottom: 4px;
}

.collapsible-summary span {
    color: var(--muted);
}

.collapsible-summary::after {
    content: '+';
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    flex: 0 0 34px;
}

.collapsible-panel[open] .collapsible-summary::after {
    content: '-';
}

.collapsible-body {
    padding: 0 22px 22px;
}

.cash-inline-form,
.cash-session-form {
    margin-top: 4px;
}

.cash-activity-list {
    display: grid;
    gap: 12px;
}

.cash-activity-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.cash-activity-main,
.cash-activity-side {
    display: grid;
    gap: 6px;
}

.cash-activity-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cash-activity-main span,
.cash-activity-side span {
    color: var(--muted);
    font-size: 0.88rem;
}

.cash-activity-side {
    text-align: end;
    justify-items: end;
}

.empty-state-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
}

.empty-state-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.panel {
    padding: 22px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading>* {
    min-width: 0;
}

.panel-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: start;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.data-table th {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.data-table tfoot td {
    font-weight: 800;
    background: var(--surface-soft);
}

@media (max-width: 1200px) {

    .stats-grid,
    .dashboard-cards,
    .cash-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero,
    .dashboard-insights,
    .cash-hero,
    .cash-grid,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .toolbar-grid,
    .grid-3,
    .grid-4,
    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .topbar-copy {
        width: 100%;
    }

    .topbar-heading-row {
        width: 100%;
        flex-direction: column;
        gap: 16px;
    }

    .topbar-mobile-bar {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .topbar-mobile-tools {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        box-shadow: 0 24px 60px rgba(16, 34, 53, 0.28);
    }

    [dir='rtl'] .sidebar {
        transform: translateX(100%);
    }

    .admin-page.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-panel {
        margin-left: 0;
    }

    [dir='rtl'] .main-panel {
        margin-right: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(9, 18, 27, 0.46);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.24s ease, visibility 0.24s ease;
        z-index: 40;
    }

    .admin-page.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-toggle,
    .sidebar-close {
        display: inline-flex;
    }
}

@media (max-width: 820px) {

    .content-grid,
    .stats-grid,
    .dashboard-cards,
    .cash-metrics,
    .grid-2,
    .grid-3,
    .grid-4,
    .toolbar-grid,
    .detail-grid,
    .checkbox-grid,
    .mini-stats {
        grid-template-columns: 1fr;
    }

    .settings-tabs-nav {
        position: static;
    }

    .dashboard-filter {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: start;
        flex-direction: column;
        padding: 18px 20px;
    }

    .topbar-heading-row {
        width: 100%;
        flex-direction: column;
        gap: 16px;
    }

    .topbar-copy {
        width: 100%;
    }

    .purchase-reservation-grid,
    .sale-hotel-grid {
        grid-template-columns: repeat(4, minmax(210px, 1fr));
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .topbar-mobile-bar {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .topbar-mobile-tools {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-menu-button {
        padding-inline: 16px;
    }

    .topbar-actions {
        display: none;
    }

    .topbar-title-block h1 {
        font-size: clamp(1.65rem, 7vw, 2rem);
        line-height: 1.12;
    }

    .topbar-title-block p {
        margin-top: 10px;
        font-size: 0.94rem;
        line-height: 1.6;
    }

    .mobile-dropdown-menu {
        min-width: 190px;
    }

    .sidebar {
        width: min(290px, calc(100vw - 32px));
    }

    .content-area {
        padding: 20px;
    }

    .profile-summary {
        position: static;
    }

    .cash-balance-meta div,
    .cash-activity-item {
        grid-template-columns: 1fr;
        display: grid;
    }

    .cash-activity-side {
        text-align: start;
        justify-items: start;
    }

    .flash {
        margin-inline: 20px;
    }

    .admin-modal-dialog {
        padding: 20px 12px;
    }

    .print-header {
        grid-template-columns: 1fr;
    }

    .print-document-meta {
        justify-items: start;
        text-align: start;
    }

    .print-document-reference {
        justify-items: start;
    }

    .print-company-grid {
        grid-template-columns: 1fr;
    }

    .panel-heading {
        align-items: start;
        flex-direction: column;
    }

    .panel-heading .inline-actions,
    .panel-heading .table-actions {
        width: 100%;
    }

    .panel-heading .inline-actions>*,
    .panel-heading .table-actions>* {
        flex: 1 1 100%;
    }

    .entity-summary-grid,
    .entity-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .auth-page {
        padding: 16px;
    }

    .auth-card {
        padding: 26px 20px;
        border-radius: 24px;
    }

    .topbar {
        padding: 16px;
    }

    .content-area {
        padding: 16px;
        gap: 18px;
    }

    .panel,
    .stat-card {
        padding: 18px;
        border-radius: 20px;
    }

    .ghost-button,
    .primary-button {
        min-height: 40px;
        max-width: 100%;
    }

    .inline-actions,
    .availability-planning-actions,
    .dashboard-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        width: 100%;
    }

    .inline-actions>*,
    .availability-planning-actions>*,
    .dashboard-filter-actions>* {
        width: 100%;
        min-width: 0;
    }

    .cash-balance-card,
    .cash-activity-item,
    .mini-stats article {
        padding: 16px;
        border-radius: 18px;
    }

    .mobile-dropdown-menu,
    .desktop-dropdown-menu {
        min-width: 0;
        width: min(240px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
    }

    .table-scroll {
        overflow: visible;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tfoot,
    .data-table tr,
    .data-table th,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        border-collapse: separate;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tfoot {
        display: grid;
        gap: 12px;
    }

    .data-table tr {
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: var(--surface-soft);
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(96px, 118px) minmax(0, 1fr);
        gap: 10px;
        padding: 0;
        border: 0;
        align-items: start;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .data-table td[colspan],
    .data-table td[data-label=''] {
        grid-template-columns: 1fr;
    }

    .data-table td[colspan]::before,
    .data-table td[data-label='']::before {
        display: none;
    }

    .data-table td.table-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
    }

    .data-table td.table-actions::before {
        content: attr(data-label);
        flex: 0 0 100%;
        margin-bottom: 2px;
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .data-table td.table-actions>*,
    .data-table td.table-actions form {
        width: auto;
        min-width: 0;
    }

    .data-table td.table-actions form {
        display: inline-flex;
    }

    .data-table td.table-actions .table-icon-button {
        width: 36px;
        height: 36px;
        flex-basis: auto;
    }

    .pagination-shell {
        margin-top: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
    }

    .pagination-links {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .pagination-link,
    .pagination-separator {
        min-width: 40px;
        min-height: 40px;
        padding: 0 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        border: 1px solid var(--border);
        background: #fff;
        color: var(--text);
        text-decoration: none;
        font-weight: 700;
    }

    .pagination-link:hover {
        border-color: rgba(var(--primary-rgb), 0.35);
        background: rgba(var(--primary-rgb), 0.05);
    }

    .pagination-link.is-active {
        border-color: var(--primary);
        background: var(--primary);
        color: #fff;
    }

    .pagination-link.is-disabled {
        color: var(--muted);
        background: var(--surface-soft);
        pointer-events: none;
    }

    .pagination-separator {
        border-style: dashed;
        color: var(--muted);
    }

    .pagination-summary {
        margin: 0;
        color: var(--muted);
        font-weight: 600;
    }

    .data-table tfoot td {
        background: transparent;
    }

    .line-items-table input,
    .line-items-table select {
        min-height: 44px;
    }

    .availability-planning-summary {
        flex-direction: column;
        align-items: start;
    }

    .availability-calendar-grid {
        --room-column-width: 128px;
        --day-column-width: 54px;
        border-radius: 18px;
    }

    .availability-calendar-corner,
    .availability-calendar-room {
        padding: 12px 10px;
    }

    .availability-calendar-day {
        min-height: 58px;
        padding: 8px 4px;
    }

    .availability-calendar-track {
        min-height: 78px;
    }

    .availability-calendar-cell-link {
        min-height: 62px;
    }

    .availability-calendar-event {
        min-height: 46px;
        margin: 4px;
        padding: 8px 10px;
        border-radius: 14px;
    }

    .entity-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .entity-hero-main {
        align-items: flex-start;
    }

    .entity-summary-grid,
    .entity-detail-grid {
        grid-template-columns: 1fr;
    }

    .entity-detail-card-wide {
        grid-column: auto;
    }

    .currency-group-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .topbar-title-block h1 {
        font-size: clamp(1.35rem, 7vw, 1.7rem);
        line-height: 1.14;
    }

    .topbar-title-block p {
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .print-company {
        flex-direction: column;
    }

    .print-document-reference {
        justify-items: start;
    }

    .availability-calendar-grid {
        --room-column-width: 112px;
        --day-column-width: 48px;
    }

    .data-table td {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .data-table td::before {
        margin-bottom: 2px;
    }
}

[dir='rtl'] .brand,
[dir='rtl'] .sidebar-link,
[dir='rtl'] .checkbox {
    flex-direction: row-reverse;
}

[dir='rtl'] .topbar {
    flex-direction: row-reverse;
}

[dir='rtl'] .topbar-actions {
    flex-direction: row-reverse;
}

[dir='rtl'] .topbar-mobile-bar {
    flex-direction: row-reverse;
}

[dir='rtl'] .topbar-mobile-tools {
    flex-direction: row-reverse;
}

[dir='rtl'] .sidebar-group-links {
    padding: 8px 18px 10px 0;
}

[dir='rtl'] .sidebar-footer-actions {
    flex-direction: row-reverse;
}

[dir='rtl'] input[type='number'],
[dir='rtl'] input[type='date'],
[dir='rtl'] input[type='email'],
[dir='rtl'] input[type='url'],
[dir='rtl'] input[name*='phone'],
[dir='rtl'] input[name*='amount'],
[dir='rtl'] input[name*='price'],
[dir='rtl'] input[name*='count'],
[dir='rtl'] input[name*='number'],
[dir='rtl'] input[name*='rate'],
[dir='rtl'] code,
[dir='rtl'] [data-line-total],
[dir='rtl'] [data-sale-subtotal],
[dir='rtl'] [data-sale-total],
[dir='rtl'] [data-sale-balance],
[dir='rtl'] [data-label='Montant'],
[dir='rtl'] [data-label='الإجمالي'],
[dir='rtl'] [data-label='المبلغ'],
[dir='rtl'] .detail-grid span,
[dir='rtl'] .mini-stats strong,
[dir='rtl'] .cash-balance-card strong,
[dir='rtl'] .pagination-link,
[dir='rtl'] .pagination-summary {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

/* ── RTL Mobile Dropdown Fix ─────────────────────────────────────────────
   In RTL, inset-inline-end:0 resolves to left:0, which makes the dropdown
   open from the button's left edge and overflow right off-screen.
   Fix: swap to inset-inline-start:0 (= right:0 in RTL) so the dropdown
   right edge aligns with the button and extends to the LEFT (correct RTL).
   ────────────────────────────────────────────────────────────────────── */
[dir='rtl'] .mobile-dropdown-menu {
    inset-inline-end: auto;
    inset-inline-start: 0;
}

/* Notification dropdown needs more width for long message text */
@media (max-width: 760px) {
    .topbar-mobile-tools .mobile-dropdown-menu {
        width: min(320px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
    }

    .mobile-dropdown-item strong {
        font-size: 0.86rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .mobile-dropdown-item span {
        font-size: 0.78rem;
        line-height: 1.5;
        word-break: break-word;
        white-space: normal;
    }
}

/* ── Sale Summary Panel ── */
.sale-summary-panel {
    display: grid;
    gap: 18px;
}

.sale-summary-header {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.sale-summary-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.sales-summary-agency {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.sale-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.sale-summary-grid.col-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


.sale-summary-card {
    display: grid;
    gap: 10px;
    padding: 20px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.sale-summary-card .icon-svg {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: inherit;
    opacity: 0.7;
}

.sale-summary-card span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.sale-summary-card strong {
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.sale-summary-card.is-primary {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.03));
    border-color: rgba(var(--primary-rgb), 0.18);
}

.sale-summary-card.is-success {
    background: linear-gradient(135deg, rgba(31, 122, 79, 0.08), rgba(31, 122, 79, 0.03));
    border-color: rgba(31, 122, 79, 0.18);
}

.sale-summary-card.is-warning {
    background: linear-gradient(135deg, rgba(196, 138, 22, 0.08), rgba(196, 138, 22, 0.03));
    border-color: rgba(196, 138, 22, 0.18);
}

.sale-summary-card.is-danger {
    background: linear-gradient(135deg, rgba(159, 47, 47, 0.08), rgba(159, 47, 47, 0.03));
    border-color: rgba(159, 47, 47, 0.18);
}

.sale-summary-card.is-info {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--primary-rgb), 0.02));
    border-color: rgba(var(--primary-rgb), 0.14);
}

.sale-summary-card.is-slate {
    background: linear-gradient(135deg, rgba(65, 81, 96, 0.07), rgba(65, 81, 96, 0.02));
    border-color: rgba(65, 81, 96, 0.14);
}

.sale-summary-card.is-amber {
    background: linear-gradient(135deg, rgba(174, 116, 16, 0.08), rgba(174, 116, 16, 0.03));
    border-color: rgba(174, 116, 16, 0.18);
}

.sale-summary-card.is-teal {
    background: linear-gradient(135deg, rgba(20, 130, 120, 0.08), rgba(20, 130, 120, 0.03));
    border-color: rgba(20, 130, 120, 0.18);
}

.sale-summary-card.is-purple {
    background: linear-gradient(135deg, rgba(110, 70, 160, 0.08), rgba(110, 70, 160, 0.03));
    border-color: rgba(110, 70, 160, 0.18);
}

.sale-summary-card.is-rose {
    background: linear-gradient(135deg, rgba(180, 50, 90, 0.08), rgba(180, 50, 90, 0.03));
    border-color: rgba(180, 50, 90, 0.18);
}

.sale-summary-card.is-cyan {
    background: linear-gradient(135deg, rgba(0, 130, 160, 0.08), rgba(0, 130, 160, 0.03));
    border-color: rgba(0, 130, 160, 0.18);
}

.sale-summary-card.is-lime {
    background: linear-gradient(135deg, rgba(80, 150, 30, 0.08), rgba(80, 150, 30, 0.03));
    border-color: rgba(80, 150, 30, 0.18);
}

.sale-summary-card.is-indigo {
    background: linear-gradient(135deg, rgba(60, 70, 170, 0.08), rgba(60, 70, 170, 0.03));
    border-color: rgba(60, 70, 170, 0.18);
}

.sale-summary-card.is-brown {
    background: linear-gradient(135deg, rgba(140, 80, 50, 0.08), rgba(140, 80, 50, 0.03));
    border-color: rgba(140, 80, 50, 0.18);
}

.sale-summary-card.is-pink {
    background: linear-gradient(135deg, rgba(200, 60, 110, 0.08), rgba(200, 60, 110, 0.03));
    border-color: rgba(200, 60, 110, 0.18);
}

.sale-summary-card.is-orange {
    background: linear-gradient(135deg, rgba(210, 110, 20, 0.08), rgba(210, 110, 20, 0.03));
    border-color: rgba(210, 110, 20, 0.18);
}

@media (max-width: 820px) {
    .sale-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .sale-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Modern dashboard refresh */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    align-items: stretch;
    gap: 24px;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(20, 130, 120, 0.08) 44%, rgba(215, 142, 35, 0.08) 100%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 24px 60px rgba(16, 34, 53, 0.09);
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px 18px);
}

.dashboard-hero>* {
    position: relative;
    z-index: 1;
}

.dashboard-hero-copy {
    display: grid;
    align-content: center;
}

.dashboard-hero-copy h2 {
    margin: 16px 0 10px;
    color: #0f2435;
    line-height: 1.05;
}

.dashboard-hero-copy p {
    line-height: 1.75;
}

.dashboard-filter {
    align-self: stretch;
    align-content: end;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 16px 34px rgba(16, 34, 53, 0.08);
    backdrop-filter: blur(12px);
}

.dashboard-filter .field input {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.32);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dashboard-filter-actions .primary-button {
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.22);
}

.dashboard-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.stat-card {
    --stat-rgb: var(--primary-rgb);
    --stat-solid: var(--primary);
    position: relative;
    min-height: 176px;
    overflow: hidden;
    padding: 22px;
    gap: 14px;
    border: 1px solid rgba(var(--stat-rgb), 0.18);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 251, 255, 0.94) 100%),
        linear-gradient(135deg, rgba(var(--stat-rgb), 0.16), rgba(var(--stat-rgb), 0.03));
    box-shadow: 0 18px 42px rgba(16, 34, 53, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--stat-solid), rgba(var(--stat-rgb), 0.36));
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--stat-rgb), 0.32);
    box-shadow: 0 24px 54px rgba(16, 34, 53, 0.12);
}

.stat-card span {
    color: #64748b;
}

.stat-card-head>span {
    max-width: 70%;
    color: #526579;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
}

.stat-card strong,
.stat-card strong .money-number {
    color: #102235;
}

.stat-card strong {
    font-size: clamp(1.45rem, 2vw, 1.95rem);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.stat-card strong small,
.stat-card strong .money-currency {
    color: #718195;
}

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(var(--stat-rgb), 0.2);
    background: rgba(var(--stat-rgb), 0.11);
    color: var(--stat-solid);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.stat-progress {
    height: 7px;
    background: rgba(var(--stat-rgb), 0.12);
}

.stat-progress span,
.stat-card .stat-progress span {
    background: linear-gradient(90deg, rgba(var(--stat-rgb), 0.52), var(--stat-solid));
}

.stat-card-primary {
    --stat-rgb: var(--primary-rgb);
    --stat-solid: var(--primary);
}

.stat-card-success {
    --stat-rgb: 20, 130, 96;
    --stat-solid: #148260;
}

.stat-card-danger {
    --stat-rgb: 196, 65, 84;
    --stat-solid: #c44154;
}

.stat-card-warning {
    --stat-rgb: 215, 142, 35;
    --stat-solid: #d78e23;
}

.stat-card-secondary {
    --stat-rgb: 99, 102, 241;
    --stat-solid: #6366f1;
}

.stat-card-slate {
    --stat-rgb: 71, 85, 105;
    --stat-solid: #475569;
}

.stat-card-info {
    --stat-rgb: 8, 145, 178;
    --stat-solid: #0891b2;
}

.dashboard-insights {
    grid-template-columns: 1fr;
}

.dashboard-insights .panel,
.dashboard-chart-section .panel,
.dashboard-chart-section+.content-grid .panel {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 20px 46px rgba(16, 34, 53, 0.075);
}

.panel-heading h2 {
    color: #102235;
    letter-spacing: 0;
}

.ring-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ring-card {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ring-card span {
    font-weight: 700;
    line-height: 1.45;
}

.ring-visual {
    --track: rgba(148, 163, 184, 0.18);
    width: 124px;
    height: 124px;
    padding: 9px;
    box-shadow: 0 16px 32px rgba(16, 34, 53, 0.08);
}

.ring-center {
    width: 88px;
    height: 88px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.ring-center .icon-svg {
    color: var(--ring-color);
}

.ring-warning {
    --ring-color: #d78e23;
}

.ring-success {
    --ring-color: #148260;
}

.dashboard-chart {
    min-height: 360px;
    gap: 24px;
    padding: 22px 14px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.85) 0%, rgba(255, 255, 255, 0.95) 100%),
        repeating-linear-gradient(0deg, transparent 0 54px, rgba(148, 163, 184, 0.14) 55px 56px);
}

.chart-bar-group {
    min-width: 74px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.chart-label {
    order: 2;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.chart-bars {
    order: 1;
    height: 252px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 10px;
    padding: 0 4px;
}

.dual-bars {
    gap: 10px;
}

.chart-bar {
    display: block;
    min-height: 4px;
    width: 28px;
    border-radius: 12px 12px 5px 5px;
    box-shadow: 0 8px 18px rgba(16, 34, 53, 0.13);
    transition: filter 0.18s ease, transform 0.18s ease;
}

.dual-bars .chart-bar {
    width: 28px;
}

.chart-bar:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.chart-bar.sales {
    background: linear-gradient(180deg, #4b8ab3 0%, var(--primary) 100%);
}

.chart-bar.purchases {
    background: linear-gradient(180deg, #f0b84f 0%, #d78e23 100%);
}

.chart-legend {
    align-items: center;
}

.chart-legend span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-weight: 700;
}

.legend-dot.purchases {
    background: #d78e23;
}

.dashboard-chart-section+.content-grid {
    gap: 24px;
}

.currency-group {
    border-color: rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 34, 53, 0.055);
}

.currency-group-head {
    margin-bottom: 12px;
    padding: 14px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(20, 130, 120, 0.05));
}

.currency-badge {
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    background: rgba(var(--primary-rgb), 0.1);
}

.dashboard-chart-section+.content-grid .data-table th {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-chart-section+.content-grid .data-table td {
    border-color: rgba(148, 163, 184, 0.18);
}

.dashboard-chart-section+.content-grid .data-table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.035);
}

.inline-progress {
    height: 7px;
    background: rgba(var(--primary-rgb), 0.1);
}

.inline-progress span {
    background: linear-gradient(90deg, #4b8ab3 0%, var(--primary) 100%);
}

.inline-progress.warning span {
    background: linear-gradient(90deg, #f0b84f 0%, #d78e23 100%);
}

@media (max-width: 1200px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ring-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .dashboard-filter {
        grid-template-columns: 1fr;
    }

    .dashboard-cards,
    .ring-grid,
    .dashboard-chart-section+.content-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart {
        min-height: 300px;
        gap: 18px;
    }

    .chart-bar-group {
        min-width: 60px;
        height: 250px;
    }

    .chart-bars {
        height: 205px;
    }

    .dual-bars .chart-bar {
        width: 22px;
    }
}

@media (max-width: 520px) {
    .dashboard-hero {
        padding: 18px;
    }

    .dashboard-hero-copy h2 {
        font-size: 1.55rem;
    }

    .stat-card {
        min-height: 0;
    }

    .stat-card-head>span {
        max-width: 66%;
        font-size: 0.78rem;
    }

    .stat-card .money-value {
        gap: 6px;
        flex-wrap: wrap;
    }

    .dashboard-chart {
        padding-inline: 10px;
    }
}

/* =============================================
   Sale Document Print – Compact
   ============================================= */
.sdoc-top {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.sdoc-agency {
    flex: 1;
    background: var(--primary-soft);
    border-radius: 8px;
    padding: 10px 14px;
    border-left: 3px solid var(--primary);
    display: grid;
    gap: 1px;
    align-content: center;
}

.sdoc-agency .sdoc-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.sdoc-agency strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.sdoc-agency .sdoc-muted {
    font-size: 0.7rem;
    color: var(--muted);
}

.sdoc-summary {
    display: flex;
    gap: 6px;
    flex: 1.2;
}

.sdoc-sum-item {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    display: grid;
    gap: 1px;
    align-content: center;
}

.sdoc-sum-item span {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.sdoc-sum-item strong {
    font-size: 0.82rem;
    color: var(--text);
}

.sdoc-sum-total {
    border-top: 3px solid var(--primary);
}

.sdoc-sum-paid {
    border-top: 3px solid var(--success);
}

.sdoc-sum-remaining {
    border-top: 3px solid var(--danger);
}

.sdoc-sum-credit {
    border-top: 3px solid var(--success);
}

.sdoc-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sdoc-detail {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-size: 0.75rem;
}

.sdoc-detail span {
    color: var(--muted);
}

.sdoc-detail strong {
    font-weight: 600;
    color: var(--text);
}

.sdoc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    margin-bottom: 8px;
}

.sdoc-table th,
.sdoc-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--border);
    text-align: start;
}

.sdoc-table th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sdoc-table tfoot td {
    font-weight: 700;
    background: var(--surface-soft);
    font-size: 0.75rem;
}

.sdoc-payments {
    margin-top: 2px;
}

.sdoc-pay-title {
    display: block;
    font-size: 0.72rem;
    margin-bottom: 4px;
    color: var(--text);
}

.receipt-document-card {
    display: grid;
    gap: 12px;
}

.receipt-preview-shell {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.12), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #f2f6fb 100%);
}

.receipt-preview-frame {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.receipt-note-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.receipt-note-card span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.receipt-note-card strong {
    display: block;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text);
}

.receipt-attachment-list {
    display: grid;
    gap: 12px;
}

.receipt-attachment-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.receipt-attachment-link:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.receipt-attachment-link strong {
    font-size: 0.92rem;
    color: var(--text);
}

.receipt-attachment-link span {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.receipt-print-panel {
    padding: 18px 22px;
}

@media print {
    .sdoc-top {
        break-inside: avoid;
    }

    .sdoc-details {
        break-inside: avoid;
    }

    .sdoc-table {
        break-inside: avoid;
    }

    .receipt-document-card {
        break-inside: avoid;
    }
}

@media (max-width: 768px) {
    .receipt-preview-shell {
        padding: 12px;
        border-radius: 18px;
    }

    .receipt-preview-frame {
        padding: 14px;
        border-radius: 16px;
    }

    .receipt-attachment-link {
        align-items: flex-start;
        flex-direction: column;
    }

    .receipt-attachment-link span {
        white-space: normal;
    }
}

/* ═══════════════════════════════════════════════
   DEMANDE — Saisie rapide mobile-first
   ═══════════════════════════════════════════════ */

.demande-shell {
    display: grid;
    gap: 16px;
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: 32px;
}

/* Card */
.demande-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: grid;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(16, 34, 53, .05);
}

.demande-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.demande-card-header>div {
    display: grid;
    gap: 2px;
}

.demande-card-header strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.demande-card-header span {
    font-size: 0.78rem;
    color: var(--muted);
}

/* Step badge */
.demande-step {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 14px rgba(var(--primary-rgb), 0.3);
}

.demande-step-opt {
    background: var(--surface-soft);
    color: var(--muted);
    box-shadow: none;
    font-size: 0.9rem;
}

/* Field inside card */
.demande-field select,
.demande-field textarea {
    font-size: 1rem;
    border-radius: 14px;
    min-height: 52px;
}

.demande-error {
    font-size: 0.82rem;
    color: var(--danger);
    margin: 0;
}

/* Package stats */
.demande-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-top: 4px;
}

.demande-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.demande-stat>div {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.demande-stat strong {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
}

.demande-stat span {
    font-size: 0.72rem;
    color: var(--muted);
}

.demande-stat .icon-svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--muted);
}

.demande-stat-places {
    border-color: rgba(var(--primary-rgb), 0.25);
}

.demande-stat-places strong {
    color: var(--primary);
}

.demande-stat-confirmed {
    border-color: rgba(31, 122, 79, .2);
}

.demande-stat-confirmed strong {
    color: var(--success);
}

.demande-stat-draft {
    border-color: rgba(180, 120, 0, .2);
}

.demande-stat-draft strong {
    color: #b47800;
}

.demande-stat-available {
    border-color: rgba(var(--primary-rgb), 0.15);
}

.demande-stat-available strong {
    color: var(--primary-dark);
}

/* Quantity picker */
.demande-qty-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.demande-qty-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 800;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.demande-qty-btn:hover {
    background: var(--primary);
    color: #fff;
}

.demande-qty-input {
    width: 120px;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    border-radius: 16px;
    border: 2px solid var(--border);
    padding: 10px;
    color: var(--text);
    background: var(--surface-soft);
}

.demande-qty-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Actions */
.demande-actions {
    display: grid;
    gap: 10px;
}

.demande-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    border-radius: 18px;
    border: 0;
    background: var(--primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(var(--primary-rgb), 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.demande-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.4);
}

.demande-submit:active {
    transform: none;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.demande-cancel {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.demande-cancel:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

/* ── Sidebar link layout ─────────────────────── */
.sidebar-link {
    justify-content: flex-start;
}

.sidebar-link-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav badge (ex: draft sales count) */
.sidebar-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* RTL: badge before icon */
[dir='rtl'] .sidebar-link {
    justify-content: flex-start;
}

/* ═══════════════════════════════════════════════
   SALES — Collective stats cards
   ═══════════════════════════════════════════════ */

.sales-collective-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.scs-card {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(16, 34, 53, .04);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.scs-card:hover {
    box-shadow: 0 8px 24px rgba(16, 34, 53, .10);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

/* Active (currently filtered) card */
.scs-card.scs-active {
    border-width: 2px;
    box-shadow: 0 6px 20px rgba(16, 34, 53, .10);
}

.scs-places.scs-active {
    border-color: var(--primary);
}

.scs-confirmed.scs-active {
    border-color: var(--success);
}

.scs-draft.scs-active {
    border-color: #b47800;
}

.scs-card::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.scs-places::before {
    background: var(--primary);
}

.scs-confirmed::before {
    background: var(--success);
}

.scs-draft::before {
    background: #b47800;
}

.scs-available::before {
    background: #6c5ecf;
}

.scs-icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.scs-icon .icon-svg {
    width: 22px;
    height: 22px;
}

.scs-places .scs-icon .icon-svg {
    color: var(--primary);
}

.scs-confirmed .scs-icon .icon-svg {
    color: var(--success);
}

.scs-draft .scs-icon .icon-svg {
    color: #b47800;
}

.scs-available .scs-icon .icon-svg {
    color: #6c5ecf;
}

.scs-body {
    display: grid;
    gap: 2px;
}

.scs-body strong {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.scs-places strong {
    color: var(--primary);
}

.scs-confirmed strong {
    color: var(--success);
}

.scs-draft strong {
    color: #b47800;
}

.scs-available strong {
    color: #6c5ecf;
}

.scs-body span {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.scs-card small {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
}

/* Progress bar */
.scs-bar {
    height: 5px;
    border-radius: 99px;
    background: var(--border);
    overflow: hidden;
}

.scs-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

.scs-bar-confirmed {
    background: var(--success);
}

.scs-bar-draft {
    background: #b47800;
}

.scs-bar-available {
    background: #6c5ecf;
}

/* Responsive */
@media (max-width: 900px) {
    .sales-collective-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .sales-collective-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .scs-body strong {
        font-size: 1.3rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   PACKAGE SHOW — Tabs
   ═══════════════════════════════════════════════════════════ */

.pkg-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.pkg-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.pkg-tab-btn .icon-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pkg-tab-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.pkg-tab-btn.pkg-tab-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.25);
    height: 55px impot !important;
}

.pkg-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
}

.pkg-tab-active .pkg-tab-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Mini stats cards on reservation tab ───────────────────── */

.pkg-res-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.pkg-res-stat {
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: grid;
    gap: 4px;
    border-left: 4px solid transparent;
}

.pkg-res-stat strong {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.pkg-res-stat span {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.pkg-res-stat-prv {
    border-left-color: #b47800;
}

.pkg-res-stat-prv strong {
    color: #b47800;
}

.pkg-res-stat-reel {
    border-left-color: var(--success);
}

.pkg-res-stat-reel strong {
    color: var(--success);
}

.pkg-res-stat-cap {
    border-left-color: var(--primary);
}

.pkg-res-stat-cap strong {
    color: var(--primary);
}

.pkg-res-stat-reste {
    border-left-color: #6c5ecf;
}

.pkg-res-stat-reste strong {
    color: #6c5ecf;
}

/* ── Reservation table (Excel-style) ───────────────────────── */

.pkg-res-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.88rem;
}

.pkg-res-thead th {
    background: #2c3e50;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border: 1px solid #1a252f;
    white-space: nowrap;
}

/* Column-specific header colors */
.pkg-res-th-vol,
.pkg-res-th-date {
    background: #1a3a5c;
}

.pkg-res-th-hotel {
    background: #1a5c3a;
}

.pkg-res-th-client {
    background: #3a4a5c;
}

.pkg-res-th-heb {
    background: #3a3a5c;
}

.pkg-res-th-prv {
    background: #7a4800;
}

.pkg-res-th-reel {
    background: #1a6a2a;
}

.pkg-res-th-total {
    background: #d4a200;
    color: #1a1a00;
}

.pkg-res-th-cap {
    background: #1a5c3a;
}

.pkg-res-th-reste {
    background: #1a3a5c;
}

/* Body cells */
.pkg-res-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    vertical-align: middle;
}

/* VOL / DATE / HOTEL spanning cells */
.pkg-res-td-vol,
.pkg-res-td-date,
.pkg-res-td-hotel {
    font-weight: 700;
    background: var(--surface-soft);
    text-align: center;
    vertical-align: middle;
    color: var(--primary);
}

.pkg-res-td-hotel {
    color: #c8460d;
    font-weight: 800;
}

/* Client name */
.pkg-res-td-client {
    font-weight: 600;
}

/* NBR PRV */
.pkg-res-td-prv.is-prv {
    color: #b47800;
    font-weight: 700;
    text-align: center;
}

.pkg-res-td-prv:not(.is-prv) {
    text-align: center;
    color: var(--muted);
}

/* NBR réel */
.pkg-res-td-reel.is-reel {
    color: var(--success);
    font-weight: 700;
    text-align: center;
}

.pkg-res-td-reel:not(.is-reel) {
    text-align: center;
    color: var(--muted);
}

/* TOTAL / CAPACITÉ / RESTE spanning cells */
.pkg-res-td-total {
    background: #ffd700;
    color: #5a3e00;
    font-weight: 900;
    font-size: 1.1rem;
    text-align: center;
    vertical-align: middle;
}

.pkg-res-td-cap {
    background: #c8f0d0;
    color: #1a5c2a;
    font-weight: 800;
    text-align: center;
    vertical-align: middle;
    font-size: 1.05rem;
}

.pkg-res-td-reste {
    background: #d0e8ff;
    color: #1a3a6c;
    font-weight: 800;
    text-align: center;
    vertical-align: middle;
    font-size: 1.05rem;
}

/* TOTAL summary row */
.pkg-res-total-row {
    background: #ffd700 !important;
}

.pkg-res-total-row td {
    font-weight: 900;
    color: #5a3e00;
    background: #ffd700;
    border-color: #c0a000;
}

.pkg-res-total-label {
    text-align: center;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
}

/* Draft-only row highlight */
.pkg-res-row-draft td.pkg-res-td-client {
    color: #b47800;
}

/* HÉBERGEMENT cell */
.pkg-res-td-heb {
    text-align: center;
    font-style: italic;
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .pkg-res-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════
   AUTH V2 — Full-page background + floating glass card
   ═══════════════════════════════════════════════════════════ */

body.auth-page-v2 {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Manrope', system-ui, sans-serif;
    background: linear-gradient(145deg, #0f4c81 0%, #0d9f6e 100%);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ── Subtle geometric pattern overlay ──────────────────────── */
body.auth-page-v2::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ── Top bar ──────────────────────────────────────────────── */
.auth-v2-topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
}

.auth-v2-brand {
    display: flex;
    align-items: center;
}

.auth-v2-brand-logo {
    max-height: 44px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.auth-v2-brand-text {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.auth-v2-brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 6px rgba(13,159,110,0.9));
}

/* Locale switcher */
.auth-v2-locale {
    display: flex;
    gap: 6px;
}

.auth-v2-locale-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.05em;
}

.auth-v2-locale-btn:hover {
    background: rgba(255,255,255,0.3);
}

.auth-v2-locale-btn.active {
    background: #fff;
    border-color: #fff;
    color: #0d9f6e;
}

/* ── Center: glass card ───────────────────────────────────── */
.auth-v2-center {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
}

.auth-v2-glass-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 24px;
    padding: 36px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

/* ── Card header ──────────────────────────────────────────── */
.auth-v2-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 28px;
}

/* Logo image centré */
.auth-v2-card-logo-center {
    max-height: 70px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

/* Brand text si pas de logo */
.auth-v2-card-brand-center {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0d9f6e;
}

.auth-v2-card-brand-moon {
    font-size: 2.4rem;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(13,159,110,0.5));
}

.auth-v2-card-brand-name {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #0f4c81;
}

/* Titre centré */
.auth-v2-card-title-center {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: -0.01em;
}

.auth-v2-card-title {
    margin: 0 0 4px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f1f35;
    letter-spacing: -0.02em;
}

.auth-v2-card-sub {
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
}

.auth-v2-card-logo {
    max-height: 32px;
    width: auto;
    margin-top: 4px;
    display: block;
}

.auth-v2-card-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: #0d9f6e;
    font-size: 1rem;
    font-weight: 800;
}

.auth-v2-card-brand-icon {
    font-size: 1.1rem;
}

/* ── Error alert ──────────────────────────────────────────── */
.auth-v2-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fff1f1;
    border: 1px solid #fecdd3;
    color: #be123c;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 18px;
}

/* ── Form ─────────────────────────────────────────────────── */
.auth-v2-form {
    display: grid;
    gap: 18px;
}

.auth-v2-field {
    display: grid;
    gap: 7px;
}

.auth-v2-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.01em;
}

.auth-v2-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-v2-input-icon {
    position: absolute;
    inset-inline-start: 13px;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}

.auth-v2-input {
    width: 100%;
    padding: 12px 13px 12px 42px;
    border-radius: 11px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-family: inherit;
    font-size: 0.93rem;
    color: #0f1f35;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}

[dir='rtl'] .auth-v2-input {
    padding: 12px 42px 12px 13px;
}
[dir='rtl'] .auth-v2-input-icon {
    inset-inline-start: auto;
    inset-inline-end: 13px;
}

.auth-v2-input::placeholder { color: #c0ccd8; }

.auth-v2-input:focus {
    border-color: #0d9f6e;
    box-shadow: 0 0 0 3px rgba(13,159,110,0.14);
}

/* Password toggle */
.auth-v2-pwd-toggle {
    position: absolute;
    inset-inline-end: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    display: grid;
    place-items: center;
    transition: color 0.15s;
}
.auth-v2-pwd-toggle:hover { color: #0d9f6e; }

/* Remember */
.auth-v2-remember { margin-top: -2px; }

.auth-v2-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

.auth-v2-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    accent-color: #0d9f6e;
    cursor: pointer;
    flex-shrink: 0;
}

/* Submit */
.auth-v2-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    background: #d6a145;
    color: #fff;
    font-family: inherit;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.18s, transform 0.14s, box-shadow 0.18s;
    box-shadow: 0 6px 20px rgba(13,159,110,0.35);
    margin-top: 2px;
}

.auth-v2-submit:hover {
    background: #0b8f60;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(13,159,110,0.45);
}

.auth-v2-submit:active {
    transform: translateY(0);
    background: #0a7f56;
}

/* Footer */
.auth-v2-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 12px 16px;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

/* ── Responsive: Tablets ──────────────────────────────────── */
@media (max-width: 768px) {
    body.auth-page-v2 {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-v2-center {
        padding: 20px 16px 28px;
    }

    .auth-v2-glass-card {
        max-width: 400px;
        padding: 32px 28px;
    }

    .auth-v2-topbar {
        padding: 16px 20px;
    }

    .auth-v2-brand-text {
        font-size: 1.1rem;
    }

    .auth-v2-brand-logo {
        max-height: 38px;
    }
}

/* ── Responsive: Phones ──────────────────────────────────── */
@media (max-width: 480px) {
    body.auth-page-v2 {
        min-height: 100vh;
        min-height: 100dvh;
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
    }

    .auth-v2-topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .auth-v2-brand-text {
        font-size: 1rem;
        gap: 6px;
    }

    .auth-v2-brand-logo {
        max-height: 32px;
    }

    .auth-v2-brand-icon {
        font-size: 1.2rem;
    }

    .auth-v2-locale {
        gap: 4px;
    }

    .auth-v2-locale-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
        border-radius: 6px;
    }

    .auth-v2-center {
        padding: 12px 12px 24px;
        flex: 1;
    }

    .auth-v2-glass-card {
        max-width: 100%;
        padding: 28px 20px;
        border-radius: 20px;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
    }

    .auth-v2-card-header {
        margin-bottom: 22px;
        gap: 10px;
    }

    .auth-v2-card-logo-center {
        max-height: 56px;
        max-width: 160px;
    }

    .auth-v2-card-brand-center {
        gap: 6px;
    }

    .auth-v2-card-brand-moon {
        font-size: 2rem;
    }

    .auth-v2-card-brand-name {
        font-size: 1.35rem;
    }

    .auth-v2-card-title-center {
        font-size: 1.05rem;
    }

    .auth-v2-form {
        gap: 16px;
    }

    .auth-v2-field label {
        font-size: 0.78rem;
    }

    .auth-v2-input {
        padding: 14px 14px 14px 44px;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 52px;
    }

    [dir='rtl'] .auth-v2-input {
        padding: 14px 44px 14px 14px;
    }

    .auth-v2-input-icon {
        width: 20px;
        height: 20px;
    }

    [dir='rtl'] .auth-v2-input-icon {
        inset-inline-end: 14px;
    }

    .auth-v2-input::placeholder {
        font-size: 0.95rem;
    }

    .auth-v2-pwd-toggle {
        inset-inline-end: 12px;
        padding: 8px;
    }

    .auth-v2-checkbox {
        font-size: 0.88rem;
        gap: 10px;
    }

    .auth-v2-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .auth-v2-submit {
        min-height: 52px;
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 14px;
        gap: 8px;
    }

    .auth-v2-submit svg {
        width: 20px;
        height: 20px;
    }

    .auth-v2-alert {
        padding: 10px 12px;
        font-size: 0.82rem;
        border-radius: 8px;
        gap: 8px;
    }

    .auth-v2-alert svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .auth-v2-footer {
        padding: 10px 16px env(safe-area-inset-bottom, 10px);
        font-size: 0.72rem;
    }
}

/* ── Responsive: Very small phones (< 360px) ────────────── */
@media (max-width: 360px) {
    .auth-v2-glass-card {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .auth-v2-input {
        padding: 13px 12px 13px 40px;
        font-size: 0.95rem;
    }

    [dir='rtl'] .auth-v2-input {
        padding: 13px 40px 13px 12px;
    }

    .auth-v2-card-brand-name {
        font-size: 1.2rem;
    }

    .auth-v2-card-brand-moon {
        font-size: 1.7rem;
    }

    .auth-v2-submit {
        min-height: 48px;
        font-size: 0.95rem;
    }
}

/* ── Landscape phones ───────────────────────────────────── */
@media (max-height: 520px) and (orientation: landscape) {
    body.auth-page-v2 {
        justify-content: flex-start;
    }

    .auth-v2-topbar {
        padding: 10px 20px;
    }

    .auth-v2-center {
        padding: 8px 16px 16px;
    }

    .auth-v2-glass-card {
        padding: 20px 24px;
        max-width: 380px;
    }

    .auth-v2-card-header {
        flex-direction: row;
        gap: 12px;
        margin-bottom: 16px;
    }

    .auth-v2-card-logo-center {
        max-height: 40px;
    }

    .auth-v2-card-brand-moon {
        font-size: 1.6rem;
    }

    .auth-v2-form {
        gap: 10px;
    }

    .auth-v2-input {
        padding: 10px 12px 10px 40px;
        min-height: 44px;
    }

    .auth-v2-submit {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* ── iOS zoom prevention ────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
    .auth-v2-input,
    .auth-v2-checkbox input[type="checkbox"] {
        font-size: 16px;
    }
}

/* ── High-DPI screens ──────────────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-v2-glass-card {
        border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}

/* ── Dark mode hint ─────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .auth-v2-glass-card {
        background: rgba(255, 255, 255, 0.96);
    }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .auth-v2-submit,
    .auth-v2-input,
    .auth-v2-pwd-toggle,
    .auth-v2-locale-btn {
        transition: none;
    }
}



body.auth-page-v2 {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Manrope', system-ui, sans-serif;
    background: linear-gradient(145deg, #d6a145, #333333 100%);
    position: relative;
    display: flex;
    flex-direction: column;
}