/* ==========================================================================
   DMCG.CO AUTHENTIC SWISS EDITORIAL MINIMALIST DESIGN SYSTEM
   Featuring Floating Capsule Dock & White Editorial Canvas
   --page-background: #FFFFFF; --page-foreground: #000000;
   ========================================================================== */

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

:root {
    --bg: #FFFFFF;
    --bg-subtle: #FAFAFA;
    --surface: #FFFFFF;
    --surface-secondary: #F4F4F4;
    --surface-hover: #ECECEC;
    --surface-active: #E2E2E2;
    
    --border: #E5E5E5;
    --border-subtle: #F0F0F0;
    --border-hover: #BBBBBB;
    --border-focus: #000000;
    
    --text-primary: #000000;
    --text-secondary: #555555;
    --text-muted: #888888;
    
    --accent: #000000;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-dock: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 13.5px;
    letter-spacing: -0.01em;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: var(--bg);
}

/* ==========================================================================
   SCROLLBAR & REVEALS
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: #DDDDDD;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #BBBBBB;
}

.reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   LOGIN / OTP OVERLAY
   ========================================================================== */

#login-overlay {
    position: fixed;
    inset: 0;
    background: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 44px 36px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.login-logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.login-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-digit {
    width: 44px;
    height: 52px;
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    font-family: monospace;
    transition: var(--transition);
}

.otp-digit:focus {
    outline: none;
    border-color: var(--border-focus);
    background: #FFFFFF;
}

.login-hint {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-hint b {
    color: var(--text-primary);
}

/* ==========================================================================
   APP CONTAINER
   ========================================================================== */

#app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    min-height: 100vh;
}

/* ==========================================================================
   DMCG FLOATING DOCK HEADER
   (The Iconic Pill Capsule Navigation from dmcg.co)
   ========================================================================== */

#site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 36px;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-subtle);
}

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

.brand-symbol {
    width: 28px;
    height: 28px;
    background: #000000;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
}

.brand-meta {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-status {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

/* --- THE FLOATING DOCK CAPSULE --- */
.dmcg-dock {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #F4F4F4;
    border: 1px solid #E6E6E6;
    padding: 3px 5px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-dock);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 100%;
}

.dmcg-dock:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
    border-color: #D6D6D6;
    background: #F1F1F1;
}

.dock-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.dock-item:hover {
    color: #000000;
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.04) translateY(-1px);
}

.dock-item.active {
    background: #FFFFFF;
    color: #000000;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.dock-item:active {
    transform: scale(0.96);
}

.dock-icon {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dock-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    background: #E5E5E5;
    color: var(--text-secondary);
    transition: var(--transition);
}

.dock-item.active .dock-badge {
    background: #000000;
    color: #FFFFFF;
}

/* Header Right Controls */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    user-select: none;
}

.sound-toggle-btn:hover {
    background: var(--surface-secondary);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.sound-toggle-btn:active {
    transform: scale(0.94);
}

/* ==========================================
   MAIN CONTENT AREA (FULL CANVAS)
   ========================================== */

#main-content {
    flex: 1;
    min-height: calc(100vh - 65px);
    padding: 36px 36px 60px 36px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.section-meta h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.section-meta p {
    color: var(--text-secondary);
    font-size: 13px;
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==========================================================================
   BUTTONS (TACTILE DMCG ANIMATIONS)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--border-hover);
    background: var(--surface-secondary);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #000000;
    color: #FFFFFF;
    border-color: #000000;
    font-weight: 500;
}

.btn-primary:hover {
    background: #222222;
    border-color: #222222;
    color: #FFFFFF;
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.2);
    background: #FFF5F5;
}

.btn-danger:hover {
    background: #FEE2E2;
    border-color: rgba(220, 38, 38, 0.4);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

.btn-telegram {
    background: #FFFFFF;
    color: #0F172A;
    border: 1px solid #E2E8F0;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-telegram:hover:not(:disabled) {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #000000;
}
.btn-telegram:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: #F1F5F9;
}

#carpet-upload-dropzone:hover {
    border-color: #94A3B8 !important;
    background: #F1F5F9 !important;
}
#carpet-upload-dropzone.dragover {
    border-color: #000000 !important;
    background: #EEF2F6 !important;
}

/* ==========================================================================
   METRIC STAT CARDS
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-subtle);
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

/* ==========================================================================
   DMCG.CO /ARCHIVE CATALOG CARDS
   ========================================================================== */

.archive-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.archive-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.archive-card:hover {
    border-color: var(--border-hover);
    background: #FAFAFA;
    box-shadow: var(--shadow-subtle);
    transform: translateY(-1px);
}

.archive-index {
    font-family: monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    width: 34px;
}

.archive-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.archive-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.archive-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.tag-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.tag-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: monospace;
}

.archive-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: #E8F5E9;
    color: var(--success);
    border: 1px solid #C8E6C9;
}

.badge-inactive {
    background: #F5F5F5;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-stage {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
}
.badge-stage-new { background: #EBF5FF; color: #1E40AF; }
.badge-stage-interested { background: #FEF3C7; color: #92400E; }
.badge-stage-negotiating { background: #FFEDD5; color: #9A3412; }
.badge-stage-sold { background: #DCFCE7; color: #166534; }
.badge-stage-archived { background: #F3F4F6; color: #4B5563; }

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #FFFFFF;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

thead {
    background: #F8F8F8;
    border-bottom: 1px solid var(--border);
}

th {
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #FAFAFA;
}

tbody tr:hover td {
    color: var(--text-primary);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px #000000;
}

textarea.form-control {
    min-height: 75px;
    resize: vertical;
}

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.98);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: #FAFAFA;
}

/* ==========================================================================
   SETTINGS CARDS & TOGGLES
   ========================================================================== */

.setting-row {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.setting-info h3 {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.setting-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #E5E5E5;
    border: 1px solid #D5D5D5;
    transition: .2s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: .2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #000000;
    border-color: #000000;
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #FFFFFF;
}

/* ==========================================================================
   CARPETS, USERBOTS & NIGHT LEADS (DMCG STYLE)
   ========================================================================== */

.carpets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.carpet-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.carpet-card:hover {
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.carpet-photo-wrap {
    width: 100%;
    height: 190px;
    background: #F0F0F0;
    position: relative;
    overflow: hidden;
}

.carpet-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.carpet-card:hover .carpet-photo-wrap img {
    transform: scale(1.03);
}

.carpet-badge-m2 {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.carpet-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.carpet-title {
    font-size: 15px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 4px;
}

.carpet-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.carpet-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.carpet-price-current {
    font-size: 16px;
    font-weight: 700;
    color: #000000;
}

.carpet-price-old {
    font-size: 12px;
    color: #888888;
    text-decoration: line-through;
}

.userbot-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.userbot-card:hover {
    border-color: #000000;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-online {
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-offline {
    background: #9CA3AF;
}

.night-lead-card {
    background: #FFFFFF;
    border: 1.5px solid #000000;
    border-left: 5px solid #E53935;
    padding: 18px 22px;
    border-radius: 6px;
    margin-bottom: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(229, 57, 53, 0.08);
}

.night-lead-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(229, 57, 53, 0.14);
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0); }
}

.badge-urgent {
    background: #E53935;
    color: #FFFFFF;
    animation: pulseGlow 2s infinite;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #000000;
    color: #FFFFFF;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   CONVERSATION CARDS & CHAT DRAWER
   ========================================================================== */

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.conversation-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.conversation-card:hover {
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.user-avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #000000;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Chat Popup Window (Modal Drawer) */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 520px;
    max-height: 75vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.chat-bubble-user {
    align-self: flex-start;
    background: #F1F1F1;
    color: #000000;
    border-bottom-left-radius: 2px;
}

.chat-bubble-bot {
    align-self: flex-end;
    background: #000000;
    color: #FFFFFF;
    border-bottom-right-radius: 2px;
}

.chat-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.6;
    display: block;
    text-align: right;
    font-family: monospace;
}

.chat-sender-label {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   KEYFRAMES & RESPONSIVE (MOBILE OPTIMIZED)
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   VORONKA & INSTAGRAM CRM KANBAN BOARD
   ========================================================================== */

.funnel-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.funnel-metric-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: var(--transition);
}

.funnel-metric-card:hover {
    border-color: #CBD5E1;
}

.funnel-metric-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.funnel-metric-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.funnel-metric-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.funnel-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 24px;
    scrollbar-width: thin;
    min-height: 580px;
}

.kanban-board::-webkit-scrollbar {
    height: 6px;
}

.kanban-column {
    flex: 0 0 320px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
}

.kanban-col-header {
    padding: 12px 14px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
    border-radius: 12px 12px 0 0;
}

.kanban-col-title {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-col-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: #F1F5F9;
    color: #475569;
}

.kanban-cards-container {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
    border-color: #CBD5E1;
}

.badge-source-ig {
    background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-source-tg {
    background: #0088CC;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-lang-uz {
    background: #EFF6FF;
    color: #1D4ED8;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #DBEAFE;
}

.badge-lang-ru {
    background: #FEF2F2;
    color: #B91C1C;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #FEE2E2;
}

.badge-gender-female {
    background: #FDF2F8;
    color: #BE185D;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #FCE7F3;
}

.badge-gender-male {
    background: #F0FDF4;
    color: #15803D;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #DCFCE7;
}

.settings-tab-nav {
    display: flex;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 18px;
    gap: 4px;
}

.settings-tab-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.settings-tab-btn.active {
    color: #000000;
    border-bottom-color: #000000;
}

@media (max-width: 900px) {
    #site-header {
        padding: 10px 16px;
        justify-content: space-between;
    }

    /* Fixed Floating Mobile Navigation Bar */
    .dmcg-dock {
        position: fixed;
        bottom: 12px;
        left: 10px;
        right: 10px;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(20px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.20);
        border: 1px solid rgba(0, 0, 0, 0.1);
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        border-radius: 40px;
        padding: 6px 10px;
        justify-content: flex-start;
    }

    .dmcg-dock::-webkit-scrollbar {
        display: none;
    }

    .dock-item {
        padding: 6px 10px;
        font-size: 11px;
    }

    #main-content {
        padding: 16px 14px 95px 14px; /* Room for bottom bar on phones */
    }

    .archive-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modal-content {
        max-width: 95% !important;
        margin: 10px !important;
    }
}
