/**
 * Enterprise RMM theme — matches frontend/src/theme/theme.ts + AmbientBackground
 */
:root {
    --bg-base: #08070C;
    --bg-content: rgba(12, 11, 18, 0.72);
    --bg-table: rgba(16, 14, 22, 0.55);
    --bg-mesh-1: rgba(232, 137, 58, 0.1);
    --bg-mesh-2: rgba(240, 163, 90, 0.09);
    --bg-mesh-3: rgba(232, 137, 58, 0.08);

    --glass-bg: rgba(16, 14, 22, 0.88);
    --glass-bg-elevated: rgba(20, 18, 28, 0.92);
    --glass-bg-inset: rgba(8, 7, 12, 0.95);
    --glass-blur: blur(16px);
    --glass-blur-light: blur(12px);

    --border-glass: rgba(232, 137, 58, 0.14);
    --border-subtle: rgba(232, 137, 58, 0.12);
    --border-highlight: rgba(232, 137, 58, 0.28);

    --text-primary: #F4F0FF;
    --text-secondary: rgba(196, 191, 214, 0.62);
    --text-tertiary: rgba(196, 191, 214, 0.38);

    --accent: #E8893A;
    --accent-hover: #F0A35A;
    --accent-muted: rgba(232, 137, 58, 0.22);
    --accent-subtle: rgba(232, 137, 58, 0.08);
    --accent-glow: rgba(232, 137, 58, 0.55);

    --secondary: #A78BFA;

    --success: #3DDC97;
    --error: #F87171;
    --warning: #F0A35A;

    --bg-primary: var(--bg-base);
    --bg-secondary: var(--glass-bg-elevated);
    --bg-tertiary: var(--glass-bg);
    --input-bg: rgba(8, 7, 12, 0.85);
    --border-color: var(--border-glass);
    --accent-primary: var(--accent);
    --nav-hover-bg: rgba(232, 137, 58, 0.08);

    --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
    --font-display: "Syne", "DM Sans", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 12px;
    --radius-2xl: 14px;
    --radius-pill: 8px;

    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-focus: 0 0 0 1px rgba(232, 137, 58, 0.45);
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
}

#rmm-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #08070C;
}

#app-root,
body.auth-page {
    position: relative;
    z-index: 1;
}

#app-root .app-container,
body.auth-page .auth-main {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4,
.dashboard-section-title,
.chart-card__title,
.page-title,
.domain-toolbar__title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.glass-panel,
.dashboard-card,
.card,
.stat-card,
.metric-card,
.content-panel,
.auth-card {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-glass);
}

.admin-sidebar {
    background: rgba(12, 11, 18, 0.72) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(232, 137, 58, 0.14) !important;
}

.admin-brand__text {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #F4F0FF;
}

.admin-brand__logo {
    display: none;
}

.admin-brand::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E8893A;
    box-shadow: 0 0 10px rgba(232, 137, 58, 0.55);
    flex-shrink: 0;
}

.sidebar-link::before {
    background: #E8893A !important;
}

.sidebar-link.is-active {
    color: #F0A35A !important;
    background: rgba(232, 137, 58, 0.08) !important;
    border-radius: var(--radius-md);
}

.sidebar-link:hover {
    color: #F4F0FF !important;
    background: rgba(232, 137, 58, 0.06) !important;
    border-radius: var(--radius-md);
}

.sidebar-link.is-active svg,
.sidebar-link:hover svg {
    color: #E8893A;
    opacity: 1;
}

.sidebar-user__role {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: lowercase;
}

.sidebar-logout {
    border: 1px solid rgba(232, 137, 58, 0.18);
    border-radius: 10px;
    color: rgba(244, 240, 255, 0.75);
}

.sidebar-logout:hover {
    color: #E8893A;
    border-color: rgba(232, 137, 58, 0.4);
    background: rgba(232, 137, 58, 0.08);
}

.main-content,
.app-body {
    background: transparent !important;
}

.app-body--rain-host {
    position: relative;
}

.admin-content-rain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
}

.app-body > *:not(.admin-content-rain) {
    position: relative;
    z-index: 1;
}

button,
.btn,
.auth-submit,
.toolbar-btn,
.primary-btn,
.modal-btn--primary {
    font-family: var(--font);
    font-weight: 600;
    border-radius: 12px !important;
    text-transform: none !important;
}

.primary-btn,
.auth-submit:not(.auth-submit--ghost),
.modal-btn--primary,
button[type="submit"]:not(.auth-submit--ghost) {
    background: linear-gradient(135deg, #E8893A 0%, #C45C26 100%) !important;
    border: 1px solid rgba(232, 137, 58, 0.45) !important;
    color: #08070C !important;
    box-shadow: 0 4px 20px rgba(232, 137, 58, 0.25);
}

.primary-btn:hover,
.auth-submit:not(.auth-submit--ghost):hover,
.modal-btn--primary:hover {
    background: linear-gradient(135deg, #F0A35A 0%, #E8893A 100%) !important;
    box-shadow: 0 6px 28px rgba(232, 137, 58, 0.35);
}

.auth-submit--ghost {
    background: rgba(232, 137, 58, 0.1) !important;
    border: 1px solid rgba(232, 137, 58, 0.35) !important;
    color: #F4F0FF !important;
}

.auth-submit--ghost:hover {
    background: rgba(232, 137, 58, 0.18) !important;
    border-color: rgba(232, 137, 58, 0.55) !important;
    color: #F0A35A !important;
}

input,
select,
textarea,
.auth-field__input,
.form-input,
.search-input {
    background: var(--input-bg) !important;
    border: 1px solid rgba(232, 137, 58, 0.18) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    font-family: var(--font);
}

input:focus,
select:focus,
textarea:focus,
.auth-field__input:focus {
    outline: none;
    border-color: rgba(232, 137, 58, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(232, 137, 58, 0.12);
}

th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid rgba(232, 137, 58, 0.14) !important;
}

tr:hover td {
    background: rgba(232, 137, 58, 0.04) !important;
}

.status-text.online,
.badge--success,
.chip-live {
    color: #3DDC97 !important;
    border-color: rgba(61, 220, 151, 0.45) !important;
}

.status-text.offline,
.badge--error {
    color: #F87171 !important;
}

.toggle-switch.active .toggle-slider {
    background: #E8893A !important;
}

.toggle-switch.active {
    border-color: rgba(232, 137, 58, 0.5) !important;
}

.metric-card__value {
    font-family: var(--font-mono);
    color: #F4F0FF;
}

.metric-card__icon svg {
    color: #E8893A;
}

.domain-toolbar {
    border-bottom: 1px solid rgba(232, 137, 58, 0.14);
}

.domain-toolbar__pill {
    background: rgba(232, 137, 58, 0.12);
    border: 1px solid rgba(232, 137, 58, 0.28);
    color: #F0A35A;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.modal-overlay {
    backdrop-filter: blur(8px);
    background: rgba(8, 7, 12, 0.75) !important;
}

.modal-panel,
.modal-content {
    background: var(--glass-bg) !important;
    border: 1px solid rgba(232, 137, 58, 0.2) !important;
    border-radius: var(--radius-lg) !important;
    backdrop-filter: var(--glass-blur);
}

::-webkit-scrollbar-thumb {
    background: rgba(232, 137, 58, 0.25);
}

body.auth-page--login {
    --auth-ink: #08070C;
    --auth-panel: rgba(16, 14, 22, 0.88);
    --auth-line: rgba(232, 137, 58, 0.14);
    --auth-text: #F4F0FF;
    --auth-muted: rgba(196, 191, 214, 0.62);
    --auth-field: rgba(8, 7, 12, 0.85);
    background: #08070C !important;
    font-family: var(--font);
}

.auth-atmosphere {
    background:
        radial-gradient(ellipse 70% 50% at 50% 110%, rgba(232, 137, 58, 0.08), transparent 60%),
        radial-gradient(ellipse 55% 40% at 50% 35%, rgba(167, 139, 250, 0.04), transparent 70%),
        linear-gradient(180deg, rgba(8, 7, 12, 0.2) 0%, rgba(8, 7, 12, 0.65) 100%) !important;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.5);
}

.auth-card--mist {
    background: rgba(16, 14, 22, 0.88) !important;
    border: 1px solid rgba(232, 137, 58, 0.22) !important;
    border-radius: 16px !important;
    backdrop-filter: blur(20px);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(232, 137, 58, 0.08);
}

.auth-field__label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.admin-topbar,
.auth-topbar {
    background: rgba(12, 11, 18, 0.72) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(232, 137, 58, 0.14) !important;
}

code,
.mono,
.session-id,
.ip-address {
    font-family: var(--font-mono) !important;
    color: #F0A35A;
}
