/* ══════════════════════════════════════════════════════
   ByME Theme — Bootstrap 5.3 custom layer
   Brand tokens, gradient utilities, and truly custom
   visual styles that Bootstrap cannot provide.
   ══════════════════════════════════════════════════════ */

/* ── Bootstrap Token Overrides ── */
:root {
    --bs-primary:          #13273C;
    --bs-primary-rgb:      19, 39, 60;
    --bs-success:          #62cc69;
    --bs-success-rgb:      98, 204, 105;
    --bs-link-color:       #13273C;
    --bs-link-hover-color: #0a1825;

    /* ByME Gradient Tokens */
    --byme-gradient-hero:    linear-gradient(to right top, #051937, #004d7a, #008793, #62cc69, #a8eb12);
    --byme-gradient-primary: linear-gradient(135deg, #13273C 0%, #1e3d5c 100%);
    --byme-gradient-success: linear-gradient(135deg, #62cc69 0%, #4ca654 100%);

    /* Internal legacy tokens used by JS-generated markup */
    --byme-green:          #62cc69;
    --gradient-user:       linear-gradient(90deg, rgba(42,123,155,1) 0%, rgba(87,199,133,1) 50%, rgba(237,221,83,1) 100%);
    --gradient-brand-alt:  linear-gradient(135deg, #13273C 0%, #005f73 40%, #62cc69 100%);
    --gradient-ai-icon:    linear-gradient(135deg, #13273C 0%, #62cc69 100%);

    /* Surface / text / shadow design tokens */
    --bg-page:             linear-gradient(145deg, #d9f2e7 0%, #e6f0ff 55%, #edf3fb 100%);
    --bg-page-2:           linear-gradient(155deg, #eaf6ed 0%, #f4fbf6 45%, #f8fafc 100%);
    --bg-page-3:           linear-gradient(160deg, #f2faf4 0%, #fafcfb 55%, #ffffff 100%);
    --bg-page-4:           linear-gradient(to bottom, #f0fbf3 0%, #f8fafb 50%, #ffffff 100%);
    --bg-surface-2:        #f8fafc;
    --border:              rgba(0, 0, 0, 0.07);
    --text-primary:        #1e293b;
    --text-secondary:      #475569;
    --text-muted:          #64748b;
    --shadow-glow:         0 4px 24px rgba(98, 204, 105, 0.15);
    --shadow-container:    0 24px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.6);
    --site-header-h:       72px;
    --site-footer-h:       44px;
}

/* ── Gradient Utilities ── */
.bg-byme-hero            { background: var(--byme-gradient-hero)    !important; }
.bg-byme-primary-gradient{ background: var(--byme-gradient-primary) !important; }
.bg-byme-success-gradient{ background: var(--byme-gradient-success) !important; }
.bg-byme-brand-alt       { background: var(--gradient-brand-alt)    !important; }

/* ── Button & Badge color hierarchy ────────────────────────────
   Bootstrap .btn-success usa vars locales propias (--bs-btn-bg, etc.)
   que NO heredan de --bs-success en :root → hay que sobreescribirlas todas.
   Brand convention:
     btn-success  (#62cc69 green)  = PRIMARY action  → texto navy para contraste WCAG
     btn-primary  (#13273C navy)   = SECONDARY action → texto blanco (Bootstrap default OK)
   ─────────────────────────────────────────────────────────────── */
.btn-success {
    --bs-btn-bg:                    #62cc69;
    --bs-btn-border-color:          #62cc69;
    --bs-btn-hover-bg:              #57b85f;
    --bs-btn-hover-border-color:    #57b85f;
    --bs-btn-active-bg:             #4ca654;
    --bs-btn-active-border-color:   #4ca654;
    --bs-btn-disabled-bg:           #62cc69;
    --bs-btn-disabled-border-color: #62cc69;
    --bs-btn-color:                 #fff;
    --bs-btn-hover-color:           #fff;
    --bs-btn-active-color:          #fff;
    --bs-btn-disabled-color:        rgba(255, 255, 255, .55);
    font-weight: 600;
}
.btn-outline-success {
    --bs-btn-color:              #62cc69;
    --bs-btn-border-color:       #62cc69;
    --bs-btn-hover-bg:           #62cc69;
    --bs-btn-hover-border-color: #62cc69;
    --bs-btn-active-bg:          #62cc69;
    --bs-btn-active-border-color:#62cc69;
    --bs-btn-hover-color:        #fff;
    --bs-btn-active-color:       #fff;
}
.badge.bg-success { color: #fff !important; }

.btn-primary {
    --bs-btn-bg:                    #13273C;
    --bs-btn-border-color:          #13273C;
    --bs-btn-hover-bg:              #1e3d5c;
    --bs-btn-hover-border-color:    #1e3d5c;
    --bs-btn-active-bg:             #0a1825;
    --bs-btn-active-border-color:   #0a1825;
    --bs-btn-disabled-bg:           #13273C;
    --bs-btn-disabled-border-color: #13273C;
    --bs-btn-color:                 #fff;
    --bs-btn-hover-color:           #fff;
    --bs-btn-active-color:          #fff;
    --bs-btn-disabled-color:        rgba(255, 255, 255, .55);
    font-weight: 600;
}
.btn-outline-primary {
    --bs-btn-color:              #13273C;
    --bs-btn-border-color:       #13273C;
    --bs-btn-hover-bg:           #13273C;
    --bs-btn-hover-border-color: #13273C;
    --bs-btn-active-bg:          #13273C;
    --bs-btn-active-border-color:#13273C;
    --bs-btn-hover-color:        #fff;
    --bs-btn-active-color:       #fff;
}
.badge.bg-primary { color: #fff !important; }

.btn-byme-gradient {
    background: var(--byme-gradient-hero);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-byme-gradient:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 191, 114, .3);
    color: #fff;
}

.text-byme-gradient {
    background: var(--byme-gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-user {
    background: var(--gradient-user);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════
   BASE
══════════════════════════════════ */
html { height: 100%; }

body {
    min-height: 100%;
    height: 100dvh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Dot-grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(0, 110, 70, 0.09) 1.2px, transparent 1.2px);
    background-size: 26px 26px;
    pointer-events: none;
    z-index: 0;
}

/* Admin pages: flat bg, no gradient/decorations */
body.bg-light {
    background: #f8f9fa !important;
    height: auto !important;
    overflow: auto !important;
}
body.bg-light::before { display: none; }

/* ══════════════════════════════════
   BACKGROUND ORBS
══════════════════════════════════ */
.bg-orb { position: fixed; border-radius: 50%; pointer-events: none; z-index: -1; }

.bg-orb-1 {
    width: 750px; height: 750px;
    background: radial-gradient(circle, rgba(98, 204, 105, 0.22) 0%, transparent 65%);
    top: -280px; left: -250px;
    filter: blur(60px);
    animation: orb-drift 22s ease-in-out infinite;
}
.bg-orb-2 {
    width: 650px; height: 650px;
    background: radial-gradient(circle, rgba(74, 144, 217, 0.18) 0%, transparent 65%);
    bottom: -220px; right: -200px;
    filter: blur(65px);
    animation: orb-drift 28s ease-in-out infinite reverse;
}
.bg-orb-3 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(123, 92, 245, 0.14) 0%, transparent 65%);
    top: 35%; left: 40%;
    filter: blur(70px);
    animation: orb-drift 34s ease-in-out infinite;
    animation-delay: -12s;
}
@keyframes orb-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(45px, -55px) scale(1.05); }
    66%       { transform: translate(-35px, 30px) scale(0.96); }
}

/* ══════════════════════════════════
   SITE HEADER
   Usa min-height (no height fija) para que Bootstrap navbar-expand-*
   pueda colapsar en móvil sin truncar el contenido.
══════════════════════════════════ */
.site-header {
    min-height: var(--site-header-h);
    padding: 0 2rem;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 20;
}
.site-header-brand { transition: opacity .2s; }
.site-header-brand:hover { opacity: .75; }
.site-header-brand img { height: 28px; object-fit: contain; }

/* Hamburger toggler */
.site-header .navbar-toggler {
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 8px;
    padding: .3rem .55rem;
    color: var(--text-primary);
}
.site-header .navbar-toggler:focus { box-shadow: none; }

.site-header-nav a {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: .55rem 1rem;
    border-radius: 8px;
    transition: all .18s;
    white-space: nowrap;
}
.site-header-nav a:hover { color: var(--byme-green); background: rgba(98, 204, 105, .07); }

/* ── Dropdown menus (brand-styled) ── */
.site-header .dropdown-menu,
.dropdown-menu {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, .13);
    padding: .45rem;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px);
    min-width: 200px;
}
.dropdown-item {
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: .48rem .9rem;
    transition: all .15s;
}
.dropdown-item:hover  { background: rgba(98, 204, 105, .09); color: var(--byme-green); }
.dropdown-item.active,
.dropdown-item:active { background: #62cc69; color: #fff; }
.dropdown-divider     { margin: .3rem .4rem; border-color: rgba(0, 0, 0, .07); }
.dropdown-header {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: .5rem .9rem .2rem;
}

.site-header-nav .nav-cta {
    background: var(--byme-green);
    color: #fff !important;
    font-weight: 600;
    border-radius: 10px;
    padding: .35rem .9rem;
    box-shadow: 0 2px 10px rgba(98, 204, 105, .25);
}
.site-header-nav .nav-cta:hover { background: #57b85f !important; box-shadow: 0 4px 16px rgba(98, 204, 105, .35); }

/* ── Navbar collapse — móvil (< lg = 992px) ────────────────────
   Cuando Bootstrap colapsa el navbar, el .site-header-nav pasa a
   ser columna, los dropdowns se muestran inline (no flotantes).
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .site-header { padding: 0 1.25rem; }

    .site-header .navbar-collapse .site-header-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-left: 0 !important;
        padding: .5rem 0 .85rem;
        gap: .1rem;
    }
    .site-header .navbar-collapse .site-header-nav a,
    .site-header .navbar-collapse .dropdown { width: 100%; }

    /* Sobreescribe la regla antigua "display:none" del media query legacy */
    .site-header .navbar-collapse .site-header-nav a:not(.nav-cta) {
        display: block !important;
        white-space: normal;
        padding: .5rem .85rem;
    }

    /* Los dropdown-toggle también estaban ocultos — forzar visibilidad */
    .site-header .navbar-collapse .dropdown { display: block !important; }

    /* Dropdowns inline en móvil (no absolute) */
    .site-header .navbar-collapse .dropdown-menu {
        position: static  !important;
        box-shadow: none  !important;
        border: 1px solid rgba(0, 0, 0, .06) !important;
        border-radius: 10px !important;
        background: rgba(248, 250, 252, .9) !important;
        margin: .2rem 0 .2rem .75rem !important;
        width: calc(100% - .75rem) !important;
        backdrop-filter: none !important;
    }
    .site-header .navbar-collapse .nav-cta {
        display: block;
        text-align: center;
        margin-top: .5rem;
    }

    /* Fix: position:sticky es unreliable en móvil cuando body es el scroll container
       (iOS Safari / Android Chrome animan la address-bar → viewport cambia → jitter).
       Solución: fixed en móvil + padding-top compensatorio en el primer elemento de flujo. */
    .site-header {
        position: fixed !important;
        top: 0; left: 0; right: 0;
        width: 100%;
    }
    body > main { padding-top: var(--site-header-h); }
}

/* ══════════════════════════════════
   PAGE TITLE BAR
══════════════════════════════════ */
.page-title-bar {
    flex-shrink: 0;
    padding: .65rem 1.5rem .2rem;
    z-index: 1;
}
.page-title-h {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.025em;
    margin-bottom: .15rem;
}
.page-title-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
}

/* ══════════════════════════════════
   PAGE LAYOUT
══════════════════════════════════ */
.page-wrapper { padding: .75rem 1.5rem 1rem; z-index: 1; min-height: 0; }
.page-layout  { max-width: 1300px; max-height: 820px; gap: 2rem; }

/* ══════════════════════════════════
   INFO PANEL
══════════════════════════════════ */
.info-panel { display: flex; width: 310px; flex-shrink: 0; padding: 1.5rem 0; }
.info-panel-inner { gap: 1.25rem; }

.panel-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(98, 204, 105, .1);
    border: 1px solid rgba(98, 204, 105, .28);
    border-radius: 100px;
    padding: .35rem .9rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--byme-green);
    width: fit-content;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.info-heading {
    line-height: 1.22;
    color: var(--text-primary);
    letter-spacing: -.025em;
}
.info-heading em {
    font-style: normal;
    background: linear-gradient(to right top, #13273c, #005878, #008e8e, #00c26f, #a8eb12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-subtext { font-size: .91rem; color: var(--text-secondary); line-height: 1.65; }

.stat-pill {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 100px;
    padding: .38rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.stat-pill i { color: var(--byme-green); font-size: .78rem; }

.capabilities-card {
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}
.cap-title { letter-spacing: .09em; }

.cap-ticker { height: 2.2rem; position: relative; overflow: hidden; }
.cap-ticker-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cap-ticker-item.entering { animation: cap-enter .45s cubic-bezier(.16, 1, .3, 1) forwards; }
.cap-ticker-item.exiting  { animation: cap-exit  .35s ease-in forwards; }
@keyframes cap-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cap-exit  { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-10px); } }

.panel-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--byme-green);
    color: #fff;
    font-weight: 600;
    font-size: .88rem;
    padding: .75rem 1.3rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all .22s ease;
    box-shadow: 0 4px 18px rgba(98, 204, 105, .32);
    width: fit-content;
}
.panel-cta:hover { background: #57b85f; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(98, 204, 105, .38); color: #fff; }
.panel-cta i { transition: transform .2s; }
.panel-cta:hover i { transform: translateX(4px); }

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s;
}
.contact-item i { color: var(--byme-green); font-size: .78rem; width: 14px; }
.contact-item:hover { color: var(--byme-green); }

.powered-by { display: flex; align-items: center; gap: .35rem; font-size: .73rem; color: var(--text-muted); }
.powered-by .gem-badge { font-weight: 700; color: #7B5CF5; }

/* ══════════════════════════════════
   CHAT CONTAINER
══════════════════════════════════ */
.chat-container {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-container);
}

.chat-header {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px);
    padding: .9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

/* Desktop AI info (hidden on mobile) */
.header-ai-info { display: flex; }

.header-ai-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--gradient-ai-icon);
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(98, 204, 105, .28);
}
.header-ai-text { gap: 1px; }
.header-ai-name { font-weight: 700; font-size: .9rem; color: var(--text-primary); line-height: 1.2; }
.header-ai-sub  { font-size: .75rem; color: var(--text-muted); }

.status-indicator { font-size: .78rem; color: var(--text-secondary); font-weight: 500; }
.status-dot {
    width: 8px; height: 8px;
    background: #4ADE80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ADE80;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.header-link {
    color: var(--text-primary);
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .4rem .9rem;
    transition: all .2s ease;
    background: #fff;
    white-space: nowrap;
}
.header-link:hover {
    background: var(--bg-surface-2);
    border-color: rgba(98, 204, 105, .5);
    color: var(--byme-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(98, 204, 105, .1);
}

/* ══════════════════════════════════
   MESSAGES
══════════════════════════════════ */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.5rem 1rem;
    gap: 1.25rem;
    scroll-behavior: smooth;
}
.messages-area::-webkit-scrollbar { width: 5px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,.09); border-radius: 10px; }

.message-row {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    animation: msg-in .4s cubic-bezier(.16, 1, .3, 1) forwards;
    opacity: 0;
    transform: translateY(12px);
}
.message-row.user { flex-direction: row-reverse; }
@keyframes msg-in { to { opacity: 1; transform: translateY(0); } }

.ai-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-ai-icon);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(98, 204, 105, .25);
}

.bubble {
    max-width: min(80%, 540px);
    padding: .85rem 1.1rem;
    border-radius: 20px;
    line-height: 1.6;
    font-size: .93rem;
    word-break: break-word;
}
.bubble.ai   { background: #f4f6f8; border: 1px solid rgba(0,0,0,.06); border-radius: 4px 20px 20px 20px; color: var(--text-primary); }
.bubble.user { background: #13273C; border-radius: 20px 20px 4px 20px; color: #fff; }
.bubble a { color: var(--byme-green); text-decoration: underline; font-weight: 500; }
.bubble.user a { color: #fff; }
.bubble strong { font-weight: 600; }

.error-bubble {
    background: rgba(239, 68, 68, .05) !important;
    border-color: rgba(239, 68, 68, .3) !important;
    color: #B91C1C !important;
}

/* ── Typing Indicator ── */
.typing-row {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    animation: msg-in .3s ease forwards;
    opacity: 0;
}
.typing-bubble {
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 4px 20px 20px 20px;
    padding: .85rem 1.1rem;
    display: flex; gap: 5px; align-items: center;
}
.typing-dot { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: bounce-dot 1.4s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ══════════════════════════════════
   QUICK QUESTIONS
══════════════════════════════════ */
.quick-section {
    flex-shrink: 0;
    padding: .9rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #fff;
}
.quick-label {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: .6rem;
    text-transform: uppercase;
    letter-spacing: .07em;
}
/* .chip relies on Bootstrap's btn btn-outline-secondary btn-sm rounded-pill */
.chip { white-space: nowrap; }

/* ══════════════════════════════════
   CHAT FOOTER / INPUT
══════════════════════════════════ */
.chat-footer { flex-shrink: 0; padding: .7rem 1.5rem 1.1rem; background: #fff; }

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: .72rem .72rem .72rem 1.2rem;
    transition: all .25s ease;
}
.input-wrapper:focus-within {
    background: #fff;
    border-color: var(--byme-green);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}
.input-inner { flex: 1; display: flex; flex-direction: column; gap: .35rem; }

#messageInput {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: .93rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: none;
}
#messageInput::placeholder { color: var(--text-muted); }
#messageInput::-webkit-scrollbar { display: none; }

.input-meta { display: flex; align-items: center; justify-content: flex-end; }
.char-count { font-size: .7rem; color: var(--text-muted); font-weight: 500; transition: color .2s; }
.char-count.warn   { color: #F59E0B; }
.char-count.danger { color: #EF4444; }

.send-btn {
    width: 42px; height: 42px;
    border-radius: 13px;
    border: none;
    background: var(--gradient-user);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s cubic-bezier(.16, 1, .3, 1);
    flex-shrink: 0;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(98, 204, 105, .25);
}
.send-btn:disabled { background: var(--bg-surface-2); border: 1px solid var(--border); color: var(--text-muted); cursor: default; box-shadow: none; }
.send-btn:not(:disabled):hover  { transform: translateY(-2px) scale(1.03); box-shadow: 0 6px 18px rgba(98, 204, 105, .35); }
.send-btn:not(:disabled):active { transform: scale(.96); }

.footer-disclaimer { text-align: center; font-size: .72rem; color: var(--text-muted); margin-top: .6rem; }
.footer-disclaimer a { color: var(--text-secondary); text-decoration: underline; font-weight: 500; transition: color .2s; }
.footer-disclaimer a:hover { color: var(--byme-green); }

/* ══════════════════════════════════
   SITE FOOTER
══════════════════════════════════ */
.site-footer {
    height: var(--site-footer-h);
    padding: 0 2rem;
    background: rgba(255, 255, 255, .35);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, .55);
    z-index: 20;
}
.site-footer-copy { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.site-footer-sep  { font-size: .72rem; color: rgba(100, 116, 139, .35); user-select: none; }
.site-footer a    { font-size: .72rem; color: var(--text-muted); text-decoration: none; transition: color .18s; white-space: nowrap; }
.site-footer a:hover { color: var(--byme-green); }

/* ══════════════════════════════════
   RESPONSIVE — mobile (≤ 860px)
══════════════════════════════════ */
@media (max-width: 860px) {
    body { overflow: auto; }
    .bg-orb { display: none; }
    .site-header { padding: 0 1rem; }
    .site-header-nav a:not(.nav-cta) { display: none; }
    .page-wrapper { padding: 0; align-items: stretch; }
    .page-layout {
        height: calc(100dvh - var(--site-header-h) - var(--site-footer-h));
        max-height: none;
        max-width: 100%;
        gap: 0;
    }
    .info-panel { display: none; }
    .chat-container { border-radius: 0; box-shadow: none; }
    .header-ai-info { display: none; }
    .page-title-bar { padding: .5rem 1rem .15rem; }
    .messages-area { padding: 1rem 1rem .5rem; gap: 1rem; }
    .chat-footer { padding: .5rem 1rem 1rem; }
    .bubble { max-width: 90%; font-size: .9rem; }
    .header-link span { display: none; }
    .quick-section { padding: .75rem 1rem; }
    .site-footer { gap: .5rem 1rem; height: auto; padding: .5rem 1rem; }
}

/* ══════════════════════════════════════════════════════
   ADMIN — SHARED COMPONENTS
   Fade animation, stat cards, inventory items, quantity
   controls used across all admin inventory pages.
   ══════════════════════════════════════════════════════ */

/* ── Fade-in animation ─────────────────────────────── */
.fade-in-up { animation: fadeInUp .4s ease both; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton Loader ───────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 12px;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Stat Cards (shared by survey + history + insights) */
.inv-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .75rem 1rem;
    text-align: center;
}
.stat-val   { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin-top: 2px; }
.stat-sub   { font-size: .7rem; color: #9ca3af; margin-top: .1rem; }

/* ── Inventory Items ───────────────────────────────── */
.inv-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 0;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}
.inv-item:last-child { border-bottom: none; }
.inv-item-name { flex: 1; min-width: 100px; font-size: .88rem; font-weight: 500; color: var(--text-primary); }
.inv-item-name[type="text"] { cursor: text; transition: background .2s; padding: 1px 4px; border-radius: 4px; }
.inv-item-name[type="text"]:hover { background: rgba(0,0,0,.03); }
.inv-item-name[type="text"]:focus { background: #fff; box-shadow: 0 0 0 2px rgba(14,165,233,.3); }
.inv-item-cbm  { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.inv-cbm-input { width: 70px !important; text-align: center; font-size: .8rem !important; padding: .15rem .3rem !important; }
.inv-cbm-total { font-size: .78rem; font-weight: 600; color: #0ea5e9; min-width: 52px; text-align: right; }

/* ── Quantity Controls ─────────────────────────────── */
.qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.qty-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: #f9fafb; border: none; cursor: pointer;
    font-size: .9rem; font-weight: 600; color: #374151;
    transition: background .15s;
}
.qty-btn:hover { background: #e5e7eb; }
.qty-val {
    min-width: 30px; text-align: center;
    font-size: .84rem; font-weight: 700; color: var(--text-primary);
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    line-height: 30px;
}

/* ── Delete Item Button ────────────────────────────── */
.btn-del-item {
    background: none; border: none; cursor: pointer;
    font-size: .85rem; padding: 4px; border-radius: 6px;
    opacity: .5; transition: opacity .2s, background .2s;
    flex-shrink: 0;
}
.btn-del-item:hover { opacity: 1; background: rgba(220,53,69,.08); }

/* fw-500 utility */
.fw-500 { font-weight: 500; }

/* ══════════════════════════════════════════════════════
   ADMIN — INVENTORY SURVEY
   Step wizard, room cards, camera modal, photo grid.
   ══════════════════════════════════════════════════════ */

/* ── Step Wizard ───────────────────────────────────── */
.steps-bar { display: flex; align-items: center; justify-content: center; gap: 0; }
.step-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 12px; color: #adb5bd; font-weight: 600;
    transition: color .3s;
}
.step-circle {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    background: #e9ecef; color: #adb5bd;
    transition: background .3s, color .3s, box-shadow .3s;
}
.step-item.active .step-circle { background: var(--byme-green); color: #fff; box-shadow: 0 2px 10px rgba(98,204,105,.35); }
.step-item.active { color: var(--byme-green); }
.step-item.done .step-circle   { background: var(--byme-green); color: #fff; }
.step-item.done { color: var(--byme-green); }
.step-line {
    width: 48px; height: 3px; background: #e9ecef; border-radius: 2px;
    margin: 0 6px; margin-bottom: 18px; transition: background .3s;
}
.step-line.done { background: var(--byme-green); }

/* ── Room Cards ────────────────────────────────────── */
.room-card {
    background: #fff; border: 1px solid rgba(0,0,0,.1); border-radius: 12px;
    overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.room-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.room-card-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 14px 8px; }
.room-emoji { font-size: 28px; line-height: 1; }
.room-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.room-actions { padding: 0 14px 12px; }
.btn-remove-room {
    background: none; border: none; font-size: 16px; color: #adb5bd;
    cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1;
    transition: color .2s, background .2s;
}
.btn-remove-room:hover { color: #dc3545; background: rgba(220,53,69,.08); }

/* ── Drop Area ─────────────────────────────────────── */
.room-drop-area {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 18px 12px; margin: 0 14px 10px;
    border: 2px dashed #dee2e6; border-radius: 10px;
    cursor: pointer; text-align: center; color: #6c757d; font-size: 13px;
    transition: border-color .2s, background .2s;
}
.room-drop-area:hover,
.room-drop-area.dragover { border-color: var(--byme-green); background: rgba(98,204,105,.04); }
.drop-icon { font-size: 28px; margin-bottom: 4px; }

/* ── Video Preview ─────────────────────────────────── */
.room-preview-wrap   { position: relative; background: #000; overflow: hidden; }
.room-preview-video  { width: 100%; height: 140px; object-fit: cover; display: block; }
.room-preview-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 8px 12px; background: linear-gradient(transparent, rgba(0,0,0,.65));
    display: flex; justify-content: space-between; align-items: flex-end;
}
.room-preview-name    { color: #fff; font-weight: 600; font-size: 13px; }
.room-preview-size    { color: rgba(255,255,255,.75); font-size: 11px; }
.room-preview-actions { display: flex; align-items: center; gap: 6px; padding: 8px 12px; }

/* ── Photo Grid ────────────────────────────────────── */
.room-photos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 12px 6px; }
.room-photo-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid rgba(0,0,0,.06); }
.room-photo-more  { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: #f1f5f9; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ── Add Room Card ─────────────────────────────────── */
.add-room-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 2px dashed #dee2e6; border-radius: 12px;
    cursor: pointer; min-height: 180px;
    transition: border-color .2s, background .2s;
}
.add-room-card:hover { border-color: var(--byme-green); background: rgba(98,204,105,.03); }
.plus-icon  { font-size: 32px; color: #adb5bd; line-height: 1; transition: color .2s; }
.add-room-card:hover .plus-icon { color: var(--byme-green); }
.plus-label { font-size: 13px; font-weight: 600; color: #6c757d; margin-top: 4px; }

/* ── Room Type Selector (modal) ────────────────────── */
.room-type-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px 6px; border: 2px solid #e9ecef; border-radius: 10px;
    cursor: pointer; transition: border-color .2s, background .2s, transform .15s;
}
.room-type-btn:hover    { border-color: var(--byme-green); background: rgba(98,204,105,.04); }
.room-type-btn.selected { border-color: var(--byme-green); background: rgba(98,204,105,.08); transform: scale(1.04); }
.rt-emoji { font-size: 24px; line-height: 1.2; }
.rt-name  { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }

/* ── Camera: Recording Dot ─────────────────────────── */
.rec-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: #fff; margin-right: 4px; vertical-align: middle;
    animation: rec-blink 1s ease-in-out infinite;
}
@keyframes rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ── Scan Item (Add by Photo) ──────────────────────── */
#scan-drop-area { min-height: 120px; }
#scan-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); }

/* ══════════════════════════════════════════════════════
   ADMIN — INVENTORY HISTORY
   Survey list rows, detail accordion, media grid,
   modal tabs.
   ══════════════════════════════════════════════════════ */

/* ── Survey Rows ───────────────────────────────────── */
.survey-row {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: .75rem 1rem; margin-bottom: .5rem;
    transition: box-shadow .2s, border-color .2s;
}
.survey-row:hover { border-color: #d1fae5; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.survey-row-main { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.survey-row-main > div:first-child { flex: 1; min-width: 140px; }
.survey-row-stats { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.survey-row-notes { margin-top: .35rem; padding-left: .25rem; }

/* ── Detail Accordion ──────────────────────────────── */
.detail-accordion .accordion-button { font-weight: 600; font-size: .92rem; padding: .65rem 1rem; }
.detail-accordion .accordion-button:not(.collapsed) { background: #f0fdf4; color: #166534; }
.detail-accordion .accordion-body { padding: .5rem .75rem; }

/* ── Media Grid ────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.media-thumb { border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; background: #f9fafb; }

/* ── Modal Tabs ────────────────────────────────────── */
#detail-tabs .nav-link { font-size: .82rem; font-weight: 500; color: #6b7280; border: none; padding: .5rem .85rem; border-radius: 6px 6px 0 0; }
#detail-tabs .nav-link:hover  { color: #374151; background: #f3f4f6; }
#detail-tabs .nav-link.active { color: #166534; font-weight: 600; background: #fff; border-bottom: 2px solid var(--byme-green); }

/* ── Search Bar ────────────────────────────────────── */
#search-input:focus { box-shadow: 0 0 0 .2rem rgba(98,204,105,.15); border-color: var(--byme-green); }

/* ══════════════════════════════════════════════════════
   ADMIN — INVENTORY INSIGHTS
   KPI cards, section cards, bar charts, tables.
   ══════════════════════════════════════════════════════ */

/* ── Insights Stat Cards ───────────────────────────── */
.ins-stat-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 1rem 1.1rem; text-align: center; height: 100%;
    transition: box-shadow .2s, transform .2s;
}
.ins-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); transform: translateY(-2px); }

/* ── Section Cards ─────────────────────────────────── */
.ins-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 1.25rem 1.3rem; height: 100%; }
.ins-card-title { font-size: .92rem; font-weight: 700; color: var(--text-primary); margin-bottom: .85rem; display: flex; align-items: center; gap: .4rem; }

/* ── Bar Rows (Packing Stats) ──────────────────────── */
.ins-bar-row   { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.ins-bar-label { min-width: 145px; font-size: .82rem; font-weight: 500; color: #374151; white-space: nowrap; }
.ins-bar-label.sm { font-size: .78rem; min-width: 165px; }
.ins-bar-wrap  { flex: 1; min-width: 0; }
.ins-bar-val   { min-width: 38px; text-align: right; font-size: .8rem; font-weight: 600; color: #374151; }

/* ── Tables ────────────────────────────────────────── */
.ins-table th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; border-bottom-width: 1px; padding: .45rem .55rem; }
.ins-table td { font-size: .84rem; vertical-align: middle; padding: .45rem .55rem; }

/* ── Alignment helper ──────────────────────────────── */
.align-items-flex-end { align-items: flex-end !important; }

/* ══════════════════════════════════════════════════════
   ADMIN — RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 576px) {
    .survey-row-main  { gap: .5rem; }
    .survey-row-stats { gap: .25rem; }
    .inv-item { font-size: .82rem; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ══════════════════════════════════════════════════════
   QUOTES PORTAL — B2B client-facing pages
   (pages/quotes/*)
   ══════════════════════════════════════════════════════ */

/* ── Service cards (landing) ──────────────────────── */
.service-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,.07);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .5rem 1.2rem rgba(0,0,0,.12) !important;
}
.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
}
.service-card.coming-soon { opacity: .65; }

/* ── News cards (landing) ─────────────────────────── */
.news-card { border: 1px solid rgba(0,0,0,.07); }
.news-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Carousel (landing) ──────────────────────────── */
.carousel-item img {
    max-height: 360px;
    object-fit: cover;
    width: 100%;
}

/* ── Quote list stats (moving-list) ──────────────── */
.stat-number { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label  { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ── Quote list detail rows (moving-list) ────────── */
.hit-item-detail-value {
    margin-bottom: 0.2rem;
    font-size: 0.83rem;
    color: #444;
}
.hit-item-detail-value:last-child { margin-bottom: 0; }

/* ── Form field icon (quote forms) ───────────────── */
.field-icon {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* ── Search highlight (moving-list) ──────────────── */
mark {
    background-color: #ffc107;
    padding: 0;
    border-radius: 2px;
}

