/* ============================================
   Bachmaier Gruppe - Kundenportal
   Design System: Navy/Gold/Cream/Stone
   Fonts: Space Grotesk + Inter
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --navy: #0f172a;
    --gold: #d4a853;
    --gold-light: #e8c878;
    --gold-dark: #b8923e;
    --cream: #faf9f6;
    --border: #e8e6e1;
    --border-light: #f0eeea;
    --text-primary: #292524;
    --text-secondary: #78716c;
    --text-muted: #9ca3af;
    --white: #ffffff;
    --success: #22c55e;
    --danger: #ef4444;
    --info: #3b82f6;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 240px;
}

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

a { color: var(--gold); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--gold-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--navy);
}

img { max-width: 100%; height: auto; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ============================================
   BACKGROUND GRID
   ============================================ */
.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    display: none;
}
@media (min-width: 1024px) {
    .bg-grid { display: block; }
    .bg-grid::before, .bg-grid::after {
        content: '';
        position: absolute;
        top: 0; bottom: 0;
        width: 1px;
        background: var(--border);
    }
    .bg-grid::before { left: 25%; }
    .bg-grid::after { left: 50%; }
    .bg-grid-extra1 { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); left: 75%; }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: 80px;
    display: flex;
    align-items: center;
}

.header-inner {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Text Logo */
.logo-link {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-decoration: none;
}
.logo-link:hover { color: var(--navy); }

.logo-top {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
    transition: color 0.3s;
}
.logo-link:hover .logo-top { color: var(--gold); }

.logo-bottom {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Portal Badge */
.portal-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.2);
    padding: 6px 14px;
    border-radius: 100px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--navy); }

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.nav-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--navy);
    transition: 0.3s;
    display: block;
}

@media (max-width: 768px) {
    .nav-mobile-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 80px; left: 0; right: 0;
        background: var(--cream);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        transform: translateY(-120%);
        opacity: 0;
        transition: 0.4s var(--ease);
    }
    .nav-links.active { transform: translateY(0); opacity: 1; }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: calc(100vh - 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    position: relative;
}
.hero-inner {
    max-width: 1152px;
    width: 100%;
    text-align: center;
}

.hero-tag {
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid rgba(212, 168, 83, 0.15);
    padding: 8px 18px;
    border-radius: 100px;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s var(--ease) 0.1s forwards;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--navy);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s var(--ease) 0.25s forwards;
}

.hero h1 .gold-underline {
    position: relative;
    display: inline-block;
}
.hero h1 .gold-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: clamp(0.2rem, 0.6vw, 0.35rem);
    background: var(--gold);
    border-radius: 2px;
    transform: scaleX(0);
    animation: scaleIn 0.8s var(--ease) 0.8s forwards;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s var(--ease) 0.4s forwards;
}

/* ============================================
   PORTAL CARDS
   ============================================ */
.portal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 420px;
    margin: 0 auto;
}

.portal-card {
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    padding: 32px;
    text-align: left;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.5s var(--ease);
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s var(--ease) 0.55s forwards;
}
.portal-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
}

.portal-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.25rem;
    transition: transform 0.3s;
}
.portal-card:hover .portal-card-icon { transform: scale(1.1); }
.portal-card-icon.gold-bg { background: rgba(212, 168, 83, 0.1); }

.portal-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--navy);
}

.portal-card-subtitle {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(212, 168, 83, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.portal-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    opacity: 1;
    transform: none;
    animation: none;
}

.portal-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy);
    transition: color 0.3s;
}
.portal-card-cta .arrow { transition: transform 0.3s; }
.portal-card:hover .portal-card-cta .arrow { transform: translateX(4px); }

/* ============================================
   TRUST INDICATORS
   ============================================ */
.trust-strip {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    padding: 32px 24px;
}
.trust-inner {
    max-width: 1152px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 32px 64px;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.6s var(--ease);
}
.trust-item.visible { opacity: 1; transform: translateY(0); }
.trust-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(212, 168, 83, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.trust-label {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy);
}
.trust-desc { font-size: 0.75rem; color: var(--text-secondary); }

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section { padding: 80px 24px 96px; text-align: center; }
.cta-inner {
    max-width: 672px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: 0.7s var(--ease);
}
.cta-inner.visible { opacity: 1; transform: translateY(0); }
.cta-section h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}
.cta-section p { color: var(--text-secondary); margin-bottom: 32px; line-height: 1.7; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--gold);
    color: var(--navy);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(212, 168, 83, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    color: var(--navy);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    transition: 0.3s;
}
.btn-danger:hover { background: #dc2626; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--navy);
    color: var(--white);
    padding: 64px 24px 32px;
    margin-top: auto;
}
.footer-inner { max-width: 1152px; margin: 0 auto; }
.footer-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 48px;
}
@media (min-width: 768px) {
    .footer-top { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer-logo-top { font-family: var(--font-heading); font-size: 0.875rem; font-weight: 700; }
.footer-logo-bottom { font-family: var(--font-heading); font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); }
.footer-contact { text-align: left; }
@media (min-width: 768px) { .footer-contact { text-align: right; } }
.footer-contact a { color: rgba(255, 255, 255, 0.7); font-size: 0.875rem; transition: color 0.3s; }
.footer-contact a:hover { color: var(--gold); }
.footer-address { font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); margin-top: 4px; }
.footer-divider { border: none; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 32px; }
.footer-bottom { display: flex; flex-direction: column; align-items: center; gap: 16px; }
@media (min-width: 640px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }
.footer-copyright { font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { font-size: 0.75rem; color: rgba(255, 255, 255, 0.5); transition: color 0.3s; }
.footer-links a:hover { color: var(--gold); }

/* ============================================
   CHAT PAGE - BEFORE START
   ============================================ */
.chat-landing {
    max-width: 480px;
    margin: 0 auto;
    padding: 100px 24px 24px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.chat-landing-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.chat-landing-top {
    padding: 40px 32px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
}

.chat-landing-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    border-radius: var(--radius);
}

.chat-landing-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.chat-landing-tag {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--cream);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.chat-landing-form { padding: 32px; }

/* ============================================
   CHAT PAGE - ACTIVE CHAT
   ============================================ */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header-bar {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

a.chat-header-logo {
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 4px;
    padding: 4px 6px;
    margin: -4px -6px;
}
a.chat-header-logo:hover { opacity: 0.7; }
.chat-header-logo {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}
.chat-header-logo small {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
}

.chat-header-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.chat-header-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold);
}

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

.chat-progress-bar {
    width: 96px;
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}
.chat-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 100px;
    transition: width 0.5s var(--ease);
}
.chat-progress-text {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-heading);
    white-space: nowrap;
}

.chat-header-btn {
    height: 32px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.chat-header-btn:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: msgIn 0.3s var(--ease);
}
.chat-message.bot { align-self: flex-start; }
.chat-message.customer { align-self: flex-end; flex-direction: row-reverse; }

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--font-heading);
}
.chat-message.bot .chat-avatar { background: var(--gold); color: var(--navy); }
.chat-message.customer .chat-avatar { background: var(--border); color: var(--navy); }

.chat-bubble {
    padding: 14px 18px;
    font-size: 0.875rem;
    line-height: 1.7;
    white-space: pre-line;
}
.chat-message.bot .chat-bubble {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top-right-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.chat-message.customer .chat-bubble {
    background: var(--navy);
    color: #fff;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top-left-radius: 12px;
}

.chat-bubble-time {
    font-size: 0.625rem;
    margin-top: 6px;
    color: var(--text-muted);
}
.chat-message.customer .chat-bubble-time { color: rgba(255, 255, 255, 0.35); }

/* Typing Indicator */
.typing-indicator { display: flex; gap: 6px; padding: 4px 0; }
.typing-indicator span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold);
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.chat-input-area textarea {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    resize: none;
    outline: none;
    transition: 0.3s;
    min-height: 48px;
    max-height: 140px;
    background: var(--cream);
}
.chat-input-area textarea:focus {
    border-color: var(--gold);
    background: #fff;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--navy);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transition: 0.3s;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--gold); color: var(--navy); transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.25; cursor: not-allowed; transform: none; }

.chat-input-hint {
    text-align: center;
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Completion Banner */
.chat-completion {
    margin-top: 16px;
    padding: 32px;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(212, 168, 83, 0.15);
    animation: fadeUp 0.5s var(--ease);
}
.chat-completion-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.12);
    border-radius: 50%;
}
.chat-completion h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}
.chat-completion p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}
.chat-completion-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chat-completion-reset {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}
.chat-completion-reset:hover { color: var(--navy); }

/* Chat Footer */
.chat-footer {
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--cream);
}
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    animation: fadeUp 0.5s var(--ease);
}
.login-text-logo { text-align: center; margin-bottom: 32px; }
.login-text-logo .logo-top { font-size: 1.5rem; }
.login-text-logo .logo-bottom { font-size: 0.85rem; }

.login-bg-monogram {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--gold);
    letter-spacing: 0.02em;
}

.login-card h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: var(--navy);
}
.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.875rem;
}
.login-error {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: none;
}
.login-card .btn { width: 100%; margin-top: 8px; }
.login-note { text-align: center; margin-top: 24px; font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   FORM INPUTS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: 0.3s;
    background: var(--cream);
    color: var(--text-primary);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    color: #fff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
    padding: 24px 0;
}
.admin-sidebar-header {
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}
.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}
.admin-sidebar-brand .slogo {
    width: 36px;
    height: 36px;
    background: var(--gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--navy);
    letter-spacing: 0.02em;
}
.admin-sidebar-brand span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.875rem;
}
.admin-sidebar-brand small {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

.admin-nav { padding: 0 12px; }
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.3s;
    margin-bottom: 2px;
}
.admin-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.admin-nav-item.active { background: rgba(212, 168, 83, 0.1); color: var(--gold); }
.admin-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav-divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 12px 16px; }

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Admin Top Bar */
.admin-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
    position: sticky;
    top: 0;
    background: var(--cream);
    z-index: 50;
}
.admin-top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-top-bar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--navy);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    font-family: var(--font-heading);
}
.admin-top-bar-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.admin-header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.admin-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08); }
.stat-card.highlight {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}
.stat-card.highlight .stat-card-label { color: rgba(255, 255, 255, 0.6); }
.stat-card.highlight .stat-card-value { color: var(--white); }
.stat-card.highlight .stat-card-icon { background: rgba(212, 168, 83, 0.2); }

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-card-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.1);
    color: var(--gold);
}
.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--navy);
    margin-bottom: 4px;
}
.stat-card-change { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   TABLE
   ============================================ */
.table-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.table-header h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
}
.table-header p { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.table-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.table-search {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: 0.3s;
    min-width: 180px;
    background: var(--cream);
}
.table-search:focus { border-color: var(--gold); background: #fff; }

.table-filter-select {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    background: var(--white);
    cursor: pointer;
}

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
}
.table td {
    padding: 14px 20px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(212, 168, 83, 0.03); }

/* Status Badges */
.status-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-heading);
}
.status-badge.active { background: rgba(212, 168, 83, 0.15); color: #b8941f; border: 1px solid rgba(212, 168, 83, 0.3); }
.status-badge.completed { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.status-badge.archived { background: rgba(100, 116, 139, 0.1); color: var(--text-muted); }

.table-empty {
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
}
.table-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    border-radius: 50%;
    color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--cream);
    padding: 4px;
    border-radius: var(--radius-sm);
}
.filter-tab {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font-body);
}
.filter-tab:hover { color: var(--navy); }
.filter-tab.active {
    background: var(--white);
    color: var(--navy);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    border-top: 1px solid var(--border);
}
.pagination button {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.3s;
    color: var(--text-secondary);
    font-family: var(--font-body);
}
.pagination button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.pagination button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================
   CONVERSATION DETAIL
   ============================================ */
.conv-detail-header {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}
.conv-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.conv-detail-item label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-family: var(--font-heading);
}
.conv-detail-item span { font-size: 0.9rem; font-weight: 500; }

.conv-detail-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 16px;
}
.conv-chat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.conv-sidebar-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.conv-sidebar-panel h3 {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.conv-sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.8rem;
}
.conv-sidebar-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}
.conv-sidebar-label { color: var(--text-muted); }
.conv-sidebar-value { font-weight: 500; color: var(--text-primary); text-align: right; }

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 24px 64px;
}
.legal-page h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--navy);
    letter-spacing: -0.02em;
}
.legal-page h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--navy);
}
.legal-page h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--navy);
}
.legal-page p { margin-bottom: 12px; color: var(--text-secondary); line-height: 1.8; }
.legal-page ul { margin: 12px 0; padding-left: 24px; }
.legal-page li { margin-bottom: 6px; color: var(--text-secondary); line-height: 1.7; }

/* ============================================
   404 PAGE
   ============================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}
.error-page h1 {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 8px;
}
.error-page h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 16px;
}
.error-page p { color: var(--text-secondary); margin-bottom: 32px; }

/* ============================================
   COOKIE CONSENT
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    animation: fadeUp 0.5s var(--ease);
}
.cookie-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
}
.cookie-card {
    position: relative;
    margin: 16px auto 16px;
    max-width: 640px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    padding: 24px;
    overflow: hidden;
}
.cookie-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 24px;
}
.cookie-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cookie-icon svg { width: 16px; height: 16px; color: var(--navy); }
.cookie-title {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}
.cookie-text { font-size: 0.8125rem; line-height: 1.6; color: var(--text-secondary); }
.cookie-text a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.cookie-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    transition: color 0.2s;
    border-radius: 4px;
}
.cookie-close:hover { color: var(--navy); background: var(--cream); }
.cookie-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.cookie-btn {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
}
.cookie-btn:hover { border-color: var(--navy); color: var(--navy); }
.cookie-btn-accept {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    font-weight: 600;
}
.cookie-btn-accept:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.cookie-btn-reject {
    color: var(--text-secondary);
}
.cookie-btn-reject:hover { border-color: var(--danger); color: var(--danger); }

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    font-size: 0.85rem;
    animation: fadeUp 0.3s var(--ease);
    max-width: 360px;
}
.toast.error { border-left-color: var(--danger); }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--text-muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    to { transform: scaleX(1); }
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.active { transform: translateX(0); }
    .admin-main { margin-left: 0; }
}

.admin-mobile-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 200;
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: #fff;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
}
.admin-sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
    .chat-container { padding: 16px; }
    .chat-messages { max-height: calc(100vh - 310px); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .conv-detail-layout { grid-template-columns: 1fr; }
    .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .table th:nth-child(n+3), .table td:nth-child(n+3) { display: none; }
    .cookie-buttons { flex-direction: column; }
}
