/* ============================================================
   EML CRM — Global Stylesheet
   Design: Red accent (#e31b23), Inter font, rounded cards
   ============================================================ */

/* RESET */
* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
   font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
   background: #eef0f4;
   height: 100vh;
   display: flex;
   padding: 0;
   margin: 0;
   overflow: hidden;
}

body.login-page,
body.login-body {
   background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
   justify-content: center;
   align-items: center;
   padding: 20px;
   overflow: auto;
}

.app-container {
   width: 100%;
   height: 100vh;
   background: #fff;
   display: flex;
   overflow: hidden;
   transition: all .2s ease;
}

/* SIDEBAR */
/* SIDEBAR */
.sidebar {
   background: #ffffff;
   color: #0f172a;
   display: flex;
   flex-direction: column;
   transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
   height: 100%;
   overflow-y: auto;
   overflow-x: hidden;
   border-right: 1px solid #e2e8f0;
   box-shadow: 4px 0 24px rgba(15, 23, 42, 0.03);
   z-index: 100;
}

.sidebar::-webkit-scrollbar {
   width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
   background: #e2e8f0;
   border-radius: 999px;
}

.sidebar.full {
   width: 275px;
}

.sidebar.min {
   width: 88px;
}

.sidebar.hide {
   width: 0;
   padding: 0;
   opacity: 0;
   pointer-events: none;
}

.sidebar-inner {
   padding: 20px 14px;
   display: flex;
   flex-direction: column;
   height: 100%;
   white-space: nowrap;
}

.sidebar.hide .sidebar-inner {
   display: none;
}

/* BRAND LOGO AREA */
.logo-area {
   display: flex;
   align-items: center;
   gap: 12px;
   margin-bottom: 24px;
   padding: 4px 6px;
}

.logo-icon {
   background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
   width: 40px;
   height: 40px;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   color: #ffffff;
   font-size: 22px;
   flex-shrink: 0;
   box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.logo-text {
   font-weight: 800;
   font-size: 1.25rem;
   letter-spacing: -0.02em;
   color: #0f172a;
}

.plan-badge {
   background: #f1f5f9;
   color: #0f172a;
   padding: 2px 8px;
   border-radius: 999px;
   font-size: 0.68rem;
   font-weight: 800;
   border: 1px solid #cbd5e1;
   display: inline-block;
   margin-top: 2px;
   text-transform: uppercase;
   letter-spacing: 0.04em;
}

.min .logo-text,
.min .user-details,
.min .nav-label,
.min .plan-badge {
   display: none !important;
}

/* NAV SECTION CATEGORIES */
.nav-section-title {
   font-size: 0.68rem;
   font-weight: 800;
   text-transform: uppercase;
   letter-spacing: 0.09em;
   color: #94a3b8;
   padding: 16px 12px 6px;
   margin-top: 6px;
   white-space: nowrap;
   overflow: hidden;
   transition: opacity 0.2s ease;
}

.min .nav-section-title {
   opacity: 0;
   height: 0;
   padding: 0;
   margin: 0;
   overflow: hidden;
}

/* NAV ITEMS */
.sidebar-nav {
   display: flex;
   flex-direction: column;
   gap: 2px;
}

.nav-item {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 10px 14px;
   border-radius: 12px;
   transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
   color: #475569;
   cursor: pointer;
   font-weight: 600;
   font-size: 0.88rem;
   text-decoration: none;
   white-space: nowrap;
}

.nav-item i,
.nav-item .ph {
   font-size: 1.25rem;
   width: 24px;
   text-align: center;
   flex-shrink: 0;
   color: #64748b;
   transition: color 0.2s ease;
}

.nav-item:hover:not(.active) {
   background: #f8fafc;
   color: #0f172a;
   transform: translateX(3px);
}

.nav-item:hover:not(.active) i,
.nav-item:hover:not(.active) .ph {
   color: #0f172a;
}

.nav-item.active {
   background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
   color: #ffffff;
   box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.nav-item.active i,
.nav-item.active .ph,
.nav-item.active .nav-label {
   color: #ffffff !important;
}

.nav-label {
   font-size: 0.88rem;
   font-weight: 600;
   letter-spacing: -0.01em;
   transition: opacity 0.2s;
}

/* MINIMIZED MODE ALIGNMENT & TOOLTIPS */
.sidebar.min {
   width: 80px;
}

.min .sidebar-inner {
   padding: 16px 0;
   align-items: center;
}

.min .logo-area {
   padding: 0;
   margin-bottom: 20px;
   width: 100%;
   justify-content: center;
   gap: 0;
}

.min .logo-area > div:not(.logo-icon) {
   display: none !important;
}

.min .logo-icon {
   width: 44px;
   height: 44px;
   border-radius: 14px;
   margin: 0 auto;
   font-size: 1.35rem;
   box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
   flex-shrink: 0;
}

.min .sidebar-nav {
   width: 100%;
   align-items: center;
}

.min .nav-item {
   justify-content: center;
   padding: 0;
   width: 44px;
   height: 44px;
   margin: 4px auto;
   border-radius: 14px;
   position: relative;
}

.min .nav-item i,
.min .nav-item .ph {
   width: auto;
   font-size: 1.35rem;
   margin: 0;
}

.min .user-section {
   padding-top: 12px;
   width: 100%;
}

.min .user-card {
   background: transparent;
   border: none;
   padding: 0;
   justify-content: center;
   width: 100%;
}

.min .avatar-wrap {
   margin: 0 auto;
}

.min .avatar {
   width: 44px;
   height: 44px;
   border-radius: 14px;
   font-size: 0.95rem;
   margin: 0 auto;
}

/* FLOATING BODY TOOLTIP (UNCLIPPED BY SIDEBAR OVERFLOW) */
.crm-nav-tooltip {
   position: fixed;
   transform: translateY(-50%) scale(0.92);
   background: #0f172a;
   color: #ffffff;
   padding: 6px 12px;
   border-radius: 8px;
   font-size: 0.78rem;
   font-weight: 700;
   white-space: nowrap;
   opacity: 0;
   pointer-events: none;
   transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
   box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
   z-index: 99999;
}

.crm-nav-tooltip::before {
   content: '';
   position: absolute;
   right: 100%;
   top: 50%;
   transform: translateY(-50%);
   border-width: 5px;
   border-style: solid;
   border-color: transparent #0f172a transparent transparent;
}

.crm-nav-tooltip.active {
   opacity: 1;
   transform: translateY(-50%) scale(1);
}

/* USER PROFILE CARD */
.user-section {
   margin-top: auto;
   padding-top: 16px;
}

.user-card {
   background: #f8fafc;
   border: 1px solid #e2e8f0;
   border-radius: 16px;
   padding: 10px 12px;
   display: flex;
   align-items: center;
   gap: 12px;
   transition: all 0.2s ease;
}

.user-card:hover {
   background: #f1f5f9;
   border-color: #cbd5e1;
}

.avatar-wrap {
   position: relative;
   flex-shrink: 0;
}

.avatar {
   width: 38px;
   height: 38px;
   background: linear-gradient(135deg, #e31b23 0%, #0f172a 100%);
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 800;
   font-size: 0.88rem;
   color: #ffffff;
   flex-shrink: 0;
}

.user-status-dot {
   position: absolute;
   bottom: 0;
   right: 0;
   width: 10px;
   height: 10px;
   background: #10b981;
   border: 2px solid #ffffff;
   border-radius: 50%;
}

.user-details {
   display: flex;
   flex-direction: column;
   overflow: hidden;
}

.user-name {
   font-weight: 700;
   color: #0f172a;
   font-size: 0.88rem;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.user-role {
   font-size: 0.75rem;
   color: #64748b;
   font-weight: 600;
   text-transform: capitalize;
}

/* MAIN CONTENT */
.main-content {
   flex: 1;
   background: #fff;
   display: flex;
   flex-direction: column;
   overflow-y: auto;
   overflow-x: visible;
   position: relative;
}

.header {
   background: rgba(255, 255, 255, .98);
   backdrop-filter: blur(12px);
   -webkit-backdrop-filter: blur(12px);
   padding: 14px 30px;
   display: flex;
   align-items: center;
   justify-content: space-between;
   border-bottom: 1px solid #e8e8e8;
   flex-wrap: wrap;
   gap: 12px;
   flex-shrink: 0;
   min-height: 72px;
   box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
   position: sticky;
   top: 0;
   z-index: 1100;
   isolation: isolate;
   overflow: visible;
}

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

.menu-toggle {
   background: #f1f5f9;
   border: none;
   font-size: 2.2rem;
   color: #0f172a;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 52px;
   height: 52px;
   border-radius: 20px;
   transition: .2s;
}

.menu-toggle:hover {
   background: #e2e8f0;
}

.page-title {
   font-size: 1.5rem;
   font-weight: 700;
   color: #1d1d1d;
   letter-spacing: -.5px;
}

/* Header user block */
.header-user {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 6px 14px 6px 6px;
   background: #fafafa;
   border-radius: 40px;
   border: 1px solid #f0f0f0;
   cursor: default;
}

.header-avatar {
   width: 36px;
   height: 36px;
   border-radius: 50%;
   background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
   color: #fff;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 700;
   font-size: .8rem;
   flex-shrink: 0;
}

.header-user-info {
   display: flex;
   flex-direction: column;
   line-height: 1.3;
}

.header-user-name {
   font-weight: 600;
   font-size: .85rem;
   color: #1d1d1d;
}

.header-user-org {
   font-size: .72rem;
   color: #999;
   font-weight: 500;
}

.header-icon-logout {
   border-color: transparent;
   color: #aaa;
}

.header-icon-logout:hover {
   background: #fce4ec;
   border-color: #fce4ec;
   color: #c62828;
}

.header-btn {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 42px;
   height: 42px;
   border-radius: 50%;
   color: #666;
   text-decoration: none;
   transition: .15s;
   font-size: 1.3rem;
}

.header-btn:hover {
   background: #fef1f0;
   color: #e31b23;
}

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

.search-box {
   background: #f7f7f7;
   border-radius: 48px;
   padding: 12px 22px;
   display: flex;
   align-items: center;
   gap: 10px;
   border: 1px solid #eee;
}

.search-box i {
   color: #e31b23;
   font-size: 1.3rem;
}

.search-box input {
   border: none;
   background: transparent;
   outline: none;
   font-size: 1rem;
   width: 220px;
}

.header-icon {
   background: #fff;
   width: 42px;
   height: 42px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   border: 1px solid #f0f0f0;
   color: #666;
   font-size: 1.2rem;
   cursor: pointer;
   transition: .15s;
   text-decoration: none;
}

.header-icon:hover {
   background: #fef1f0;
   border-color: #fddcda;
   color: #e31b23;
}

/* DASHBOARD */
.dashboard-content {
   padding: 30px 30px 40px;
   overflow-y: auto;
   background: #fafafa;
   flex: 1;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD V2 — Premium Layout
   ══════════════════════════════════════════════════════════ */
.db-v2 { max-width: 1440px; }

/* ── Greeting ── */
.db-greeting {
   display: flex; align-items: center; justify-content: space-between; gap: 16px;
   margin-bottom: 24px; flex-wrap: wrap;
}
.db-greeting-title {
   font-size: 1.65rem; font-weight: 800; color: #1a1a2e; letter-spacing: -.3px;
   margin: 0 0 4px;
}
.db-greeting-sub { font-size: .88rem; color: #888; margin: 0; }
.db-date { font-weight: 600; color: #555; }
.db-greeting-actions { display: flex; gap: 8px; }
.db-quick-btn {
   display: inline-flex; align-items: center; gap: 6px;
   padding: 10px 18px; border-radius: 12px; font-size: .82rem; font-weight: 700;
   background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff;
   text-decoration: none; transition: all .2s; border: none; cursor: pointer;
   box-shadow: 0 4px 14px rgba(15, 23, 42, .25);
}
.db-quick-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(15, 23, 42, .35); }
.db-quick-btn.ghost {
   background: #fff; color: #555; border: 1px solid #e0e0e0; box-shadow: none;
}
.db-quick-btn.ghost:hover { background: #f8f8f8; border-color: #ccc; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.db-quick-btn.sm { padding: 7px 14px; font-size: .75rem; }

/* ── Plan Banner ── */
.db-plan-banner {
   display: flex; align-items: center; justify-content: space-between; gap: 12px;
   background: linear-gradient(135deg, #fff3e0, #fffde7); border: 1px solid #ffe0b2;
   padding: 14px 20px; border-radius: 14px; margin-bottom: 20px;
}
.db-plan-left { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: #5d4037; }

/* ── Smart Insights ── */
.db-insights-row {
   display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px;
   margin-bottom: 24px;
}
.db-insight {
   display: flex; align-items: center; gap: 10px;
   padding: 12px 16px; border-radius: 12px; border: 1px solid var(--ins-bg);
   background: var(--ins-bg); font-size: .82rem; color: #333;
}
.db-insight i { font-size: 1.2rem; color: var(--ins-color); flex-shrink: 0; }

/* ── KPI Grid ── */
.db-kpi-grid {
   display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
   margin-bottom: 28px;
}
.db-kpi {
   background: #fff; border-radius: 20px; padding: 20px 18px; position: relative;
   border: 1px solid #f0f0f0; transition: all .25s;
   box-shadow: 0 4px 16px -4px rgba(0,0,0,.03);
   display: flex; flex-direction: column; gap: 4px;
}
.db-kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 32px -8px rgba(0,0,0,.08); border-color: #e8e8e8; }
.db-kpi-icon {
   width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center;
   justify-content: center; font-size: 1.4rem; margin-bottom: 8px;
   background: var(--kpi-bg); color: var(--kpi-color);
}
.db-kpi-body { display: flex; flex-direction: column; gap: 2px; }
.db-kpi-label { font-size: .72rem; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: .3px; }
.db-kpi-value { font-size: 1.8rem; font-weight: 800; color: #1a1a2e; letter-spacing: -.5px; line-height: 1.1; }
.db-kpi-trend { font-size: .7rem; font-weight: 600; display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.db-kpi-trend.up { color: #2e7d32; }
.db-kpi-trend.down { color: #c62828; }
.db-kpi-trend.neutral { color: #888; }
.db-kpi-trend i { font-size: .65rem; }
.db-kpi-sub {
   font-size: .65rem; color: #bbb; position: absolute; top: 18px; right: 18px;
   background: #f8f8f8; padding: 3px 8px; border-radius: 6px;
}

/* ── Cards & Charts ── */
.db-charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.db-bottom-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.db-card {
   background: #fff; border-radius: 20px; padding: 20px; border: 1px solid #f0f0f0;
   box-shadow: 0 4px 16px -4px rgba(0,0,0,.03); transition: all .2s;
}
.db-card:hover { box-shadow: 0 8px 28px -6px rgba(0,0,0,.06); }
.db-card.db-card-2x { grid-column: auto; }
.db-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 8px; }
.db-card-title { font-size: .95rem; font-weight: 700; color: #1a1a2e; display: flex; align-items: center; gap: 6px; }
.db-card-title i { font-size: 1.1rem; }
.db-card-badge {
   font-size: .65rem; font-weight: 700; padding: 4px 10px; border-radius: 8px;
   background: #f0f7ff; color: #1565c0;
}
.db-card-link {
   font-size: .75rem; font-weight: 600; color: #888; text-decoration: none;
   display: flex; align-items: center; gap: 3px; transition: color .2s;
}
.db-card-link:hover { color: #e31b23; }
.db-chart-wrap { position: relative; }

/* ── Source Legend ── */
.db-source-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.db-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; color: #666; }
.db-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Lead Status Funnel ── */
.db-status-list { display: flex; flex-direction: column; gap: 10px; }
.db-status-item { display: flex; flex-direction: column; gap: 5px; }
.db-status-info { display: flex; align-items: center; gap: 8px; }
.db-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.db-status-name { font-size: .78rem; font-weight: 600; color: #333; flex: 1; }
.db-status-count { font-size: .78rem; font-weight: 700; color: #1a1a2e; }
.db-status-bar-wrap { height: 6px; background: #f0f2f5; border-radius: 3px; overflow: hidden; }
.db-status-bar { height: 100%; border-radius: 3px; transition: width .6s ease-out; min-width: 2px; }

/* ── Table ── */
.db-table-wrap { overflow-x: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.db-table th {
   text-align: left; font-size: .68rem; font-weight: 700; color: #999;
   text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px;
   border-bottom: 2px solid #f5f5f5;
}
.db-table td { padding: 10px; border-bottom: 1px solid #f8f8f8; color: #444; vertical-align: middle; }
.db-table tr:last-child td { border-bottom: none; }
.db-table tr:hover td { background: #fafbfc; }
.db-lead-cell { display: flex; align-items: center; gap: 10px; }
.db-avatar {
   width: 36px; height: 36px; border-radius: 12px; background: #e31b23; color: #fff;
   display: flex; align-items: center; justify-content: center; font-size: .75rem;
   font-weight: 700; flex-shrink: 0;
}
.db-lead-name { font-weight: 700; color: #1a1a2e; font-size: .82rem; }
.db-lead-loc { font-size: .7rem; color: #999; }
.db-src-pill {
   font-size: .62rem; font-weight: 700; padding: 3px 8px; border-radius: 6px;
   background: #f5f5f5; color: #666; text-transform: uppercase; letter-spacing: .3px;
}
.db-val { font-weight: 700; color: #2e7d32; }
.db-agent { font-size: .78rem; color: #888; }
.db-time { font-size: .75rem; color: #bbb; white-space: nowrap; }

/* ── Task List ── */
.db-task-list { display: flex; flex-direction: column; gap: 2px; }
.db-task {
   display: flex; align-items: center; gap: 12px; padding: 12px 8px;
   border-radius: 10px; transition: background .15s;
}
.db-task:hover { background: #fafbfc; }
.db-task.overdue { background: #fff8f8; }
.db-task-prio { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.db-task-body { flex: 1; min-width: 0; }
.db-task-title { font-weight: 600; font-size: .84rem; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: .7rem; color: #999; }
.db-task-meta i { font-size: .72rem; }
.db-task-meta span { display: inline-flex; align-items: center; gap: 3px; }
.db-task-overdue { color: #c62828 !important; font-weight: 700; }
.db-task-prio-label {
   font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
   padding: 3px 8px; border-radius: 6px; border: 1px solid; flex-shrink: 0;
}

/* ── Deal List ── */
.db-deal-list { display: flex; flex-direction: column; gap: 2px; }
.db-deal-item {
   display: flex; align-items: center; gap: 12px; padding: 12px 8px;
   border-radius: 10px; transition: background .15s;
}
.db-deal-item:hover { background: #fafbfc; }
.db-deal-stage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.db-deal-info { flex: 1; min-width: 0; }
.db-deal-title { font-weight: 700; font-size: .84rem; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-deal-meta { font-size: .7rem; color: #999; margin-top: 2px; }
.db-deal-right { text-align: right; flex-shrink: 0; }
.db-deal-val { font-weight: 800; font-size: .88rem; color: #1a1a2e; }
.db-deal-stage {
   display: inline-block; font-size: .58rem; font-weight: 700; text-transform: uppercase;
   letter-spacing: .3px; padding: 2px 7px; border-radius: 5px; margin-top: 3px;
}

/* ── Activity List ── */
.db-activity-list { display: flex; flex-direction: column; gap: 0; max-height: 400px; overflow-y: auto; }
.db-activity-item {
   display: flex; gap: 10px; padding: 10px 4px;
   border-bottom: 1px solid #f8f8f8; align-items: flex-start;
}
.db-activity-item:last-child { border-bottom: none; }
.db-activity-dot {
   width: 28px; height: 28px; border-radius: 50%; background: #f5f5f5;
   display: flex; align-items: center; justify-content: center;
   font-size: .78rem; color: #999; flex-shrink: 0;
}
.db-activity-body { flex: 1; min-width: 0; }
.db-activity-text { font-size: .8rem; color: #444; line-height: 1.4; }
.db-activity-entity { color: #1565c0; font-weight: 600; }
.db-activity-time { font-size: .68rem; color: #bbb; margin-top: 2px; }

/* ── Agent Leaderboard ── */
.db-agent-list { display: flex; flex-direction: column; gap: 4px; }
.db-agent-item {
   display: flex; align-items: center; gap: 10px; padding: 10px 8px;
   border-radius: 10px; transition: background .15s;
}
.db-agent-item:hover { background: #fafbfc; }
.db-agent-rank {
   width: 22px; height: 22px; border-radius: 50%; background: #f5f5f5;
   display: flex; align-items: center; justify-content: center;
   font-size: .65rem; font-weight: 800; color: #999; flex-shrink: 0;
}
.db-agent-item:nth-child(1) .db-agent-rank { background: #fff8e1; color: #f57f17; }
.db-agent-item:nth-child(2) .db-agent-rank { background: #f5f5f5; color: #666; }
.db-agent-item:nth-child(3) .db-agent-rank { background: #fff3e0; color: #e65100; }
.db-agent-avatar {
   width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #667eea, #764ba2);
   color: #fff; display: flex; align-items: center; justify-content: center;
   font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.db-agent-info { flex: 1; }
.db-agent-name { font-weight: 700; font-size: .82rem; color: #1a1a2e; }
.db-agent-stats { font-size: .7rem; color: #999; }

/* ── Empty State Mini ── */
.db-empty-mini {
   text-align: center; padding: 24px 12px; color: #bbb; font-size: .82rem;
   display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.db-empty-mini i { font-size: 1.5rem; color: #ddd; }

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

.stat-card {
   background: #fff;
   border-radius: 30px;
   padding: 26px 24px;
   box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .04);
   border: 1px solid #fff;
   display: flex;
   align-items: center;
   gap: 20px;
   transition: .15s;
}

.stat-card:hover {
   transform: translateY(-2px);
   box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .08);
}

.stat-icon {
   width: 64px;
   height: 64px;
   background: #ffeae9;
   border-radius: 24px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 2.2rem;
   color: #e31b23;
}

.stat-content h4 {
   color: #6b6b6b;
   font-weight: 500;
   font-size: 1rem;
   letter-spacing: .3px;
}

.stat-content .value {
   font-size: 2.4rem;
   font-weight: 700;
   color: #222;
   line-height: 1.2;
}

.stat-trend {
   color: #e31b23;
   font-weight: 600;
   font-size: .95rem;
}

.charts-row {
   display: grid;
   grid-template-columns: 2fr 1fr;
   gap: 26px;
   margin-bottom: 36px;
}

.card {
   background: #fff;
   border-radius: 32px;
   padding: 24px 26px;
   box-shadow: 0 15px 30px -12px rgba(0, 0, 0, .05);
   border: 1px solid #f1f1f1;
}

.card-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 22px;
   font-weight: 600;
   color: #333;
   font-size: 1.25rem;
}

/* LEAD ITEMS */
.lead-item {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 16px 0;
   border-bottom: 1px solid #f4f4f4;
}

.lead-item:last-child {
   border: none;
}

.lead-info {
   display: flex;
   align-items: center;
   gap: 18px;
}

.lead-avatar {
   width: 52px;
   height: 52px;
   border-radius: 20px;
   background: #0f172a;
   color: #fff;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 600;
   font-size: 1.2rem;
}

.lead-name {
   font-weight: 700;
   color: #1f1f1f;
}

.lead-property {
   font-size: .9rem;
   color: #8f8f8f;
}

.lead-value {
   font-weight: 700;
   color: #0f172a;
}

/* PROPERTIES */
.properties-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
   gap: 24px;
   margin-top: 22px;
}

.property-card {
   background: #fff;
   border-radius: 30px;
   overflow: hidden;
   box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .04);
   border: 1px solid #f6f6f6;
   transition: .15s;
}

.property-card:hover {
   border-color: #0f172a;
   transform: translateY(-2px);
}

.property-img {
   height: 150px;
   background: #eaeef3;
   display: flex;
   align-items: center;
   justify-content: center;
   color: #0f172a;
   font-size: 2.8rem;
}

.property-detail {
   padding: 20px;
}

.property-title {
   font-weight: 700;
   font-size: 1.1rem;
}

.property-price {
   color: #0f172a;
   font-weight: 800;
   margin-top: 8px;
}

/* ============================================================
   TABLE STYLES
   ============================================================ */
.data-table-wrapper {
   overflow-x: auto;
   border-radius: 24px;
   background: #fff;
   box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .04);
   border: 1px solid #f1f1f1;
}

.data-table {
   width: 100%;
   border-collapse: collapse;
}

.data-table thead {
   background: #fafafa;
}

.data-table th {
   padding: 16px 20px;
   text-align: left;
   font-weight: 600;
   color: #666;
   font-size: .9rem;
   text-transform: uppercase;
   letter-spacing: .5px;
   border-bottom: 2px solid #f0f0f0;
   white-space: nowrap;
}

.data-table td {
   padding: 16px 20px;
   border-bottom: 1px solid #f5f5f5;
   color: #333;
   font-size: .95rem;
}

.data-table tbody tr {
   transition: background .1s;
}

.data-table tbody tr:hover {
   background: #fff8f7;
}

.data-table tbody tr:last-child td {
   border-bottom: none;
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
   display: inline-block;
   padding: 6px 14px;
   border-radius: 30px;
   font-size: .8rem;
   font-weight: 600;
   letter-spacing: .3px;
}

.badge-new {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-contacted {
   background: #fff3e0;
   color: #e65100;
}

.badge-qualified {
   background: #e8f5e9;
   color: #2e7d32;
}

.badge-proposal {
   background: #f3e5f5;
   color: #7b1fa2;
}

.badge-negotiation {
   background: #fff8e1;
   color: #f57f17;
}

.badge-won {
   background: #e8f5e9;
   color: #1b5e20;
}

.badge-lost {
   background: #fce4ec;
   color: #c62828;
}

.badge-available {
   background: #e8f5e9;
   color: #2e7d32;
}

.badge-under_contract {
   background: #fff3e0;
   color: #e65100;
}

.badge-sold {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-rented {
   background: #f3e5f5;
   color: #7b1fa2;
}

.badge-prospecting {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-qualification {
   background: #fff3e0;
   color: #e65100;
}

.badge-closed_won {
   background: #e8f5e9;
   color: #1b5e20;
}

.badge-closed_lost {
   background: #fce4ec;
   color: #c62828;
}

.badge-low {
   background: #e8f5e9;
   color: #2e7d32;
}

.badge-medium {
   background: #fff3e0;
   color: #e65100;
}

.badge-high {
   background: #fff8e1;
   color: #f57f17;
}

.badge-urgent {
   background: #fce4ec;
   color: #c62828;
}

.badge-pending {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-in_progress {
   background: #fff3e0;
   color: #e65100;
}

.badge-completed {
   background: #e8f5e9;
   color: #1b5e20;
}

.badge-cancelled {
   background: #f5f5f5;
   color: #757575;
}

.badge-admin {
   background: #fce4ec;
   color: #c62828;
}

.badge-manager {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-agent {
   background: #e8f5e9;
   color: #2e7d32;
}

.badge-active {
   background: #e8f5e9;
   color: #1b5e20;
}

.badge-inactive {
   background: #f5f5f5;
   color: #757575;
}

.badge-buyer {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-seller {
   background: #fff3e0;
   color: #e65100;
}

.badge-tenant {
   background: #f3e5f5;
   color: #7b1fa2;
}

.badge-landlord {
   background: #e8f5e9;
   color: #2e7d32;
}

.badge-investor {
   background: #fff8e1;
   color: #f57f17;
}

.badge-other {
   background: #f5f5f5;
   color: #757575;
}

.badge-residential {
   background: #e3f2fd;
   color: #1565c0;
}

.badge-commercial {
   background: #fff3e0;
   color: #e65100;
}

.badge-land {
   background: #e8f5e9;
   color: #2e7d32;
}

.badge-industrial {
   background: #f5f5f5;
   color: #757575;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 12px 24px;
   border: none;
   border-radius: 16px;
   font-size: .95rem;
   font-weight: 600;
   cursor: pointer;
   transition: all .15s;
   text-decoration: none;
}

.btn-primary {
   background: #e31b23;
   color: #fff;
   box-shadow: 0 6px 16px -4px rgba(227, 27, 35, .3);
}

.btn-primary:hover {
   background: #c4161d;
   box-shadow: 0 8px 20px -4px rgba(227, 27, 35, .4);
   transform: translateY(-1px);
}

.btn-secondary {
   background: #f7f7f7;
   color: #333;
   border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
   background: #eee;
}

.btn-danger {
   background: #fce4ec;
   color: #c62828;
}

.btn-danger:hover {
   background: #f8bbd0;
}

.btn-sm {
   padding: 8px 16px;
   font-size: .85rem;
   border-radius: 12px;
}

.btn-icon {
   width: 40px;
   height: 40px;
   padding: 0;
   border-radius: 14px;
   display: flex;
   align-items: center;
   justify-content: center;
}

/* ============================================================
   RIGHT OVERLAY SIDEBAR DRAWER MODAL
   ============================================================ */
.modal-overlay {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(15, 23, 42, 0.48);
   backdrop-filter: blur(6px);
   -webkit-backdrop-filter: blur(6px);
   z-index: 2500;
   display: flex;
   justify-content: flex-end;
   align-items: stretch;
   padding: 0;
   opacity: 0;
   pointer-events: none;
   transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   overflow: hidden;
}

.modal-overlay.active {
   display: flex;
   opacity: 1;
   pointer-events: auto;
}

.modal {
   position: relative;
   z-index: 2501;
   background: #ffffff;
   border-radius: 28px 0 0 28px;
   width: min(680px, 94vw);
   max-width: 100%;
   height: 100vh;
   max-height: 100vh;
   display: flex;
   flex-direction: column;
   box-shadow: -16px 0 48px rgba(15, 23, 42, 0.22);
   border-left: 1px solid #e2e8f0;
   transform: translateX(100%);
   transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
   overflow: hidden;
   margin: 0;
   padding: 0;
   animation: none;
}

.modal-overlay.active .modal {
   transform: translateX(0);
}

.modal-header {
   padding: 24px 28px;
   display: flex;
   justify-content: space-between;
   align-items: center;
   border-bottom: 1px solid #f1f5f9;
   background: #ffffff;
   flex-shrink: 0;
   position: sticky;
   top: 0;
   z-index: 10;
}

.modal-header h2 {
   font-size: 1.35rem;
   font-weight: 800;
   color: #0f172a;
   letter-spacing: -0.01em;
   margin: 0;
}

.modal-close {
   width: 40px;
   height: 40px;
   border: 1px solid #e2e8f0;
   background: #f8fafc;
   border-radius: 12px;
   font-size: 1.25rem;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   color: #64748b;
   transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
   flex-shrink: 0;
}

.modal-close:hover {
   background: #0f172a;
   color: #ffffff;
   border-color: #0f172a;
   transform: rotate(90deg);
}

.modal-body {
   padding: 28px;
   overflow-y: auto;
   flex: 1;
   display: flex;
   flex-direction: column;
}

.modal-body::-webkit-scrollbar {
   width: 5px;
}

.modal-body::-webkit-scrollbar-thumb {
   background: #cbd5e1;
   border-radius: 999px;
}

@media (max-width: 640px) {
   .modal {
      width: 100vw;
      border-radius: 0;
   }
   .modal-header {
      padding: 18px 20px;
   }
   .modal-body {
      padding: 20px;
   }
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
   margin-bottom: 20px;
}

.form-label {
   display: block;
   font-weight: 600;
   color: #444;
   margin-bottom: 8px;
   font-size: .9rem;
}

.form-control {
   width: 100%;
   padding: 14px 18px;
   border: 2px solid #eee;
   border-radius: 16px;
   font-size: 1rem;
   transition: border-color .15s;
   background: #fafafa;
}

.form-control:focus {
   outline: none;
   border-color: #e31b23;
   background: #fff;
}

select.form-control {
   appearance: none;
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 16px center;
   padding-right: 40px;
}

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

.form-row {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 16px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   flex-wrap: wrap;
   gap: 16px;
   margin-bottom: 28px;
}

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

.toolbar-right {
   display: flex;
   align-items: center;
   gap: 12px;
}

.filter-select {
   padding: 10px 16px;
   border: 2px solid #eee;
   border-radius: 14px;
   font-size: .9rem;
   background: #fff;
   cursor: pointer;
   appearance: none;
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 12px center;
   padding-right: 32px;
}

.filter-select:focus {
   outline: none;
   border-color: #e31b23;
}

.search-input {
   padding: 10px 16px;
   border: 2px solid #eee;
   border-radius: 14px;
   font-size: .9rem;
   width: 240px;
   background: #fff;
}

.search-input:focus {
   outline: none;
   border-color: #e31b23;
}

/* ============================================================
   KANBAN / PIPELINE
   ============================================================ */
.pipeline-container {
   display: flex;
   gap: 20px;
   overflow-x: auto;
   padding-bottom: 20px;
}

.pipeline-column {
   min-width: 280px;
   flex: 1;
   background: #fafafa;
   border-radius: 24px;
   padding: 20px;
}

.pipeline-column-header {
   font-weight: 700;
   font-size: 1.1rem;
   color: #333;
   margin-bottom: 16px;
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.pipeline-count {
   background: #0f172a;
   color: #fff;
   width: 28px;
   height: 28px;
   border-radius: 10px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: .8rem;
   font-weight: 700;
}

.pipeline-card {
   background: #fff;
   border-radius: 20px;
   padding: 18px;
   margin-bottom: 12px;
   box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .04);
   border: 1px solid #f0f0f0;
   cursor: pointer;
   transition: .15s;
}

.pipeline-card:hover {
   border-color: #0f172a;
   transform: translateY(-1px);
}

.pipeline-card-title {
   font-weight: 700;
   color: #1d1d1d;
   margin-bottom: 8px;
}

.pipeline-card-meta {
   font-size: .85rem;
   color: #888;
   display: flex;
   gap: 12px;
   align-items: center;
}

.pipeline-card-value {
   font-weight: 700;
   color: #0f172a;
   font-size: 1.1rem;
   margin-top: 10px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
   display: flex;
   gap: 4px;
   background: #f5f5f5;
   border-radius: 18px;
   padding: 4px;
   margin-bottom: 24px;
   width: fit-content;
}

.tab {
   padding: 10px 20px;
   border-radius: 14px;
   cursor: pointer;
   font-weight: 500;
   font-size: .9rem;
   color: #666;
   transition: .15s;
   border: none;
   background: transparent;
}

.tab.active {
   background: #0f172a;
   color: #fff;
   box-shadow: 0 4px 12px -3px rgba(15, 23, 42, .3);
}

.tab:hover:not(.active) {
   color: #0f172a;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
   position: fixed;
   top: 24px;
   right: 24px;
   z-index: 2000;
   display: flex;
   flex-direction: column;
   gap: 12px;
}

.toast {
   padding: 16px 24px;
   border-radius: 18px;
   color: #fff;
   font-weight: 600;
   font-size: .95rem;
   box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .2);
   animation: toastIn .3s ease;
   display: flex;
   align-items: center;
   gap: 10px;
}

.toast-success {
   background: #2e7d32;
}

.toast-error {
   background: #c62828;
}

.toast-info {
   background: #1565c0;
}

@keyframes toastIn {
   from {
      opacity: 0;
      transform: translateX(40px);
   }

   to {
      opacity: 1;
      transform: translateX(0);
   }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-container {
   width: 100%;
   max-width: 440px;
}

.login-card {
   background: rgba(255, 255, 255, .95);
   backdrop-filter: blur(20px);
   border-radius: 36px;
   padding: 48px 40px;
   box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .4);
}

.login-logo {
   text-align: center;
   margin-bottom: 36px;
}

.login-logo .logo-icon {
   margin: 0 auto 16px;
   width: 64px;
   height: 64px;
   font-size: 2rem;
   border-radius: 22px;
}

.login-logo h1 {
   font-size: 2rem;
   font-weight: 700;
   color: #1d1d1d;
   letter-spacing: -.5px;
}

.login-logo p {
   color: #888;
   margin-top: 6px;
   font-size: .95rem;
}

.login-error {
   background: #fce4ec;
   color: #c62828;
   padding: 14px 18px;
   border-radius: 14px;
   margin-bottom: 20px;
   font-weight: 500;
   font-size: .9rem;
   display: flex;
   align-items: center;
   gap: 8px;
}

.login-btn {
   width: 100%;
   padding: 16px;
   font-size: 1.1rem;
   margin-top: 8px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
   text-align: center;
   padding: 60px 20px;
   color: #888;
}

.empty-state i {
   font-size: 4rem;
   color: #ddd;
   margin-bottom: 16px;
   display: block;
}

.empty-state h3 {
   font-weight: 700;
   color: #aaa;
   margin-bottom: 8px;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-card {
   background: #fff;
   border-radius: 30px;
   padding: 36px;
   box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .04);
   border: 1px solid #f1f1f1;
   max-width: 700px;
}

.settings-card h2 {
   font-size: 1.4rem;
   font-weight: 700;
   color: #1d1d1d;
   margin-bottom: 28px;
   padding-bottom: 16px;
   border-bottom: 2px solid #f0f0f0;
}

/* ============================================================
   USER CARDS GRID
   ============================================================ */
.users-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: 24px;
}

.user-card {
   background: #fff;
   border-radius: 28px;
   padding: 28px;
   box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .04);
   border: 1px solid #f1f1f1;
   text-align: center;
   transition: .15s;
}

.user-card:hover {
   border-color: #e31b23;
   transform: translateY(-2px);
}

.user-card .avatar {
   width: 72px;
   height: 72px;
   font-size: 1.6rem;
   border-radius: 24px;
   margin: 0 auto 16px;
}

.user-card .user-card-name {
   font-weight: 700;
   font-size: 1.15rem;
   color: #1d1d1d;
}

.user-card .user-card-email {
   color: #888;
   font-size: .9rem;
   margin: 4px 0 12px;
}

.user-card-actions {
   display: flex;
   gap: 8px;
   justify-content: center;
   margin-top: 16px;
}

/* ============================================================
   TAGS / PILLS
   ============================================================ */
.tag-pill {
   display: inline-flex;
   align-items: center;
   gap: 4px;
   padding: 4px 12px;
   border-radius: 20px;
   font-size: .75rem;
   font-weight: 600;
   line-height: 1.4;
   white-space: nowrap;
}

.tag-pill .remove-tag {
   cursor: pointer;
   opacity: .6;
   font-size: .85rem;
}

.tag-pill .remove-tag:hover {
   opacity: 1;
}

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

.tag-selector {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   padding: 12px 0;
}

.tag-option {
   cursor: pointer;
   border: 2px solid transparent;
   transition: .15s;
}

.tag-option:hover {
   border-color: rgba(0, 0, 0, .15);
   transform: scale(1.05);
}

.tag-option.selected {
   border-color: #333;
   box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* ============================================================
   LEAD TIMELINE
   ============================================================ */
.timeline {
   padding: 0;
   margin: 0;
   list-style: none;
}

.timeline-item {
   display: flex;
   gap: 16px;
   padding: 16px 0;
   border-bottom: 1px solid #f0f0f0;
   position: relative;
}

.timeline-item:last-child {
   border-bottom: none;
}

.timeline-icon {
   width: 36px;
   height: 36px;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1rem;
   flex-shrink: 0;
}

.timeline-icon.created {
   background: #e3f2fd;
   color: #1565c0;
}

.timeline-icon.updated {
   background: #fff3e0;
   color: #e65100;
}

.timeline-icon.status {
   background: #e8f5e9;
   color: #2e7d32;
}

.timeline-icon.tag {
   background: #f3e5f5;
   color: #7b1fa2;
}

.timeline-icon.note {
   background: #fff8e1;
   color: #f57f17;
}

.timeline-body {
   flex: 1;
}

.timeline-text {
   font-size: .9rem;
   color: #333;
}

.timeline-text strong {
   color: #1d1d1d;
}

.timeline-change {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   font-size: .85rem;
   margin-top: 4px;
}

.timeline-change .old {
   text-decoration: line-through;
   color: #999;
}

.timeline-change .arrow {
   color: #ccc;
}

.timeline-change .new {
   color: #e31b23;
   font-weight: 600;
}

.timeline-time {
   font-size: .8rem;
   color: #aaa;
   margin-top: 4px;
}

/* ============================================================
   CALL / WHATSAPP BUTTONS
   ============================================================ */
.action-btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 36px;
   height: 36px;
   border-radius: 12px;
   border: none;
   cursor: pointer;
   transition: .15s;
   text-decoration: none;
   font-size: 1.1rem;
}

.action-btn:hover {
   transform: scale(1.1);
}

.btn-call {
   background: #e3f2fd;
   color: #1565c0;
}

.btn-call:hover {
   background: #bbdefb;
}

.btn-whatsapp {
   background: #e8f5e9;
   color: #25d366;
}

.btn-whatsapp:hover {
   background: #c8e6c9;
}

.action-group {
   display: flex;
   gap: 6px;
   align-items: center;
}

/* ============================================================
   PLAN BADGE (sidebar)
   ============================================================ */
.plan-badge {
   background: #fef1f0;
   color: #b11a1a;
   padding: 4px 14px;
   border-radius: 20px;
   font-size: .75rem;
   font-weight: 700;
   text-transform: uppercase;
   letter-spacing: .5px;
   display: inline-block;
   margin-top: 8px;
   text-align: center;
}

/* ============================================================
   SETTINGS TABS
   ============================================================ */
.settings-tabs {
   display: flex;
   gap: 0;
   background: #f5f5f5;
   border-radius: 20px;
   padding: 4px;
   margin-bottom: 28px;
   overflow-x: auto;
}

.settings-tab {
   padding: 10px 22px;
   border-radius: 16px;
   cursor: pointer;
   font-weight: 500;
   font-size: .9rem;
   color: #666;
   background: transparent;
   border: none;
   white-space: nowrap;
   transition: .15s;
}

.settings-tab.active {
   background: #0f172a;
   color: #fff;
   box-shadow: 0 4px 12px -3px rgba(15, 23, 42, .3);
}

.settings-tab:hover:not(.active) {
   color: #0f172a;
}

/* ============================================================
   CUSTOM FIELDS EDITOR
   ============================================================ */
.custom-field-row {
   display: flex;
   gap: 12px;
   align-items: center;
   padding: 12px 16px;
   background: #fafafa;
   border-radius: 16px;
   margin-bottom: 8px;
}

.custom-field-row .field-name {
   font-weight: 600;
   flex: 1;
}

.custom-field-row .field-type {
   color: #888;
   font-size: .85rem;
}

/* ============================================================
   SUPER ADMIN (dark theme)
   ============================================================ */
.sa-body {
   background: #0f111a;
}

.sa-sidebar {
   background: #161929;
   border-right: 1px solid #252837;
}

.sa-sidebar .nav-item {
   color: #8892b0;
}

.sa-sidebar .nav-item.active {
   background: linear-gradient(135deg, #e31b23, #ff4757);
   color: #fff;
}

.sa-sidebar .nav-item:hover:not(.active) {
   background: #1d2036;
   color: #e31b23;
}

.sa-sidebar .logo-text {
   color: #fff;
}

.sa-sidebar .user-name {
   color: #fff;
}

.sa-sidebar .user-role {
   color: #8892b0;
}

.sa-sidebar .sidebar-footer {
   border-top: 1px solid #252837;
}

.sa-main {
   background: #0f111a;
}

.sa-main .top-header {
   background: #161929;
   border-bottom: 2px solid #e31b23;
}

.sa-main .page-title {
   color: #fff;
}

.sa-main .header-btn {
   color: #8892b0;
}

.sa-main .header-btn:hover {
   color: #e31b23;
}

.sa-main .dashboard-content {
   background: #0f111a;
}

.sa-card {
   background: #161929;
   border: 1px solid #252837;
   border-radius: 28px;
   padding: 28px;
}

.sa-card h2,
.sa-card h3,
.sa-card h4 {
   color: #fff;
}

.sa-card p,
.sa-card span {
   color: #8892b0;
}

.sa-stat-card {
   background: linear-gradient(135deg, #1d2036, #252837);
   border: 1px solid #252837;
}

.sa-stat-card .value {
   color: #fff;
}

.sa-stat-card h4 {
   color: #8892b0;
}

.sa-table th {
   background: #1d2036;
   color: #8892b0;
   border-bottom: 1px solid #252837;
}

.sa-table td {
   color: #ccd6f6;
   border-bottom: 1px solid #1d2036;
}

.sa-table tbody tr:hover {
   background: #1d2036;
}

.sa-badge-active {
   background: rgba(46, 125, 50, .15);
   color: #4caf50;
}

.sa-badge-suspended {
   background: rgba(198, 40, 40, .15);
   color: #ef5350;
}

.org-card {
   background: #161929;
   border: 1px solid #252837;
   border-radius: 24px;
   padding: 24px;
   transition: .15s;
}

.org-card:hover {
   border-color: #e31b23;
   transform: translateY(-2px);
}

/* ============================================================
   LEAD DETAIL PANEL
   ============================================================ */
.lead-detail-panel {
   background: #fff;
   border-radius: 28px;
   border: 1px solid #f0f0f0;
   overflow: hidden;
}

.lead-detail-header {
   padding: 28px;
   border-bottom: 1px solid #f0f0f0;
   display: flex;
   justify-content: space-between;
   align-items: flex-start;
}

.lead-detail-body {
   padding: 0;
}

.detail-tab-content {
   padding: 24px;
   display: none;
}

.detail-tab-content.active {
   display: block;
}

/* ============================================================
   PHOSPHOR ICON SIZING
   ============================================================ */
.ph {
   font-size: 1.7rem;
}

.nav-item .ph {
   font-size: 1.9rem;
}

.stat-icon .ph {
   font-size: 2.5rem;
}

.header-icon .ph {
   font-size: 1.9rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:1100px) {
   .form-row {
      grid-template-columns: 1fr;
   }
}

@media (max-width:900px) {
   .charts-row { grid-template-columns: 1fr; }
   .db-charts-row { grid-template-columns: 1fr; }
   .db-bottom-grid { grid-template-columns: 1fr; }

   .sidebar.full { width: 250px; }
   .pipeline-container { flex-direction: column; }
   .pipeline-column { min-width: 100%; }
}

@media (max-width:700px) {
   .app-container { border-radius: 28px; }
   .header { padding: 16px; }
   .stats-row { grid-template-columns: 1fr 1fr; }
   .db-kpi-grid { grid-template-columns: 1fr 1fr; }
   .db-greeting-title { font-size: 1.25rem; }
   .db-greeting { flex-direction: column; align-items: flex-start; }
   .db-table th:nth-child(n+4), .db-table td:nth-child(n+4) { display: none; }
   .toolbar { flex-direction: column; align-items: stretch; }
   .search-input { width: 100%; }
}

@media (max-width:520px) {
   .stats-row { grid-template-columns: 1fr; }
   .db-kpi-grid { grid-template-columns: 1fr; }
   .db-insights-row { grid-template-columns: 1fr; }
   .db-kpi-value { font-size: 1.4rem; }
   .header-right .search-box { display: none; }
   .page-title { font-size: 1.5rem; }
   .login-card { padding: 36px 24px; }
   .form-row { grid-template-columns: 1fr; }
}

/* MOBILE BACKDROP & RESPONSIVE DRAWER ENHANCEMENT */
.sidebar-backdrop {
   position: fixed;
   inset: 0;
   background: rgba(15, 23, 42, 0.45);
   backdrop-filter: blur(4px);
   -webkit-backdrop-filter: blur(4px);
   z-index: 999;
   opacity: 0;
   pointer-events: none;
   transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
   opacity: 1;
   pointer-events: auto;
}

@media (max-width: 768px) {
   .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 1000;
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   }

   .sidebar.hide {
      transform: translateX(-100%);
      width: 270px !important;
      opacity: 1;
      pointer-events: auto;
   }

   .sidebar.full {
      transform: translateX(0);
      width: 270px !important;
      box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
   }

   .sidebar.min {
      transform: translateX(-100%);
      width: 270px !important;
   }

   .header {
      padding: 12px 16px;
      min-height: 60px;
   }

   .menu-toggle {
      width: 40px;
      height: 40px;
      font-size: 1.6rem;
      border-radius: 12px;
   }

   .page-title {
      font-size: 1.15rem;
   }

   .header-user-info {
      display: none;
   }
}

/* ============================================================
   EML CRM — AI ASSISTANT WIDGET & DRAWER STYLES
   ============================================================ */
.crm-ai-toggle-btn {
   position: fixed;
   bottom: 24px;
   right: 24px;
   z-index: 9990;
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 10px 18px;
   border-radius: 999px;
   background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
   color: #ffffff;
   font-weight: 700;
   font-size: 0.88rem;
   border: 1px solid rgba(255, 255, 255, 0.2);
   box-shadow: 0 8px 24px rgba(49, 46, 129, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.crm-ai-toggle-btn:hover {
   transform: translateY(-3px) scale(1.02);
   box-shadow: 0 12px 32px rgba(49, 46, 129, 0.5);
   background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
}
.crm-ai-toggle-btn i {
   font-size: 1.15rem;
   color: #818cf8;
}

.crm-ai-drawer-overlay {
   position: fixed;
   top: 0; left: 0; right: 0; bottom: 0;
   z-index: 9995;
   background: rgba(15, 23, 42, 0.4);
   backdrop-filter: blur(4px);
   display: flex;
   justify-content: flex-end;
   opacity: 0;
   pointer-events: none;
   transition: opacity 0.3s ease;
}
.crm-ai-drawer-overlay.active {
   opacity: 1;
   pointer-events: auto;
}
.crm-ai-drawer {
   width: 420px;
   max-width: 90vw;
   height: 100vh;
   background: #ffffff;
   box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
   display: flex;
   flex-direction: column;
   transform: translateX(100%);
   transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.crm-ai-drawer-overlay.active .crm-ai-drawer {
   transform: translateX(0);
}
.crm-ai-header {
   padding: 18px 22px;
   background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
   color: #ffffff;
   display: flex;
   align-items: center;
   justify-content: space-between;
   border-bottom: 1px solid rgba(255, 255, 255, 0.1);
   box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
}
.crm-ai-header-title {
   font-weight: 800;
   font-size: 1.05rem;
   display: flex;
   align-items: center;
   gap: 10px;
   letter-spacing: -0.01em;
}
.crm-ai-header-title i {
   color: #a5b4fc;
   font-size: 1.3rem;
   filter: drop-shadow(0 0 8px rgba(165, 180, 252, 0.6));
   animation: aiSparklePulse 2.5s infinite ease-in-out;
}
.crm-ai-close-btn {
   background: rgba(255, 255, 255, 0.1);
   border: 1px solid rgba(255, 255, 255, 0.15);
   color: #cbd5e1;
   width: 32px;
   height: 32px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1.1rem;
   cursor: pointer;
   transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.crm-ai-close-btn:hover {
   background: rgba(255, 255, 255, 0.25);
   color: #ffffff;
   transform: scale(1.08);
}

.crm-ai-messages {
   flex: 1;
   padding: 20px 22px;
   overflow-y: auto;
   display: flex;
   flex-direction: column;
   gap: 16px;
   background: radial-gradient(circle at 50% 0%, #f1f5f9 0%, #f8fafc 100%);
}
.crm-ai-msg {
   max-width: 86%;
   padding: 13px 18px;
   border-radius: 18px;
   font-size: 0.9rem;
   line-height: 1.6;
   position: relative;
   word-break: break-word;
}
.crm-ai-msg.user {
   align-self: flex-end;
   background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%);
   color: #ffffff;
   border-bottom-right-radius: 4px;
   box-shadow: 0 6px 20px rgba(79, 70, 229, 0.22);
}
.crm-ai-msg.assistant {
   align-self: flex-start;
   background: #ffffff;
   color: #0f172a;
   border: 1px solid #e2e8f0;
   border-bottom-left-radius: 4px;
   box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}
.crm-ai-tool-pill {
   align-self: flex-start;
   font-size: 0.76rem;
   padding: 6px 14px;
   border-radius: 999px;
   background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
   color: #3730a3;
   font-weight: 700;
   display: flex;
   align-items: center;
   gap: 7px;
   border: 1px solid #c7d2fe;
   box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12);
}

.crm-ai-input-wrap {
   padding: 16px 20px;
   background: #ffffff;
   border-top: 1px solid #eef2f6;
   display: flex;
   gap: 10px;
   align-items: center;
   box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.03);
}
.crm-ai-input {
   flex: 1;
   min-height: 44px;
   border-radius: 14px;
   border: 1px solid #cbd5e1;
   padding: 11px 16px;
   font-size: 0.9rem;
   outline: none;
   background: #f8fafc;
   transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.crm-ai-input:focus {
   background: #ffffff;
   border-color: #6366f1;
   box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
.crm-ai-send-btn {
   width: 44px;
   height: 44px;
   border-radius: 14px;
   background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%);
   color: #ffffff;
   border: none;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1.15rem;
   cursor: pointer;
   transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
   box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.crm-ai-send-btn:hover {
   background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
   transform: translateY(-1px) scale(1.03);
   box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

/* ============================================================
   ULTRA-PREMIUM AI THINKING & PROCESSING ANIMATION STYLES
   ============================================================ */
.crm-ai-thinking-box {
   align-self: flex-start;
   display: inline-flex;
   align-items: center;
   gap: 10px;
   padding: 12px 18px;
   border-radius: 16px;
   background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
   border: 1px solid #c7d2fe;
   box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
   border-bottom-left-radius: 4px;
   max-width: 88%;
}

.crm-ai-sparkle-spin {
   font-size: 1.15rem;
   color: #6366f1;
   display: inline-block;
   animation: aiSparklePulse 1.8s infinite ease-in-out;
}

@keyframes aiSparklePulse {
   0% { transform: scale(0.9) rotate(0deg); opacity: 0.7; filter: drop-shadow(0 0 2px #818cf8); }
   50% { transform: scale(1.25) rotate(180deg); opacity: 1; filter: drop-shadow(0 0 8px #6366f1); }
   100% { transform: scale(0.9) rotate(360deg); opacity: 0.7; filter: drop-shadow(0 0 2px #818cf8); }
}

.crm-ai-thinking-text {
   font-size: 0.86rem;
   font-weight: 700;
   background: linear-gradient(90deg, #312e81 0%, #6366f1 50%, #312e81 100%);
   background-size: 200% auto;
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   animation: aiTextShimmer 2.5s infinite linear;
}

@keyframes aiTextShimmer {
   0% { background-position: 0% center; }
   100% { background-position: 200% center; }
}

.crm-ai-dots {
   display: inline-flex;
   align-items: center;
   gap: 4px;
}

.crm-ai-dot {
   width: 6px;
   height: 6px;
   border-radius: 50%;
   background: #6366f1;
   animation: aiDotBounce 1.4s infinite ease-in-out both;
}
.crm-ai-dot:nth-child(1) { animation-delay: 0s; }
.crm-ai-dot:nth-child(2) { animation-delay: 0.2s; }
.crm-ai-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiDotBounce {
   0%, 80%, 100% { transform: translateY(0) scale(0.7); opacity: 0.4; }
   40% { transform: translateY(-5px) scale(1.1); opacity: 1; }
}

/* ============================================================
   ULTRA-PREMIUM VOICE AI CHAT, LISTENING & SPEAKING ANIMATIONS
   ============================================================ */

/* Voice Mode Toggle Button */
.crm-ai-voice-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(129, 140, 248, 0.25) 100%);
    color: #e0e7ff;
    border: 1px solid rgba(199, 210, 254, 0.3);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.crm-ai-voice-toggle:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(129, 140, 248, 0.4) 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.crm-ai-voice-toggle.active {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    border-color: #818cf8;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.5);
}

/* Multi-Language Voice Selector Dropdown */
.crm-voice-lang-select {
    background: rgba(15, 23, 42, 0.6);
    color: #e0e7ff;
    border: 1px solid rgba(199, 210, 254, 0.3);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.crm-voice-lang-select:hover, .crm-voice-lang-select:focus {
    background: rgba(30, 27, 75, 0.85);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}
.crm-voice-lang-select option {
    background: #0f172a;
    color: #ffffff;
    font-weight: 500;
}

/* Quick Mic Dictation Button inside Input Bar */
.crm-ai-mic-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.crm-ai-mic-btn:hover {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #a5b4fc;
}
.crm-ai-mic-btn.listening {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    animation: voiceMicPulse 1.2s infinite ease-in-out;
}

@keyframes voiceMicPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Voice Mode Overlay Panel */
.voice-mode-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
    z-index: 50;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #ffffff;
    border-radius: inherit;
    animation: voiceFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.voice-mode-overlay.active {
    display: flex;
}

@keyframes voiceFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Central Voice Orb & Multi-Ring Ripple Animation */
.voice-orb-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.voice-orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.4);
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.voice-mode-overlay.listening .voice-orb-ring {
    animation: voiceRipple 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
.voice-mode-overlay.listening .voice-orb-ring:nth-child(2) {
    animation-delay: 0.6s;
}
.voice-mode-overlay.listening .voice-orb-ring:nth-child(3) {
    animation-delay: 1.2s;
}

@keyframes voiceRipple {
    0% { transform: scale(0.8); opacity: 0.8; border-color: rgba(129, 140, 248, 0.8); }
    100% { transform: scale(2.2); opacity: 0; border-color: rgba(99, 102, 241, 0); }
}

/* Central Voice Orb Core */
.voice-orb-core {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #ffffff;
    z-index: 2;
    transition: all 0.3s ease;
    cursor: pointer;
}
.voice-mode-overlay.listening .voice-orb-core {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.4);
    animation: orbPulseListening 1.2s infinite ease-in-out;
}
.voice-mode-overlay.speaking .voice-orb-core {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.4);
    animation: orbPulseSpeaking 0.8s infinite ease-in-out alternate;
}

@keyframes orbPulseListening {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
@keyframes orbPulseSpeaking {
    0% { transform: scale(0.96); }
    100% { transform: scale(1.1); }
}

/* Sound Wave & Equalizer Frequency Bars */
.voice-visualizer-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    margin-bottom: 16px;
}
.voice-bar {
    width: 5px;
    height: 10px;
    border-radius: 4px;
    background: rgba(224, 231, 254, 0.4);
    transition: height 0.15s ease;
}
.voice-mode-overlay.listening .voice-bar {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
    animation: voiceBarBounce 0.8s infinite ease-in-out alternate;
}
.voice-mode-overlay.speaking .voice-bar {
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
    animation: voiceBarBounce 0.5s infinite ease-in-out alternate;
}
.voice-bar:nth-child(1) { animation-delay: 0.1s; }
.voice-bar:nth-child(2) { animation-delay: 0.25s; }
.voice-bar:nth-child(3) { animation-delay: 0.4s; }
.voice-bar:nth-child(4) { animation-delay: 0.2s; }
.voice-bar:nth-child(5) { animation-delay: 0.35s; }

@keyframes voiceBarBounce {
    0% { height: 8px; }
    100% { height: 34px; }
}

/* Status Label & Live Transcript Preview */
.voice-status-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e0e7ff;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    text-align: center;
}
.voice-live-preview {
    max-width: 90%;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.95rem;
    color: #cbd5e1;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
    word-break: break-word;
}
.voice-live-preview.active {
    color: #ffffff;
    border-color: rgba(129, 140, 248, 0.4);
    background: rgba(99, 102, 241, 0.15);
}

/* Bottom Control Toolbar */
.voice-controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.voice-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.voice-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}
.voice-control-btn.active-red {
    background: #dc2626;
    border-color: #ef4444;
}
.voice-control-btn.close-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}
.voice-control-btn.close-btn:hover {
    background: #dc2626;
    color: #ffffff;
}