/* 
    OHM V3 - Centralized Design System
    Theme: Modern Hybrid (Glassmorphism & Vibrant Gradients)
    Version: 3.0.0
*/

:root {
    /* DEFAULT: DARK MODE */
    --bg-main: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --bg-attachment: fixed;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-header: rgba(15, 23, 42, 0.4);

    --ink: #f8fafc;
    --muted: #94a3b8;
    --accent: #818cf8;
    --accent-glow: rgba(129, 140, 248, 0.4);
    --body-bg: #0f172a;
    --select-option-bg: #0f172a;
    --select-option-highlight: #f59e0b;
    accent-color: var(--select-option-highlight);

    --radius: 24px;
    --font: "Outfit", sans-serif;

    /* Logic Palette */
    --good: #10b981;
    --bad: #ef4444;
    --warn: #f59e0b;

    /* Typographic Scale */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-kpi: 32px;

    /* Spacing System */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --card-padding: 28px 36px;
    --input-padding: 14px 24px;
    --btn-padding: 12px 20px;

    /* Line Heights */
    --lh-tight: 1.35;
    --lh-base: 1.5;
    --lh-relaxed: 1.6;
}

body.light-mode {
    color-scheme: light;
    accent-color: #0066cc;
    --select-option-bg: #ffffff;
    --select-option-highlight: #0066cc;
    /* LIGHT MODE - Premium Look */
    --bg-main: #f5f5f7;
    --bg-attachment: initial;
    --glass: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.95);
    --glass-header: rgba(255, 255, 255, 0.4);

    --ink: #1d1d1f;
    --muted: #86868b;
    --accent: #0066cc;
    --accent-glow: rgba(0, 102, 204, 0.2);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    margin: 0;
    padding: 100px 24px 80px;
    background: var(--bg-main);
    background-attachment: var(--bg-attachment);
    color: var(--ink);
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
    /* Windows: liste native <select> dark + accent portocaliu (altfel rămân albe/albastre) */
    color-scheme: dark;
}

/* --- Auth pages: login / register / forgot-password --- */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 10px;
}

.auth-brand-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-brand-title {
    font-size: 42px;
    margin: 0;
    letter-spacing: 0.08em;
    line-height: 1;
}

.auth-brand-title .brand-bim {
    background: linear-gradient(90deg, #06b6d4, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand-sub {
    margin: 12px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-size: 24px;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.auth-brand-sub-line {
    width: 68px;
    height: 2px;
}

.auth-brand-sub-line--l {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.65));
}

.auth-brand-sub-line--r {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.65), rgba(37, 99, 235, 0));
}

.auth-brand-ohm {
    color: #22c55e;
    font-weight: 800;
}

.auth-brand-sub a {
    color: inherit;
    text-decoration: none;
}

.auth-brand-sub a:hover {
    opacity: 0.92;
}

.auth-brand-sub a:hover .auth-brand-ohm {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Login / register / reset parolă — tagline discret sub BIMFLOW */
body.auth-page .auth-brand-sub {
    font-size: 16px;
    gap: 12px;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

body.auth-page .auth-brand-sub-line {
    width: 48px;
    height: 1.5px;
}

@media (max-width: 480px) {
    .auth-brand-logo {
        width: 96px;
        height: 96px;
        margin-bottom: 4px;
    }

    .auth-brand-title {
        font-size: 32px;
    }

    .auth-brand-sub {
        font-size: 20px;
        gap: 12px;
    }

    .auth-brand-sub-line {
        width: 52px;
    }

    body.auth-page .auth-brand-sub {
        font-size: 14px;
        gap: 10px;
    }

    body.auth-page .auth-brand-sub-line {
        width: 40px;
    }
}

/* --- COMPONENTS: HEADER --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 72px;
    background: var(--glass-header);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border-bottom: 1px solid var(--glass-border);
    box-sizing: border-box;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.4), rgba(129, 140, 248, 0.4), rgba(45, 212, 191, 0.4), transparent);
    background-size: 200% auto;
    animation: shineHeaderLine 4s linear infinite;
}

@keyframes shineHeaderLine {
    to {
        background-position: 200% center;
    }
}

/* Mobile perf: reduce heavy blur/animations in header */
@media (max-width: 600px) {
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0 20px;
    }
    .site-header::after {
        animation: none;
    }
}

.header-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .header-brand,
.header-brand {
    --header-logo-size: 52px;
    --header-logo-gap: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-header .header-brand-top,
.header-brand-top {
    display: inline-flex;
    align-items: center;
    gap: var(--header-logo-gap);
    line-height: 1;
}

.header-brand img,
.site-header .header-brand img {
    width: var(--header-logo-size);
    height: var(--header-logo-size);
    object-fit: contain;
    flex-shrink: 0;
}

.site-header .header-brand-title-row {
    display: inline-flex;
    align-items: center;
    gap: var(--header-logo-gap, 12px);
}

.site-header .header-brand .brand-subtitle {
    margin: 5px 0 0 calc(var(--header-logo-size, 52px) + var(--header-logo-gap, 12px));
}

.header-nav {
    display: flex;
    gap: 36px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.site-header .header-nav a,
.header-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.header-nav a:hover,
.header-nav a.active {
    background: linear-gradient(135deg, #2dd4bf, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- COMPONENTS: HERO --- */
.title-block {
    text-align: center;
    margin-bottom: 80px;
    margin-top: 40px;
}

.hub-main-title {
    font-size: 64px;
    font-weight: 800;
    background: linear-gradient(to right, var(--ink), var(--accent), var(--ink));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.sub {
    font-size: 22px;
    color: var(--muted);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.4;
}

/* --- COMPONENTS: TOOLBAR --- */
.toolbar {
    max-width: 1000px;
    margin: 0 auto 80px;
    display: grid;
    grid-template-columns: 1fr 1fr 120px;
    gap: 16px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.field {
    position: relative;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: var(--input-padding);
    border-radius: 16px;
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: var(--lh-base);
    outline: none;
    transition: all 0.3s;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201.5L6%206.5L11%201.5%22%20stroke%3D%22white%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 48px;
    /* space for the arrow */
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background-color: #fff;
    color: #000;
}

body.light-mode select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201.5L6%206.5L11%201.5%22%20stroke%3D%22%230f172a%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 18px center;
}

/* Listă deschisă <select>: pe Windows fără color-scheme rămâne popup alb/albastru OS */
select option {
    background: var(--select-option-bg);
    color: var(--ink);
}

body.light-mode select option {
    background: var(--select-option-bg);
    color: #0f172a;
}

/* Unde browserul permite (ex. macOS, unele Chromium), evidențiere portocalie */
select option:checked,
select option:hover {
    background: var(--select-option-highlight);
    color: #0f172a;
}

body.light-mode select option:checked,
body.light-mode select option:hover {
    color: #ffffff;
}

/* Folosim doar background-color la focus; shorthand-ul `background` șterge
   background-image (ex. săgeata custom la <select>) și poate strica randarea.
   .ta-big (rezultate) e exclus — rămâne mereu „foaie” albă, fără întunecare. */
input:focus,
textarea:focus:not(.ta-big) {
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px var(--accent-glow);
}

select:focus {
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px var(--accent-glow);
}

body.light-mode input:focus,
body.light-mode textarea:focus:not(.ta-big) {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

body.light-mode select:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- READONLY / REZULTATE: selecție clară, focus fără să întunece tot chenarul ---
   Regula globală textarea:focus folosește background mai închis și poate face
   impresia că „s-a închis” tot blocul la click/selectare. */
textarea[readonly],
textarea#results_txt,
textarea#txt_results {
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}

/* Fișă rezultate (readonly + .ta-big): mereu albă, același contrast în dark și light; fără să se închidă la culoare la focus */
textarea.ta-big,
textarea.ta-big[readonly],
textarea#results_txt,
textarea#txt_results,
textarea.txtbox[readonly],
textarea.txtbox-v3[readonly],
#out_results textarea {
    background-color: #ffffff;
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    caret-color: #6366f1;
    border-color: rgba(148, 163, 184, 0.55);
}

textarea[readonly]:focus,
textarea#results_txt:focus,
textarea#txt_results:focus,
textarea.ta-big:focus,
textarea.ta-big[readonly]:focus,
textarea.txtbox[readonly]:focus,
textarea.txtbox-v3[readonly]:focus,
body.light-mode textarea[readonly]:focus,
body.light-mode textarea#results_txt:focus,
body.light-mode textarea#txt_results:focus,
body.light-mode textarea.ta-big:focus,
body.light-mode textarea.ta-big[readonly]:focus,
body.light-mode textarea.txtbox[readonly]:focus,
body.light-mode textarea.txtbox-v3[readonly]:focus {
    background-color: #ffffff;
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
    border-color: rgba(129, 140, 248, 0.65);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45);
}

/* Selecție pe foaia albă: același contrast la dark și light */
textarea[readonly]::selection,
textarea#results_txt::selection,
textarea#txt_results::selection,
textarea.ta-big::selection,
#out_results textarea::selection {
    background: rgba(99, 102, 241, 0.28);
    color: #0f172a;
}

textarea[readonly]::-moz-selection,
textarea#results_txt::-moz-selection,
textarea#txt_results::-moz-selection,
textarea.ta-big::-moz-selection,
#out_results textarea::-moz-selection {
    background: rgba(99, 102, 241, 0.28);
    color: #0f172a;
}

.btn-reset {
    background: var(--glass);
    color: var(--ink);
    border: 1px solid var(--glass-border);
    padding: 0 24px;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: var(--glass-hover);
    border-color: var(--ink);
}

/* --- COMPONENTS: SECTIONS --- */
.section {
    max-width: 1300px;
    margin: 0 auto 60px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-top: 4px solid var(--accent);
    border-radius: 32px;
    padding: 40px;
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section:hover {
    border-color: var(--local-accent, var(--accent));
    background: var(--glass-hover);
}

.section[data-cat="stingere"] {
    border-top-color: #ef4444;
    --local-accent: #ef4444;
    --local-accent-rgb: 239, 68, 68;
}

.section[data-cat="sanitare"] {
    border-top-color: #3b82f6;
    --local-accent: #3b82f6;
    --local-accent-rgb: 59, 130, 246;
}

.section[data-cat="hvac"] {
    border-top-color: #f59e0b;
    --local-accent: #f59e0b;
    --local-accent-rgb: 245, 158, 11;
}

.section[data-cat="electrice"] {
    border-top-color: #10b981;
    --local-accent: #10b981;
    --local-accent-rgb: 16, 185, 129;
}

.section[data-cat="desfumare"] {
    border-top-color: #8b5cf6;
    --local-accent: #8b5cf6;
    --local-accent-rgb: 139, 92, 246;
}

.section[data-cat="detectie"] {
    border-top-color: #ec4899;
    --local-accent: #ec4899;
    --local-accent-rgb: 236, 72, 153;
}

.section[data-cat="proiecte"] {
    border-top-color: #6366f1;
    --local-accent: #6366f1;
    --local-accent-rgb: 99, 102, 241;
}

.section-head {
    margin-bottom: 40px;
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.section-head h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    letter-spacing: 0.05em;
}

.section-head .hint {
    font-size: 14px;
    color: var(--muted);
    font-weight: 400;
}

/* --- COMPONENTS: GRID & CARDS --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-md);
}

/* Calculator Form Grid inside Cards */
.card-body .grid {
    row-gap: var(--space-xs);
    column-gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.card-body .grid:last-child,
.card-body .grid:last-of-type {
    margin-bottom: 0;
}

.card-body .grid > div {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.card-body .grid > div:last-child {
    margin-bottom: 0;
}

.card-body .grid > div > label {
    margin-bottom: 0 !important;
}

/* Fără backdrop-filter/transform pe .tool ca să evităm layer explosion (un layer per card) */
.tool {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    min-height: 220px;
}

.tool:hover {
    background: var(--glass-hover);
    border-color: var(--local-accent, var(--accent));
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.section[data-cat] .tool:hover {
    background: linear-gradient(135deg, var(--glass-hover) 0%, rgba(var(--local-accent-rgb, 129, 140, 248), 0.05) 100%);
}

.tool-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.tool-meta {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

.tool.locked {
    opacity: 0.65;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
}

.tool.locked:hover {
    box-shadow: none;
    border-color: var(--glass-border);
}

.tool.locked .btn {
    background: var(--glass) !important;
    color: var(--muted) !important;
    box-shadow: none !important;
    pointer-events: none;
    border: 1px solid var(--glass-border);
}

/* VARIANTA 3: Floating Glow Tab */
.v3-badge {
    position: absolute;
    top: -1px;
    /* Align to border */
    right: 24px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 6px 16px;
    border-radius: 0 0 12px 12px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
    letter-spacing: 0.5px;
    z-index: 10;
}

.tool:has(.v3-badge) .tool-title {
    padding-right: 96px;
}

/* Ribbon PLUS fix în colțul din dreapta sus, fără suprapunere cu titlul */
.card-badge-plus {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.22));
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-top: none;
    border-right: none;
    padding: 6px 14px;
    border-radius: 0 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Titlul cardului face loc ribbon-ului ca să nu se suprapună */
.tool:has(.card-badge-plus) .tool-title {
    padding-right: 96px;
}

.card-badge-plus::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: holo-sweep 3s infinite linear;
}

@keyframes holo-sweep {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.lock-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 14px;
    opacity: 0.4;
}

/* --- COMPONENTS: BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--local-accent, var(--accent)) 0%, rgba(var(--local-accent-rgb, 129, 140, 248), 0.8) 100%);
    color: #fff;
    padding: var(--btn-padding);
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: var(--text-base);
    transition: all 0.3s;
    box-shadow: 0 8px 16px rgba(var(--local-accent-rgb, 129, 140, 248), 0.3);
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(var(--local-accent-rgb, 129, 140, 248), 0.5);
    filter: brightness(1.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--text-sm);
    border-radius: 10px;
    width: auto;
    min-width: 0;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(var(--local-accent-rgb, 129, 140, 248), 0.4);
}

.tool .actions {
    margin-top: auto;
    width: 100%;
}

/* --- COMPONENTS: FOOTER --- */
.footer {
    text-align: center;
    margin-top: 100px;
    background: transparent;
    border-top: none;
    padding: 0;
    /* Footer full‑bleed: întinde Huly footerul pe tot viewport‑ul,
       indiferent de containerele anterioare (hub, calculatoare, help) */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: 0;
    margin-bottom: -80px;
}

.footer-description {
    max-width: 1200px;
    margin: 0 auto 60px;
    text-align: left;
    padding: 0 20px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 16px;
}

.footer-motto {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    background: linear-gradient(to right, var(--muted), #fff, var(--muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.copyright {
    color: var(--muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 900px) {
    .header-nav {
        display: none;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .hub-main-title {
        font-size: 44px;
    }

    .section {
        padding: 24px;
    }
}

/* --- COMPONENTS: CARDS --- */
.card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: var(--card-padding);
    margin-bottom: var(--space-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.light-mode .card {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.card-head {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.card-head h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

body.light-mode .card-head h2 {
    color: #1e293b;
}

/* --- TYPOGRAPHY: LABELS & MUTED TEXT --- */
label,
.card-body .small,
.note,
.kpi-sub {
    color: #94a3b8;
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
    line-height: var(--lh-relaxed);
}

body.light-mode label,
body.light-mode .card-body .small,
body.light-mode .note,
body.light-mode .kpi-sub {
    color: #475569;
}

/* --- INPUT PLACEHOLDERS --- */
::placeholder {
    color: rgba(255, 255, 255, 0.3);
    opacity: 1;
    /* Firefox */
}

body.light-mode ::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* --- OUTPUT ALIGNMENT (.out) --- */
.out {
    margin-top: var(--space-md);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid var(--glass-border);
    line-height: var(--lh-relaxed);
}

body.light-mode .out {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.out div {
    display: block;
}

.out .hr {
    height: 1px;
    background: var(--glass-border);
    margin: 16px 0;
    width: 100%;
}

body.light-mode .out .hr {
    background: #e2e8f0;
}

.out b {
    color: #94a3b8;
    font-weight: 500;
    display: inline-block;
    min-width: 280px;
    /* Align data column */
}

body.light-mode .out b {
    color: #475569;
}

.out .mono {
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 16px;
    display: inline-block;
    min-width: 60px;
    text-align: right;
}

body.light-mode .out .mono {
    color: #0f172a;
}

/* --- OHM LOGIN BUTTON (V11 Edge + V5 Smoke Core) --- */
.huly-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    width: 100%;
}

.ohm-login-btn {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 100%;
    padding: 0 32px;
    border-radius: 12px;
    background: #0f172a;
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px -5px rgba(129, 140, 248, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}

.ohm-login-btn:hover {
    box-shadow: 0 15px 35px -10px rgba(129, 140, 248, 0.6);
    border-color: rgba(129, 140, 248, 0.8);
    transform: scale(1.02);
}

.edge-mask-btn {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    border-radius: 12px;
    padding: 2px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.huly-flare-container {
    position: absolute;
    z-index: 1;
    /* Keep above bg, under text */
    display: flex;
    width: 204px;
    align-items: center;
    justify-content: center;
    left: 50%;
    margin-left: -102px;
    will-change: transform;
    transform: translateX(0px) translateZ(0px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.huly-wrapper:hover .huly-flare-container {
    opacity: 1;
}

/* Inner Flare (V5 style) */
.inner-flare .flare-gradient-1 {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.7) 0%, rgba(59, 130, 246, 0.5) 40%, rgba(15, 23, 42, 0) 80%);
    filter: blur(20px);
    width: 160px;
    height: 160px;
}

.inner-flare .flare-gradient-2 {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.4) 0%, rgba(15, 23, 42, 0) 70%);
    filter: blur(30px);
    width: 280px;
    height: 103px;
}

/* Edge Flare (V11 style) */
.edge-flare .flare-gradient-1 {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 1) 0%, rgba(59, 130, 246, 1) 50%, transparent 80%);
    width: 150px;
    height: 150px;
    filter: blur(2px);
}

.ohm-login-btn span,
.huly-text,
.huly-icon {
    position: relative;
    z-index: 2;
    font-family: var(--font);

    text-shadow: none;
}

.huly-icon {
    height: 10px;
    width: 18px;
    margin-left: 8px;
}

/* --- COMPONENTS: TOGGLE CHECKBOXES (.chip) --- */
.chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.5;
    cursor: pointer;
    transition: opacity 0.2s ease;
    width: 100%;
}

.chip:hover {
    opacity: 0.8;
}

body.light-mode .chip {
    color: #475569;
}

.chip input[type="checkbox"],
.chip input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 50px;
    height: 26px;
    margin: 0;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 34px;
    position: relative;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.chip input[type="checkbox"]::after,
.chip input[type="radio"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chip input[type="checkbox"]:checked,
.chip input[type="radio"]:checked {
    background: var(--chip-accent, var(--accent));
}

.chip input[type="checkbox"]:checked::after,
.chip input[type="radio"]:checked::after {
    transform: translateX(24px);
}

.chip input[type="checkbox"]:focus-visible,
.chip input[type="radio"]:focus-visible {
    box-shadow: 0 0 0 4px var(--chip-accent-glow, var(--accent-glow));
}

/* Listă de opțiuni cu toggle .chip (ex. NORA admin, filtre metadata) */
.chip-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    max-height: 320px;
    overflow-y: auto;
}

body.light-mode .chip-list {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.chip-list .chip {
    color: var(--ink);
}

.chip-list .chip span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

body.light-mode .chip-list .chip span {
    color: #1e293b;
}

/* Pastile pe rând, cu toggle în interior */
.chip-list--wrap {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.chip-list--wrap .chip {
    width: auto;
    flex: 0 1 auto;
    padding: 8px 14px 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.14);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.light-mode .chip-list--wrap .chip {
    background: #ffffff;
    border-color: #e2e8f0;
}

.chip-list--wrap .chip:hover {
    opacity: 1;
    border-color: rgba(245, 158, 11, 0.35);
}

.chip-list--wrap .chip span {
    flex: 0 1 auto;
    white-space: nowrap;
}

.chip-list--wrap .chip:has(input:checked) {
    border-color: var(--chip-accent, #f59e0b);
    background: var(--chip-accent-bg, rgba(245, 158, 11, 0.14));
    box-shadow: 0 0 0 1px var(--chip-accent-ring, rgba(245, 158, 11, 0.4));
}

/* Accent portocaliu (BIMFLOW admin NORA) */
.chip-list--orange {
    --chip-accent: #f59e0b;
    --chip-accent-glow: rgba(245, 158, 11, 0.45);
    --chip-accent-bg: rgba(245, 158, 11, 0.16);
    --chip-accent-ring: rgba(245, 158, 11, 0.5);
}

body.light-mode .chip-list--orange {
    --chip-accent-bg: rgba(245, 158, 11, 0.12);
}

/* =============================================
   COMPONENTS: CUSTOM SPINNERS (Var 6 - Right Connect)
   ============================================= */
/* Reset default spinbuttons */
.spinner-right input[type="number"]::-webkit-inner-spin-button,
.spinner-right input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.spinner-right input[type="number"] {
  -moz-appearance: textfield;
}

/* Layout for Right Connect Spinner */
.spinner-right {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}
body.light-mode .spinner-right {
  border-color: #cbd5e1;
  background: #ffffff;
}
.spinner-right input {
  flex: 1;
  width: auto !important;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 16px !important;
  font-size: 16px;
  font-weight: 700;
  box-shadow: none !important;
  text-align: left; /* Keep default alignment */
}
.spinner-right .sp-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-left: 1px solid var(--glass-border) !important;
  color: var(--ink);
  width: 44px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
body.light-mode .spinner-right .sp-btn {
  background: #f1f5f9;
  border-left-color: #cbd5e1 !important;
}
.spinner-right .sp-btn:hover { background: rgba(255, 255, 255, 0.15); }
body.light-mode .spinner-right .sp-btn:hover { background: #e2e8f0; }
.spinner-right:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* =========================================
   CUSTOM SELECT (Dropdown) - VARIANTA RIGHT
   ========================================= */
.select-right {
  position: relative;
  display: flex !important;
  align-items: stretch !important;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}
body.light-mode .select-right {
  border-color: #cbd5e1;
  background: #ffffff;
}
.select-right select {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important; /* Ascunde sageata default din theme */
  padding: 0 44px 0 16px !important; 
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  position: relative;
  z-index: 2; /* Deasupra iconitei, preia click-ul */
}

.select-right select option {
  background: var(--body-bg, #0f172a);
  color: var(--ink);
}
body.light-mode .select-right select option {
  background: #ffffff;
  color: #0f172a;
}

.select-right .sel-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 44px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  z-index: 1; /* Sub select */
}
body.light-mode .select-right .sel-btn {
  background: #f1f5f9;
  border-left-color: #cbd5e1;
}
.select-right:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.select-right:hover .sel-btn {
  background: rgba(255, 255, 255, 0.15);
}
body.light-mode .select-right:hover .sel-btn {
  background: #e2e8f0;
}

/* =========================================
   HOVER POP-UPS / GLANCE OVER RESULTS (VAR 3 - PILL)
   ========================================= */

/* Generic Popover Card */
.popover-card {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 260px;
  background: rgba(15, 23, 42, 0.98); /* Mai opac pentru lizibilitate */
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 9999; /* Z-index marit considerabil pentru a suprascrie parintii de tabel */
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}

/* Fix pentru a lasa popover-ul sa iasa din celulele de tabel care pot fi overflow:hidden */
table tr td {
  overflow: visible !important;
}
body.light-mode .popover-card {
  background: rgba(255, 255, 255, 0.98);
  border-color: #cbd5e1;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.pop-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.pop-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
body.light-mode .pop-row {
  border-bottom-color: rgba(0,0,0,0.1);
}
.pop-lbl { color: var(--muted); }
.pop-val { font-weight: 700; color: var(--ink); }

/* Var 3: Action Pill / Pill Expand */
.hover-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(59, 130, 246, 0.2); /* Putin mai pronuntat */
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa; /* Accent text */
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
body.light-mode .hover-pill {
  color: #2563eb;
}
.hover-pill i { margin-right: 6px; }
.hover-pill:hover { background: rgba(59, 130, 246, 0.3); }

/* Popover-ul cade în JOS dacă e loc, dar aici în tabele e mai bine deasupra sau fixat, 
   Lăsăm default bottom=120% (zboară în SUS) cum era setat în .popover-card */
.hover-pill .popover-card {
  /* top: 120%; bottom: auto; transform: translateX(-50%) translateY(-10px); */
  bottom: 120%;
  top: auto;
}
.hover-pill:hover .popover-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}