:root {
    --rh-bg: #070707;
    --rh-panel: #141414;
    --rh-border: rgba(201, 174, 99, .18);
    --rh-border-strong: rgba(201, 174, 99, .34);
    --rh-text: #f4efe0;
    --rh-muted: #c5b995;
    --rh-gold: #c5aa63;
    --rh-gold-strong: #e1c97d;
    --rh-danger: #b55746;
    --rh-success: #6fa879;
    --rh-shadow: 0 22px 48px rgba(0, 0, 0, .34);
    --rh-shadow-soft: 0 12px 30px rgba(0, 0, 0, .22);
    --rh-radius: 24px;
    --rh-radius-sm: 16px;
    --rh-current-text: #2f2a21;
    --rh-current-muted: #6b6557;
    --rh-current-heading: #86671f;
    --rh-current-surface: rgba(255, 255, 255, .97);
    --rh-current-surface-2: rgba(248, 242, 229, .95);
    --rh-current-surface-soft: rgba(255, 255, 255, .9);
    --rh-current-input-bg: rgba(255, 255, 255, .92);
    --rh-current-input-border: rgba(124, 97, 33, .16);
    --rh-current-table-head: rgba(201, 174, 99, .08);
    --rh-current-option-bg: #fffdfa;
    --rh-current-option-text: #2f2a21;
}

html { background: #f1eadb; }
html[dir="rtl"] body { direction: rtl; }
* { box-sizing: border-box; }
body {
    background: radial-gradient(circle at top left, rgba(197,170,99,.12), transparent 28%), linear-gradient(180deg,#f9f5eb 0%,#f1eadb 100%) !important;
    color: var(--rh-current-text) !important;
    font-family: Tahoma,"Segoe UI",Arial,sans-serif !important;
    min-height: 100vh;
}
body.theme-dark,
body[data-theme="dark"] {
    --rh-current-text: #f4efe0;
    --rh-current-muted: #c5b995;
    --rh-current-heading: #e1c97d;
    --rh-current-surface: rgba(21,21,21,.98);
    --rh-current-surface-2: rgba(13,13,13,.94);
    --rh-current-surface-soft: rgba(255,255,255,.04);
    --rh-current-input-bg: rgba(255,255,255,.04);
    --rh-current-input-border: rgba(201,174,99,.16);
    --rh-current-table-head: rgba(255,255,255,.03);
    --rh-current-option-bg: #23201a;
    --rh-current-option-text: #fff6df;
    background: radial-gradient(circle at top left,rgba(197,170,99,.09),transparent 24%),linear-gradient(180deg,#050505 0%,#0e0d0b 44%,#13110e 100%) !important;
}
body, input, select, textarea, button, table, th, td { font-family: Tahoma,"Segoe UI",Arial,sans-serif !important; }
a { color: inherit; }

.app-topbar,.topbar,.top {
    border: 1px solid var(--rh-border) !important;
    border-radius: 22px !important;
    background: var(--rh-current-surface) !important;
    color: var(--rh-current-text) !important;
    box-shadow: var(--rh-shadow-soft) !important;
    backdrop-filter: blur(12px);
}
.topbar-user,.topbar-tools,.top-tools,.header-actions,.actions,.buttons { gap: 10px !important; }
.topbar-user-meta,.user-pill,.role-badge,.month-badge,.meta-chip {
    border: 1px solid var(--rh-current-input-border) !important;
    border-radius: 999px !important;
    background: var(--rh-current-surface-soft) !important;
    color: var(--rh-current-muted) !important;
}

.hero,.page-hero {
    overflow: hidden;
    background: linear-gradient(135deg,var(--rh-current-surface),var(--rh-current-surface-2)) !important;
    color: var(--rh-current-text) !important;
    border: 1px solid var(--rh-border-strong) !important;
    border-radius: 30px !important;
    box-shadow: var(--rh-shadow) !important;
}
.hero h1,.hero h2,.hero h3,.page-hero h1,.section-head h2,.card h2,.card h3,h1,h2,h3,h4 {
    color: var(--rh-current-heading) !important;
}
.hero p,.page-hero p,.section-head p,p,.hint,.muted,.summary,.note,.summary-label,.summary-foot,small {
    color: var(--rh-current-muted) !important;
}

.card,.panel,.section,.section-block,.availability-note,.login-panel,.signup-panel,
.legacy-form-card,.legacy-list-card,.stat,.summary-card,.nav-card,.chart-card,.calendar-card {
    background: linear-gradient(180deg,var(--rh-current-surface),var(--rh-current-surface-2)) !important;
    color: var(--rh-current-text) !important;
    border: 1px solid var(--rh-border) !important;
    border-radius: var(--rh-radius) !important;
    box-shadow: var(--rh-shadow-soft) !important;
}
.stat strong,.summary-value,.nav-content strong,.brandcopy strong,.info-value { color: var(--rh-current-text) !important; }

label,.field label,.legacy-form label { color: var(--rh-current-heading) !important; }
input,select,textarea {
    background: var(--rh-current-input-bg) !important;
    color: var(--rh-current-text) !important;
    border: 1px solid var(--rh-current-input-border) !important;
    border-radius: 14px !important;
    text-align: start !important;
    unicode-bidi: plaintext;
}
select,option,optgroup { color: var(--rh-current-option-text) !important; background: var(--rh-current-option-bg) !important; }
input:focus,select:focus,textarea:focus {
    outline: none !important;
    border-color: rgba(225,201,125,.58) !important;
    box-shadow: 0 0 0 4px rgba(201,174,99,.14) !important;
}
input::placeholder,textarea::placeholder { color: color-mix(in srgb,var(--rh-current-muted) 62%,transparent) !important; }

button,.action-btn,.approve-btn,.primary,.create-btn,.menu-trigger {
    border-radius: 14px !important;
    background: linear-gradient(135deg,var(--rh-gold),#d6be79) !important;
    color: #241c0d !important;
    border-color: rgba(201,174,99,.32) !important;
    box-shadow: 0 14px 28px rgba(201,174,99,.18) !important;
}
button:hover,.action-btn:hover,.approve-btn:hover,.primary:hover { transform: translateY(-1px); filter: brightness(1.03); }
.delete-btn,.danger { background: linear-gradient(135deg,#b55746,#944637) !important; color: #fff8f5 !important; }
.secondary,.icon-btn,.logout,.topbar-logout,.logout-link,.hero-back,.hero-back-btn {
    background: var(--rh-current-surface-soft) !important;
    color: var(--rh-current-text) !important;
    border: 1px solid var(--rh-current-input-border) !important;
    box-shadow: none !important;
}

.table,.table-wrap,.legacy-table-wrap,.table-responsive-wrap { overflow: auto; border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
th,td {
    padding: 12px !important;
    border-bottom: 1px solid rgba(201,174,99,.1) !important;
    color: var(--rh-current-text) !important;
    text-align: start;
    unicode-bidi: plaintext;
}
th { background: var(--rh-current-table-head) !important; color: var(--rh-current-heading) !important; }
.status-row-checkin td { background: rgba(111,168,121,.24) !important; }
.status-row-checkout td { background: rgba(207,110,91,.24) !important; }
.status-row-current td { background: rgba(201,174,99,.28) !important; }

.message.success,.toast.success { background: rgba(111,168,121,.14) !important; color: #1f5a2b !important; }
.message.error,.toast.error { background: rgba(207,110,91,.14) !important; color: #8b2d20 !important; }
.link-pill,.badge,.status {
    border-radius: 999px !important;
    border: 1px solid var(--rh-border) !important;
}

/* Dark-mode contrast layer for legacy and dynamically-created UI surfaces. */
body.theme-dark .app-topbar,
body.theme-dark .topbar,
body.theme-dark .top,
body[data-theme="dark"] .app-topbar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .top {
    background: #151513 !important;
    color: #f7f1e2 !important;
}
body.theme-dark .card,
body.theme-dark .panel,
body.theme-dark .section,
body.theme-dark .section-block,
body.theme-dark .form-section,
body.theme-dark .modal-content,
body.theme-dark .dialog,
body.theme-dark .dropdown-menu,
body.theme-dark .popover,
body.theme-dark .preview,
body[data-theme="dark"] .card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .section,
body[data-theme="dark"] .section-block,
body[data-theme="dark"] .form-section,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .dialog,
body[data-theme="dark"] .dropdown-menu,
body[data-theme="dark"] .popover,
body[data-theme="dark"] .preview {
    background: #181816 !important;
    color: #f4efe0 !important;
    border-color: rgba(225,201,125,.24) !important;
}
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark [contenteditable="true"],
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] [contenteditable="true"] {
    background: #22211e !important;
    color: #fff8e8 !important;
    caret-color: #e1c97d;
    border-color: rgba(225,201,125,.32) !important;
}
body.theme-dark input:disabled,
body.theme-dark select:disabled,
body.theme-dark textarea:disabled,
body.theme-dark input[readonly],
body[data-theme="dark"] input:disabled,
body[data-theme="dark"] select:disabled,
body[data-theme="dark"] textarea:disabled,
body[data-theme="dark"] input[readonly] {
    background: #302e29 !important;
    color: #d8cfba !important;
    opacity: 1;
}
body.theme-dark option,
body.theme-dark optgroup,
body[data-theme="dark"] option,
body[data-theme="dark"] optgroup { background: #24221e !important; color: #fff8e8 !important; }
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder,
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder { color: #aaa18e !important; opacity: 1; }
body.theme-dark table,
body.theme-dark tbody,
body[data-theme="dark"] table,
body[data-theme="dark"] tbody { background: #141412 !important; color: #f4efe0 !important; }
body.theme-dark th,
body[data-theme="dark"] th { background: #28251e !important; color: #f0d98f !important; }
body.theme-dark td,
body[data-theme="dark"] td { background-color: transparent; color: #f4efe0 !important; }
body.theme-dark tr:hover td,
body[data-theme="dark"] tr:hover td { background: rgba(225,201,125,.09) !important; color: #fffaf0 !important; }
body.theme-dark .rh-unified-header,
body.theme-dark .rh-unified-actions,
body.theme-dark .rh-table-tools,
body.theme-dark .rh-filter-panel,
body.theme-dark .rh-sort-panel,
body[data-theme="dark"] .rh-unified-header,
body[data-theme="dark"] .rh-unified-actions,
body[data-theme="dark"] .rh-table-tools,
body[data-theme="dark"] .rh-filter-panel,
body[data-theme="dark"] .rh-sort-panel {
    background: #171714 !important;
    color: #f4efe0 !important;
    border-color: rgba(225,201,125,.25) !important;
}
body.theme-dark .rh-user-pill,
body.theme-dark .rh-language-switch,
body.theme-dark .rh-header-icon,
body.theme-dark .rh-mobile-header-toggle,
body.theme-dark .rh-subscription-counter,
body.theme-dark .rh-platform-action,
body.theme-dark .rh-page-back,
body[data-theme="dark"] .rh-user-pill,
body[data-theme="dark"] .rh-language-switch,
body[data-theme="dark"] .rh-header-icon,
body[data-theme="dark"] .rh-mobile-header-toggle,
body[data-theme="dark"] .rh-subscription-counter,
body[data-theme="dark"] .rh-platform-action,
body[data-theme="dark"] .rh-page-back {
    background: #24231f !important;
    color: #f5e7bc !important;
    border-color: rgba(225,201,125,.3) !important;
}
body.theme-dark .rh-mega-menu,
body.theme-dark .rh-menu-category,
body.theme-dark .rh-menu-close,
body[data-theme="dark"] .rh-mega-menu,
body[data-theme="dark"] .rh-menu-category,
body[data-theme="dark"] .rh-menu-close {
    background: #171714 !important;
    color: #f4efe0 !important;
    border-color: rgba(225,201,125,.25) !important;
}
body.theme-dark .rh-menu-link,
body.theme-dark .rh-menu-copy b,
body[data-theme="dark"] .rh-menu-link,
body[data-theme="dark"] .rh-menu-copy b { color: #f4efe0 !important; }
body.theme-dark .rh-menu-copy small,
body[data-theme="dark"] .rh-menu-copy small { color: #beb49c !important; }
body.theme-dark .rh-menu-icon,
body[data-theme="dark"] .rh-menu-icon { background: #24231f !important; color: #f0d98f !important; }
body.theme-dark .rh-menu-link:hover,
body.theme-dark .rh-menu-link.is-current,
body[data-theme="dark"] .rh-menu-link:hover,
body[data-theme="dark"] .rh-menu-link.is-current { background: #2d2920 !important; color: #fff8e8 !important; }
body.theme-dark .section-note,
body.theme-dark .hint,
body.theme-dark .muted,
body.theme-dark small,
body[data-theme="dark"] .section-note,
body[data-theme="dark"] .hint,
body[data-theme="dark"] .muted,
body[data-theme="dark"] small { color: #beb49c !important; }
body.theme-dark .owner-contract-notice,
body.theme-dark .availability-note,
body[data-theme="dark"] .owner-contract-notice,
body[data-theme="dark"] .availability-note { background: #29251b !important; color: #f5e7bc !important; }
body.theme-dark .message.success,
body.theme-dark .toast.success,
body[data-theme="dark"] .message.success,
body[data-theme="dark"] .toast.success { background: #183321 !important; color: #d9ffe1 !important; }
body.theme-dark .message.error,
body.theme-dark .toast.error,
body[data-theme="dark"] .message.error,
body[data-theme="dark"] .toast.error { background: #3b1d18 !important; color: #ffe1dc !important; }
body.theme-dark .toast,
body.theme-dark .message,
body[data-theme="dark"] .toast,
body[data-theme="dark"] .message { color: #fff8e8 !important; }

/* Brand gold stays light, therefore its text remains deliberately dark. */
body.theme-dark button.primary,
body.theme-dark button.action-btn,
body.theme-dark button.approve-btn,
body.theme-dark .rh-menu-trigger,
body.theme-dark .rh-filter-toggle,
body.theme-dark .rh-sort-toggle,
body[data-theme="dark"] button.primary,
body[data-theme="dark"] button.action-btn,
body[data-theme="dark"] button.approve-btn,
body[data-theme="dark"] .rh-menu-trigger,
body[data-theme="dark"] .rh-filter-toggle,
body[data-theme="dark"] .rh-sort-toggle { color: #211a0c !important; }

html[dir="rtl"] th,html[dir="rtl"] td,html[dir="rtl"] input,html[dir="rtl"] select,
html[dir="rtl"] textarea,html[dir="rtl"] label { text-align: right !important; }

@media (max-width: 900px) {
    .app-topbar,.topbar,.top { margin: 10px !important; padding: 14px !important; border-radius: 18px !important; }
    .wrap,.content { margin-inline: 10px !important; padding-inline: 10px !important; }
    .hero,.page-hero,.panel,.card { border-radius: 20px !important; }
    .hero h1,.page-hero h1 { font-size: 30px !important; }
    table { min-width: 760px; }
}

@media print {
    body { background: #fff !important; }
    .top,.topbar,.app-topbar,.filters,.buttons,.actions { box-shadow: none !important; }
    .hero,.page-hero,.panel,.card,.stat { box-shadow: none !important; }
}
