/* ==========================================================================
   RISERVA ROOFTOP NAPOLI — LUXURY FINE-DINING & FIVE-STAR HOSPITALITY SUITE
   Palette coordinata ufficiale:
     Nero carbone   : #111111
     Oro champagne  : #C6A76A
     Avorio         : #F7F4ED
     Bianco caldo   : #FFFFFF
     Grigio elegante: #737373
   Tipografia:
     Titoli         : 'Playfair Display', Georgia, serif
     Operativita    : 'Inter', -apple-system, BlinkMacSystemFont, sans-serif
   ========================================================================== */

:root,
[data-theme="dark"] {
    color-scheme: dark;

    --lux-charcoal: #111111;
    --lux-gold: #C6A76A;
    --lux-gold-hover: #D6BA82;
    --lux-gold-deep: #A6874B;
    --lux-gold-soft: rgba(198, 167, 106, 0.12);
    --lux-gold-glow: rgba(198, 167, 106, 0.22);
    --lux-gold-border: rgba(198, 167, 106, 0.28);
    --lux-ivory: #F7F4ED;
    --lux-white: #FFFFFF;
    --lux-grey: #737373;

    --bg-canvas: #111111;
    --bg-canvas-gradient:
        radial-gradient(ellipse 88% 52% at 50% -14%, rgba(198, 167, 106, 0.11) 0%, rgba(198, 167, 106, 0.025) 46%, transparent 74%),
        radial-gradient(circle at 92% 8%, rgba(198, 167, 106, 0.05) 0%, transparent 38%),
        #111111;
    --bg-topbar-glass: rgba(17, 17, 17, 0.84);
    --bg-elevated: #171614;
    --bg-card: #1A1917;
    --bg-card-hover: #211F1C;
    --bg-subtle: #141312;
    --bg-input: #121211;
    --bg-sidebar: linear-gradient(180deg, #10100F 0%, #0A0A09 100%);

    --text-primary: #F7F4ED;
    --text-secondary: #D0CAC0;
    --text-muted: #9A948A;
    --text-on-gold: #111111;

    --border-subtle: rgba(247, 244, 237, 0.085);
    --border-strong: rgba(198, 167, 106, 0.34);
    --card-inner-highlight: inset 0 1px 0 rgba(247, 244, 237, 0.045);

    /* Alias compatibilita universale pagine suite */
    --lux-surface: var(--bg-card);
    --lux-surface-2: var(--bg-subtle);
    --lux-border: var(--border-subtle);
    --lux-border-gold: var(--border-strong);
    --lux-text-soft: var(--text-secondary);

    --status-ok: #7CC090;
    --status-ok-bg: rgba(124, 192, 144, 0.12);
    --status-warn: #E2B467;
    --status-warn-bg: rgba(226, 180, 103, 0.13);
    --status-danger: #E48282;
    --status-danger-bg: rgba(228, 130, 130, 0.13);
    --status-info: #C6A76A;
    --status-info-bg: rgba(198, 167, 106, 0.13);

    --shadow-card: 0 20px 48px rgba(0, 0, 0, 0.44);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.28);
    --shadow-gold: 0 8px 24px rgba(198, 167, 106, 0.20);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --sidebar-width: 280px;
}

[data-theme="light"] {
    color-scheme: light;

    --bg-canvas: #F7F4ED;
    --bg-canvas-gradient:
        radial-gradient(ellipse 85% 48% at 50% -12%, rgba(198, 167, 106, 0.16) 0%, rgba(198, 167, 106, 0.03) 48%, transparent 74%),
        #F7F4ED;
    --bg-topbar-glass: rgba(247, 244, 237, 0.88);
    --bg-elevated: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FCFBF8;
    --bg-subtle: #F1EDE4;
    --bg-input: #FFFFFF;
    --bg-sidebar: linear-gradient(180deg, #141312 0%, #0D0D0C 100%);

    --text-primary: #111111;
    --text-secondary: #383530;
    --text-muted: #737373;
    --text-on-gold: #111111;

    --border-subtle: rgba(17, 17, 17, 0.09);
    --border-strong: rgba(198, 167, 106, 0.52);
    --card-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.8);

    --lux-surface: var(--bg-card);
    --lux-surface-2: var(--bg-subtle);
    --lux-border: var(--border-subtle);
    --lux-border-gold: var(--border-strong);
    --lux-text-soft: var(--text-secondary);

    --status-ok: #1E6B40;
    --status-ok-bg: rgba(30, 107, 64, 0.10);
    --status-warn: #946112;
    --status-warn-bg: rgba(198, 167, 106, 0.22);
    --status-danger: #A62626;
    --status-danger-bg: rgba(166, 38, 38, 0.09);
    --status-info: #85652C;
    --status-info-bg: rgba(198, 167, 106, 0.16);

    --shadow-card: 0 18px 42px rgba(17, 17, 17, 0.07);
    --shadow-soft: 0 6px 20px rgba(17, 17, 17, 0.045);
    --shadow-gold: 0 8px 22px rgba(198, 167, 106, 0.24);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background-color: var(--bg-canvas);
}

body,
body.lux-body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg-canvas);
    background-image: var(--bg-canvas-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.58;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.22s ease, color 0.22s ease;
}

::selection {
    background: rgba(198, 167, 106, 0.32);
    color: var(--text-primary);
}

/* Custom Minimal Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(198, 167, 106, 0.26);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(198, 167, 106, 0.48);
}

h1, h2, h3, h4, .lux-serif {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--text-primary);
    margin-top: 0;
}

a {
    color: var(--lux-gold);
    transition: color 0.16s ease;
}

a:hover {
    color: var(--lux-gold-hover);
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.83em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(198, 167, 106, 0.11);
    border: 1px solid rgba(198, 167, 106, 0.22);
    color: var(--lux-gold);
}

[data-theme="light"] code {
    color: #7D5E26;
    background: rgba(198, 167, 106, 0.15);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--lux-gold);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.lux-muted {
    color: var(--text-muted);
}

.lux-hairline {
    height: 1px;
    border: 0;
    margin: 20px 0;
    background: linear-gradient(90deg, transparent 0%, var(--border-strong) 50%, transparent 100%);
}

/* ==========================================================================
   APP SHELL & FIVE-STAR ARCHITECTURAL SIDEBAR
   ========================================================================== */

.lux-app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.lux-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    color: #F7F4ED;
    border-right: 1px solid rgba(198, 167, 106, 0.20);
    box-shadow: 10px 0 36px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 90;
}

.lux-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px 22px 22px;
    text-decoration: none;
    border-bottom: 1px solid rgba(198, 167, 106, 0.14);
    position: relative;
}

.lux-sidebar-brand::after {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, rgba(198, 167, 106, 0.55), transparent);
}

.lux-brand-crest {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(198, 167, 106, 0.62);
    background:
        radial-gradient(circle at 30% 25%, rgba(214, 186, 130, 0.28), rgba(198, 167, 106, 0.05) 70%),
        #151412;
    box-shadow:
        inset 0 0 0 2px rgba(17, 17, 17, 0.72),
        inset 0 0 0 3px rgba(198, 167, 106, 0.20),
        0 6px 18px rgba(0, 0, 0, 0.35);
    color: var(--lux-gold);
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lux-brand-meta {
    min-width: 0;
}

.lux-brand-title {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.12rem;
    font-weight: 600;
    color: #F7F4ED;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.lux-brand-subtitle {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--lux-gold);
    margin-top: 4px;
}

.lux-sidebar-nav {
    padding: 20px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.lux-nav-group-label {
    padding: 0 12px;
    margin-bottom: 7px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8E887E;
}

.lux-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lux-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    color: #D2CDC3;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lux-nav-link-main {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.lux-nav-icon {
    width: 18px;
    height: 18px;
    color: #9C968B;
    flex-shrink: 0;
    transition: color 0.16s ease, transform 0.16s ease;
}

.lux-nav-link:hover {
    background: rgba(247, 244, 237, 0.055);
    color: #FFFFFF;
}

.lux-nav-link:hover .lux-nav-icon {
    color: var(--lux-gold);
}

.lux-nav-link.is-active {
    background: linear-gradient(90deg, rgba(198, 167, 106, 0.18) 0%, rgba(198, 167, 106, 0.06) 100%);
    border-color: rgba(198, 167, 106, 0.34);
    box-shadow: inset 3px 0 0 var(--lux-gold);
    color: #F7F4ED;
    font-weight: 600;
}

.lux-nav-link.is-active .lux-nav-icon {
    color: var(--lux-gold);
}

.lux-nav-badge {
    min-width: 21px;
    height: 21px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(198, 167, 106, 0.20);
    color: var(--lux-gold);
}

.lux-nav-badge.is-alert {
    background: linear-gradient(135deg, #D6BA82, #C6A76A);
    color: #111111;
    box-shadow: 0 2px 10px rgba(198, 167, 106, 0.35);
}

.lux-sidebar-footer {
    padding: 16px 16px 20px;
    border-top: 1px solid rgba(247, 244, 237, 0.08);
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lux-sidebar-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(247, 244, 237, 0.04);
    border: 1px solid rgba(198, 167, 106, 0.16);
    font-size: 0.78rem;
    font-weight: 500;
    color: #E2DDD3;
}

.lux-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7CC090;
    box-shadow: 0 0 0 3px rgba(124, 192, 144, 0.20);
    flex-shrink: 0;
}

.lux-sidebar-actions {
    display: flex;
    gap: 8px;
}

.lux-theme-btn,
.lux-logout-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(247, 244, 237, 0.14);
    background: rgba(247, 244, 237, 0.02);
    color: #E7E2D8;
    font-family: inherit;
    font-size: 0.77rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.lux-theme-btn:hover,
.lux-logout-btn:hover {
    border-color: var(--lux-gold);
    color: var(--lux-gold);
    background: rgba(198, 167, 106, 0.10);
}

/* ==========================================================================
   MAIN CONTENT AREA, FROSTED TOPBAR & MOBILE BAR
   ========================================================================== */

.lux-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.lux-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(17, 17, 17, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #F7F4ED;
    border-bottom: 1px solid rgba(198, 167, 106, 0.26);
    position: sticky;
    top: 0;
    z-index: 85;
}

.lux-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(198, 167, 106, 0.45);
    background: rgba(198, 167, 106, 0.14);
    color: var(--lux-gold);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.lux-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(3px);
    z-index: 88;
}

.lux-topbar {
    position: sticky;
    top: 0;
    z-index: 75;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 22px 34px 19px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-topbar-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.lux-topbar::after {
    content: '';
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, rgba(198, 167, 106, 0.38), rgba(198, 167, 106, 0.06) 45%, transparent);
    pointer-events: none;
}

.lux-topbar-titles {
    min-width: 0;
}

.lux-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--lux-gold);
    margin-bottom: 5px;
}

[data-theme="light"] .lux-eyebrow {
    color: #9A793B;
}

.lux-page-title {
    font-size: clamp(1.5rem, 2.25vw, 2.02rem);
    margin: 0;
    line-height: 1.16;
}

.lux-page-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.89rem;
    max-width: 780px;
}

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

.lux-container {
    width: 100%;
    max-width: 1460px;
    margin: 0 auto;
    padding: 26px 34px 54px;
}

/* ==========================================================================
   CARDS, KPI STRIPS, BADGES, ALERTS, BUTTONS & FORMS
   ========================================================================== */

.lux-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    box-shadow: var(--shadow-soft), var(--card-inner-highlight);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lux-card:hover {
    border-color: rgba(198, 167, 106, 0.18);
}

.lux-card-gold {
    border-color: var(--border-strong);
    background:
        radial-gradient(circle at top right, rgba(198, 167, 106, 0.10), transparent 52%),
        linear-gradient(165deg, var(--bg-card) 0%, rgba(198, 167, 106, 0.045) 100%);
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(198, 167, 106, 0.16);
}

.lux-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.lux-card-title {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.24;
}

.lux-card-desc {
    margin: 5px 0 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.lux-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.lux-kpi-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-soft), var(--card-inner-highlight);
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.lux-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(198, 167, 106, 0.65), rgba(198, 167, 106, 0.05));
    opacity: 0.55;
    transition: opacity 0.18s ease;
}

.lux-kpi-card:hover {
    border-color: var(--lux-gold-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.lux-kpi-card:hover::before {
    opacity: 1;
}

.lux-kpi-label {
    font-size: 0.71rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.lux-kpi-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-variant-numeric: lining-nums;
    font-size: 1.95rem;
    font-weight: 600;
    line-height: 1.08;
    color: var(--text-primary);
}

.lux-kpi-meta {
    font-size: 0.79rem;
    color: var(--text-muted);
}

/* Buttons */
.lux-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 17px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.lux-btn:hover:not(:disabled) {
    border-color: var(--lux-gold);
    color: var(--lux-gold);
}

.lux-btn:disabled {
    opacity: 0.46;
    cursor: not-allowed;
    transform: none !important;
}

.lux-btn-gold {
    background: linear-gradient(135deg, #D7BA80 0%, #C6A76A 55%, #B49355 100%);
    border-color: #D2B47A;
    color: #111111;
    box-shadow: var(--shadow-gold);
}

.lux-btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, #E1C792 0%, #D1B377 55%, #C09F60 100%);
    border-color: #DFC48E;
    color: #111111;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(198, 167, 106, 0.30);
}

.lux-btn-outline {
    background: rgba(198, 167, 106, 0.04);
    border-color: var(--border-strong);
    color: var(--lux-gold);
    box-shadow: none;
}

[data-theme="light"] .lux-btn-outline {
    color: #88682E;
}

.lux-btn-outline:hover:not(:disabled) {
    background: var(--lux-gold-soft);
    border-color: var(--lux-gold);
    color: var(--lux-gold-hover);
}

[data-theme="light"] .lux-btn-outline:hover:not(:disabled) {
    color: #6B4F1D;
}

.lux-btn-danger {
    background: var(--status-danger-bg);
    border-color: rgba(228, 130, 130, 0.34);
    color: var(--status-danger);
    box-shadow: none;
}

.lux-btn-danger:hover:not(:disabled) {
    background: rgba(228, 130, 130, 0.20);
    border-color: var(--status-danger);
    color: var(--status-danger);
}

.lux-btn-sm {
    min-height: 34px;
    padding: 6px 13px;
    font-size: 0.79rem;
}

/* Badges (supporta sia .lux-badge-* sia .lux-badge.is-*) */
.lux-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.lux-badge-gold,
.lux-badge.is-gold {
    background: var(--status-info-bg);
    border-color: var(--border-strong);
    color: var(--lux-gold);
}

[data-theme="light"] .lux-badge-gold,
[data-theme="light"] .lux-badge.is-gold {
    color: #84642B;
}

.lux-badge-ok,
.lux-badge.is-ok,
.lux-badge.is-success {
    background: var(--status-ok-bg);
    border-color: rgba(124, 192, 144, 0.34);
    color: var(--status-ok);
}

.lux-badge-warn,
.lux-badge.is-warn {
    background: var(--status-warn-bg);
    border-color: rgba(226, 180, 103, 0.36);
    color: var(--status-warn);
}

.lux-badge-danger,
.lux-badge.is-danger {
    background: var(--status-danger-bg);
    border-color: rgba(228, 130, 130, 0.36);
    color: var(--status-danger);
}

.lux-badge.is-muted {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

/* Alerts (supporta ok/success, warn, danger/error, info) */
.lux-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 0.88rem;
    line-height: 1.55;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
}

.lux-alert-ok,
.lux-alert-success {
    background: var(--status-ok-bg);
    border-color: rgba(124, 192, 144, 0.36);
    color: var(--status-ok);
}

.lux-alert-warn {
    background: var(--status-warn-bg);
    border-color: rgba(226, 180, 103, 0.40);
    color: var(--status-warn);
}

.lux-alert-danger,
.lux-alert-error {
    background: var(--status-danger-bg);
    border-color: rgba(228, 130, 130, 0.40);
    color: var(--status-danger);
}

.lux-alert-info {
    background: var(--status-info-bg);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Forms */
.lux-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.lux-label {
    display: inline-block;
    font-size: 0.79rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.lux-field > .lux-label {
    margin-bottom: 0;
}

.lux-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.lux-input,
.lux-select,
.lux-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.lux-input::placeholder,
.lux-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

.lux-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C6A76A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.lux-input:hover,
.lux-select:hover,
.lux-textarea:hover {
    border-color: rgba(198, 167, 106, 0.28);
}

.lux-input:focus,
.lux-select:focus,
.lux-textarea:focus {
    outline: none;
    border-color: var(--lux-gold);
    box-shadow: 0 0 0 3px rgba(198, 167, 106, 0.16);
}

.lux-textarea {
    min-height: 98px;
    resize: vertical;
    line-height: 1.55;
}

/* Sub-tabs */
.lux-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    margin-bottom: 22px;
}

.lux-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.lux-tab:hover {
    color: var(--text-primary);
}

.lux-tab.is-active {
    background: var(--bg-card);
    color: var(--lux-gold);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

[data-theme="light"] .lux-tab.is-active {
    color: #85652C;
}

/* ==========================================================================
   3-COLUMN PREMIUM INBOX (INSTAGRAM & WHATSAPP CONCIERGE)
   ========================================================================== */

.lux-inbox-grid {
    display: grid;
    grid-template-columns: 324px minmax(0, 1fr) 324px;
    gap: 18px;
    align-items: start;
}

.lux-inbox-grid-2col {
    display: grid;
    grid-template-columns: 334px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.lux-thread-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 680px;
    overflow-y: auto;
    padding-right: 3px;
}

.lux-thread-item {
    display: block;
    padding: 14px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.lux-thread-item:hover {
    border-color: var(--lux-gold-border);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.lux-thread-item.is-active {
    border-color: var(--lux-gold);
    background: linear-gradient(145deg, rgba(198, 167, 106, 0.15), rgba(198, 167, 106, 0.05));
    box-shadow: inset 3px 0 0 var(--lux-gold);
}

.lux-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.lux-thread-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lux-thread-time {
    font-size: 0.73rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.lux-thread-preview {
    font-size: 0.81rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lux-chat-stream {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.lux-bubble {
    max-width: 82%;
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 0.89rem;
    line-height: 1.55;
    word-wrap: break-word;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.lux-bubble-user {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.lux-bubble-assistant {
    align-self: flex-end;
    background: linear-gradient(145deg, rgba(198, 167, 106, 0.17), rgba(198, 167, 106, 0.08));
    border: 1px solid rgba(198, 167, 106, 0.36);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.lux-bubble-draft {
    align-self: stretch;
    max-width: 100%;
    background: linear-gradient(135deg, rgba(198, 167, 106, 0.13), rgba(198, 167, 106, 0.04));
    border: 1px dashed var(--lux-gold);
    color: var(--text-primary);
}

.lux-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid rgba(247, 244, 237, 0.06);
    font-size: 0.72rem;
    color: var(--text-muted);
}

[data-theme="light"] .lux-bubble-meta {
    border-top-color: rgba(17, 17, 17, 0.06);
}

/* Tables */
.lux-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.lux-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.lux-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.71rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.lux-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: top;
}

.lux-table tbody tr:last-child td {
    border-bottom: 0;
}

.lux-table tbody tr:hover td {
    background: rgba(198, 167, 106, 0.04);
}

/* Grid helpers */
.lux-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

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

.lux-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--lux-gold-soft);
    color: var(--lux-gold);
    border: 1px solid var(--lux-gold-border);
}

[data-theme="light"] .lux-tag-chip {
    color: #84642B;
}

/* Modal / Drawer */
.lux-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.76);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 120;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lux-modal-backdrop.is-open {
    display: flex;
}

.lux-modal {
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   RESPONSIVE DESIGN (DESKTOP, TABLET, SMARTPHONE)
   ========================================================================== */

@media (max-width: 1260px) {
    .lux-inbox-grid {
        grid-template-columns: 296px minmax(0, 1fr);
    }
    .lux-inbox-crm-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .lux-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-104%);
        transition: transform 0.22s ease;
    }
    .lux-sidebar.is-open {
        transform: translateX(0);
    }
    .lux-sidebar-backdrop.is-open {
        display: block;
    }
    .lux-mobile-header {
        display: flex;
    }
    .lux-topbar {
        position: static;
        padding: 18px 20px;
    }
    .lux-topbar::after {
        left: 20px;
        right: 20px;
    }
    .lux-container {
        padding: 20px 20px 40px;
    }
    .lux-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .lux-inbox-grid,
    .lux-inbox-grid-2col,
    .lux-grid-2,
    .lux-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
    .lux-topbar {
        padding: 16px;
    }
    .lux-container {
        padding: 16px 14px 36px;
    }
    .lux-card {
        padding: 18px 16px;
    }
}
