/* ==========================================================================
   ZENTRIX FUTUROS — OPERAÇÕES REAIS NO MERCADO FINANCEIRO
   Official Design System (Extracted from Brand Identity Logo)
   Supports Dark Mode & Light Mode with CSS Custom Properties
   ========================================================================== */

:root,
[data-theme="dark"] {
    /* Core Brand Palette (Dark Mode Default - Inspired by Zentrix Logo) */
    --bg-primary: #060a07;
    --bg-secondary: #0c130e;
    --bg-card: #101913;
    --bg-card-hover: #152219;
    --bg-elevated: #18261c;
    --bg-input: #0a100c;
    --bg-glass: rgba(16, 25, 19, 0.88);

    /* Brand Accents (Neon Green + Metallic Silver) */
    --brand-primary: #00e626;
    --brand-primary-hover: #00c420;
    --brand-primary-soft: rgba(0, 230, 38, 0.14);
    --brand-primary-glow: rgba(0, 230, 38, 0.32);
    --brand-secondary: #10b981;
    --brand-silver: #cbd5e1;
    --brand-silver-bright: #f1f5f9;
    --brand-gradient: linear-gradient(135deg, #00e626 0%, #059669 100%);
    --silver-gradient: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-brand: #041206;

    /* Status Semantic Colors */
    --status-success: #00e626;
    --status-success-bg: rgba(0, 230, 38, 0.12);
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.14);
    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.14);
    --status-info: #38bdf8;
    --status-info-bg: rgba(56, 189, 248, 0.14);

    /* Borders & Shadows */
    --border-subtle: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(0, 230, 38, 0.35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 230, 38, 0.22);

    /* Layout Metrics */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --sidebar-width: 268px;
    --topbar-height: 68px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Orbitron', 'Rajdhani', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
    --bg-primary: #f4f7f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8faf9;
    --bg-elevated: #eef3f0;
    --bg-input: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.92);

    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-primary-soft: rgba(5, 150, 105, 0.12);
    --brand-primary-glow: rgba(5, 150, 105, 0.22);
    --brand-secondary: #10b981;
    --brand-silver: #334155;
    --brand-silver-bright: #0f172a;
    --brand-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --silver-gradient: linear-gradient(180deg, #0f172a 0%, #334155 100%);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-on-brand: #ffffff;

    --status-success: #059669;
    --status-success-bg: rgba(5, 150, 105, 0.12);
    --status-warning: #d97706;
    --status-warning-bg: rgba(217, 119, 6, 0.12);
    --status-danger: #dc2626;
    --status-danger-bg: rgba(220, 38, 38, 0.12);
    --status-info: #0284c7;
    --status-info-bg: rgba(2, 132, 199, 0.12);

    --border-subtle: rgba(15, 23, 42, 0.11);
    --border-strong: rgba(5, 150, 105, 0.45);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.09);
    --shadow-glow: 0 0 16px rgba(5, 150, 105, 0.16);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 230, 38, 0.32) var(--bg-secondary);
}

/* Custom Sleek Scrollbars (Dark & Light Mode) */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: rgba(12, 19, 14, 0.4);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.55;
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--brand-primary-hover);
}

/* App Shell Layout */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s ease, background-color 0.2s ease;
}

.sidebar-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-brand img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-glow);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.sidebar-brand-title span {
    color: var(--brand-primary);
}

.sidebar-brand-sub {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.68rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-weight: 600;
    border-left: 3px solid var(--brand-primary);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Language & Theme Controls */
.lang-selector {
    position: relative;
}

.lang-select-input {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 0.42rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
}

.theme-toggle-btn {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 0.42rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 500;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--brand-primary);
}

.content-container {
    padding: 1.75rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* Typography & Headers */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Grid Systems */
.grid {
    display: grid;
    gap: 1.15rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }

/* Plans Grid & Plan Card Layout */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 1.25rem;
}

.plan-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.35rem;
}

.plan-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.plan-duration-badge {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.plan-price {
    font-family: var(--font-mono);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.plan-spec-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.15rem;
    padding: 0.85rem 0.95rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.plan-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.plan-spec-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.plan-spec-val {
    text-align: right;
    white-space: nowrap;
}

/* Chat Responsive Layout */
.chat-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1.25rem;
    align-items: start;
}

/* Official WhatsApp Community Banner */
.whatsapp-hero-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.16) 0%, rgba(16, 25, 19, 0.95) 100%);
    border: 1px solid rgba(37, 211, 102, 0.45);
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.14);
    flex-wrap: wrap;
}

.whatsapp-hero-content {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex: 1;
    min-width: 260px;
}

.whatsapp-hero-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: #25D366;
    color: #041206;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    flex-shrink: 0;
    box-shadow: 0 0 18px rgba(37, 211, 102, 0.45);
}

.whatsapp-hero-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #25D366;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.whatsapp-hero-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.whatsapp-hero-sub {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.btn-whatsapp {
    background: #25D366;
    color: #041206;
    font-weight: 700;
    padding: 0.72rem 1.35rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 16px rgba(37, 211, 102, 0.35);
    white-space: nowrap;
}

.btn-whatsapp:hover {
    background: #1ebe5d;
    color: #041206;
    transform: translateY(-1px);
}

/* Financial Market News Feed Cards */
.market-news-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.market-news-item:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    color: var(--brand-primary);
}

.market-news-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
}

/* Financial Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.card-interactive:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--brand-primary);
    opacity: 0.75;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.38rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid rgba(0, 230, 38, 0.28);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.badge-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.badge-info {
    background: var(--status-info-bg);
    color: var(--status-info);
    border: 1px solid rgba(56, 189, 248, 0.28);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.62rem 1.15rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: var(--text-on-brand);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: var(--text-on-brand);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: var(--status-danger);
    color: #fff;
}

.btn-sm {
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.68rem 0.9rem;
    font-size: 0.94rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.form-control[readonly],
.form-control.input-locked {
    background: var(--bg-elevated);
    color: var(--brand-primary);
    border-color: var(--border-strong);
    cursor: not-allowed;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.form-control.is-invalid {
    border-color: var(--status-danger);
    box-shadow: 0 0 0 3px var(--status-danger-bg);
}

.field-error-msg {
    font-size: 0.76rem;
    color: var(--status-danger);
    margin-top: 0.3rem;
    display: none;
}

.field-error-msg.visible {
    display: block;
}

/* Password Eye Toggle Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper .form-control {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    font-size: 0.98rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: var(--brand-primary);
}

.locked-badge-icon {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-primary);
    pointer-events: none;
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Alerts & Banners */
.alert {
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.alert-success {
    background: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid rgba(0, 230, 38, 0.35);
}

.alert-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.alert-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.alert-info {
    background: var(--status-info-bg);
    color: var(--status-info);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th,
.data-table td {
    padding: 0.82rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.mono {
    font-family: var(--font-mono);
}

/* Auth / Guest Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 0%, var(--brand-primary-soft) 0%, var(--bg-primary) 65%);
}

.auth-topbar {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    gap: 0.6rem;
    z-index: 50;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.auth-logo-box {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo-box img {
    max-width: 190px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-glow);
    margin-bottom: 0.75rem;
}

/* Progress Bar */
.progress-track {
    width: 100%;
    height: 10px;
    background: var(--bg-elevated);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.progress-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* Chat Container */
.chat-box {
    height: 460px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border-left: 4px solid var(--brand-primary);
}

.chat-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
}

/* Tabs Navigation (Wrapped Pill Design — No Ugly Scrollbar) */
.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.55rem;
    margin-bottom: 1.5rem;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.tab-link:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.tab-link.active {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
    .chat-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: inline-flex;
    }
    .content-container {
        padding: 1.15rem;
    }
    .topbar {
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .plans-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-right {
        gap: 0.4rem;
    }
    .lang-select-input {
        max-width: 110px;
        padding: 0.35rem 0.45rem;
        font-size: 0.78rem;
    }
    .tabs-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.35rem;
    }
    .tab-link {
        justify-content: center;
        font-size: 0.78rem;
        padding: 0.48rem 0.5rem;
        white-space: normal;
        text-align: center;
    }
    .auth-card {
        padding: 1.35rem;
    }
    .card {
        padding: 1rem;
    }
}

