/* ============================================================
   BIC.al CRM - Stilet kryesore
   ============================================================ */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-sm: 6px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-100);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-brand .logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #4338ca);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
}
.sidebar-brand .name {
    font-weight: 700; color: white; font-size: 15px;
}
.sidebar-brand .sub {
    font-size: 11px; color: var(--gray-400);
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #cbd5e1;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: white;
    text-decoration: none;
}
.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: white;
}
.sidebar-nav .nav-section {
    padding: 14px 12px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 600;
}

.sidebar-foot {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: var(--gray-400);
}

.main {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}
.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.topbar .user-info .avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 13px;
}
.topbar .user-info .name { font-weight: 600; }
.topbar .user-info .role { color: var(--gray-500); font-size: 12px; }

.content {
    padding: 24px;
    flex: 1;
}

/* ============== Cards ============== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}
.card-body {
    padding: 20px;
}
.card-body.p-0 { padding: 0; }

/* ============== Stats cards ============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary);
}
.stat-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 6px;
}
.stat-card .value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
}
.stat-card .sub {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}
.stat-card.green { border-left-color: var(--success); }
.stat-card.green .value { color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.orange .value { color: var(--warning); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.red .value { color: var(--danger); }
.stat-card.cyan { border-left-color: var(--info); }
.stat-card.cyan .value { color: var(--info); }

/* ============== Forms ============== */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 5px;
}
.form-group label .req { color: var(--danger); }

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

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=tel],
input[type=date],
input[type=search],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-900);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea { resize: vertical; min-height: 80px; }

.help { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ============== Buttons ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: white; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 9px; }

/* ============== Tables ============== */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}
.table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-600);
    font-weight: 600;
    background: var(--gray-50);
    white-space: nowrap;
}
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--gray-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .btn { margin-left: 4px; }

/* ============== Badges ============== */
.badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #cffafe; color: #155e75; }
.badge-default { background: var(--gray-200); color: var(--gray-700); }

/* ============== Alerts ============== */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: #cffafe; color: #155e75; border: 1px solid #67e8f9; }

/* ============== Auth (login/install) ============== */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #4338ca 100%);
    padding: 20px;
}
.auth-card {
    background: white;
    padding: 36px 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 410px;
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .auth-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), #4338ca);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 20px;
    margin: 0 auto 12px;
}
.auth-brand h1 {
    font-size: 20px;
    color: var(--gray-900);
    margin-bottom: 4px;
}

/* ============== Toolbar / filters ============== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar select, .toolbar input { min-width: 130px; }

.filters-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}
@media (max-width: 900px) {
    .filters-form { grid-template-columns: 1fr 1fr; }
}

/* ============== Helpers ============== */
.muted { color: var(--gray-500); }
.small { font-size: 12px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.right { float: right; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none; }

code {
    background: var(--gray-100);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============== Details / sections ============== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.detail-item .lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 3px;
}
.detail-item .val {
    font-size: 14px;
    color: var(--gray-900);
    word-break: break-word;
}

.activity-list { list-style: none; }
.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}
.activity-item:last-child { border-bottom: 0; }
.activity-icon {
    width: 36px; height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.activity-icon.meeting { background: #fef3c7; color: #92400e; }
.activity-body { flex: 1; }
.activity-meta { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.activity-notes { margin-top: 5px; font-size: 14px; color: var(--gray-700); }

/* ============== Mobile ============== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-block; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-700);
}

/* Print */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 1px solid var(--gray-300); }
}

/* ============================================================
   Modern Dashboard (v2)
   ============================================================ */
.dash { display: flex; flex-direction: column; gap: 18px; }

.dash-hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    color: white; padding: 20px 24px; border-radius: 12px;
    box-shadow: 0 10px 25px -10px rgba(37,99,235,.45);
}
.dash-hero .hello { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; }
.dash-hero .hello-sub { font-size: 13px; color: rgba(255,255,255,.78); margin-top: 2px; }
.dash-hero .hero-actions { display: flex; gap: 8px; }
.btn-hero {
    background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.18);
    padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: background .15s, transform .15s;
}
.btn-hero:hover { background: rgba(255,255,255,.22); text-decoration: none; transform: translateY(-1px); }
.btn-hero-primary { background: white; color: #1e3a8a; border-color: white; }
.btn-hero-primary:hover { background: #f1f5f9; color: #1e3a8a; }

/* KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.kpi {
    position: relative;
    background: white; border-radius: 12px; padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px -8px rgba(15,23,42,.12);
    display: flex; align-items: flex-start; gap: 14px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,.07), 0 12px 24px -10px rgba(15,23,42,.18); }
.kpi::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0;
    width: 80px; opacity: .08; pointer-events: none;
    background: radial-gradient(circle at top right, currentColor, transparent 70%);
}
.kpi-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: white; flex-shrink: 0;
}
.kpi-body { flex: 1; min-width: 0; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-500); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--gray-900); margin-top: 4px; letter-spacing: -0.5px; line-height: 1.1; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; flex-wrap: wrap; }
.kpi-foot-sub { color: var(--gray-500); }

.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }
.trend-flat { color: var(--gray-500); font-weight: 600; }

.kpi-blue   { color: #2563eb; } .kpi-blue   .kpi-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-green  { color: #16a34a; } .kpi-green  .kpi-icon { background: linear-gradient(135deg, #22c55e, #15803d); }
.kpi-violet { color: #7c3aed; } .kpi-violet .kpi-icon { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.kpi-orange { color: #ea580c; } .kpi-orange .kpi-icon { background: linear-gradient(135deg, #fb923c, #ea580c); }

/* Dashboard rows / cards */
.dash-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.dash-row-2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .dash-row, .dash-row-2 { grid-template-columns: 1fr; } }

.dash-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px -8px rgba(15,23,42,.10);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.dash-card-head {
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}
.dash-card-head h3 {
    font-size: 14px; font-weight: 700; color: var(--gray-900);
    text-transform: uppercase; letter-spacing: .6px;
}
.muted-12 { font-size: 12px; color: var(--gray-500); }
.link-12 { font-size: 12px; font-weight: 600; color: var(--primary); }
.link-12:hover { text-decoration: underline; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 18px; flex-wrap: wrap; }
.donut {
    width: 140px; height: 140px; border-radius: 50%;
    position: relative; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.donut.donut-empty { background: var(--gray-200); }
.donut-hole {
    position: absolute; inset: 18px; background: white; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px var(--gray-100);
}
.donut-num { font-size: 26px; font-weight: 700; color: var(--gray-900); line-height: 1; }
.donut-cap { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.donut-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 140px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; color: var(--gray-700); }
.donut-legend b { margin-left: auto; color: var(--gray-900); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dot-warning { background: var(--warning); }
.dot-info    { background: var(--info); }
.dot-success { background: var(--success); }
.dot-danger  { background: var(--danger); }

/* Funnel */
.funnel { padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.funnel-label { font-size: 12px; color: var(--gray-600); font-weight: 600; }
.funnel-track { background: var(--gray-100); border-radius: 6px; height: 26px; overflow: hidden; }
.funnel-bar {
    height: 100%; display: flex; align-items: center; justify-content: flex-end;
    color: white; font-size: 12px; font-weight: 700; padding: 0 8px;
    border-radius: 6px;
    transition: width .4s ease;
}
.funnel-foot {
    display: flex; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--gray-100);
    margin-top: 4px; background: var(--gray-50);
}
.funnel-foot > div { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 700; color: var(--gray-900); }

/* Bars chart */
.bars {
    display: flex; align-items: flex-end; gap: 6px;
    padding: 18px; height: 220px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.bar {
    width: 100%; max-width: 24px;
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    border-radius: 4px 4px 0 0;
    margin-top: auto;
    transition: height .4s ease, transform .15s;
    min-height: 2px;
}
.bar-col:hover .bar { transform: scaleY(1.04); transform-origin: bottom; }
.bar-label { font-size: 10px; color: var(--gray-500); white-space: nowrap; }

/* Activity feed */
.activity-feed { list-style: none; padding: 8px 0; margin: 0; }
.activity-feed li {
    display: flex; gap: 12px; padding: 12px 18px;
    border-bottom: 1px solid var(--gray-100);
    align-items: flex-start;
}
.activity-feed li:last-child { border-bottom: 0; }
.act-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px;
}
.act-call { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.act-meet { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.act-body { flex: 1; min-width: 0; }
.act-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.act-title a { color: var(--gray-900); }
.act-title a:hover { color: var(--primary); }
.act-notes { font-size: 13px; color: var(--gray-600); margin-top: 2px; }
.act-meta { font-size: 11px; color: var(--gray-500); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }

/* Top clients */
.top-list { list-style: none; padding: 8px 0; margin: 0; }
.top-list li {
    display: flex; align-items: center; gap: 12px; padding: 10px 18px;
    border-bottom: 1px solid var(--gray-100);
}
.top-list li:last-child { border-bottom: 0; }
.top-av {
    width: 36px; height: 36px; border-radius: 50%;
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.top-body { flex: 1; min-width: 0; }
.top-name { font-size: 14px; font-weight: 600; color: var(--gray-900); display: block; }
.top-name:hover { color: var(--primary); }
.top-meta { margin-top: 4px; }
.top-val { font-weight: 700; color: var(--gray-900); font-size: 14px; white-space: nowrap; }

/* Modern table */
.table-modern thead th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--gray-500); background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200); padding: 12px 14px;
}
.table-modern tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr:hover { background: var(--gray-50); }
.cell-business { display: flex; align-items: center; gap: 10px; }
.ce-av {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.empty { padding: 28px 20px; text-align: center; color: var(--gray-500); font-size: 13px; }

@media (max-width: 720px) {
    .dash-hero { padding: 16px; }
    .dash-hero .hello { font-size: 18px; }
    .funnel-row { grid-template-columns: 90px 1fr; }
    .bars { height: 160px; }
    .bar-label { display: none; }
}

/* ============================================================
   v3 — Sidebar redesign + Bootstrap Icons + page chrome
   ============================================================ */

/* ---- Sidebar (override) ---- */
.sidebar {
    width: 248px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 11px;
    position: relative;
}
.sidebar-brand .logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px;
    box-shadow: 0 6px 16px -4px rgba(124,58,237,.45);
}
.sidebar-brand .name { font-weight: 700; color: white; font-size: 15px; letter-spacing: -0.2px; }
.sidebar-brand .sub { font-size: 11px; color: #94a3b8; }
.sidebar-close {
    display: none;
    margin-left: auto;
    background: rgba(255,255,255,.08);
    border: none;
    color: #e2e8f0;
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.sidebar-nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-section {
    padding: 14px 12px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #cbd5e1;
    border-radius: 9px;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s, transform .1s;
    position: relative;
}
.sidebar-nav .nav-link i { font-size: 18px; width: 22px; text-align: center; opacity: .85; }
.sidebar-nav .nav-link span { flex: 1; }
.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.05);
    color: white;
}
.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(37,99,235,.25), rgba(124,58,237,.18));
    color: white;
    box-shadow: inset 3px 0 0 #3b82f6;
}
.sidebar-nav .nav-link.active i { opacity: 1; color: #93c5fd; }
.sidebar-nav .nav-caret { font-size: 12px !important; opacity: .6; }
.sidebar-nav .nav-logout { color: #fca5a5; }
.sidebar-nav .nav-logout:hover { background: rgba(239,68,68,.12); color: #fecaca; }

.sidebar-foot {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.18);
}
.sf-user { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sf-av {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #f472b6, #7c3aed);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.sf-meta { min-width: 0; flex: 1; }
.sf-name { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-role { font-size: 11px; color: #94a3b8; }
.sf-version { font-size: 10px; color: #64748b; text-align: center; text-transform: uppercase; letter-spacing: .5px; }

/* ---- Topbar (override) ---- */
.topbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
    display: none;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    width: 38px; height: 38px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 18px;
    align-items: center;
    justify-content: center;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-500); min-width: 0; overflow: hidden; }
.breadcrumb a { color: var(--gray-500); text-decoration: none; display: inline-flex; align-items: center; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--gray-900); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb .sep { font-size: 10px; opacity: .5; }
.breadcrumb i.bi-house-door-fill { font-size: 16px; }

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 999px;
}
.user-chip .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.user-chip .name { font-size: 13px; font-weight: 600; color: var(--gray-900); line-height: 1.1; }
.user-chip .role { font-size: 11px; color: var(--gray-500); }

/* ---- Page head ---- */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ph-left { display: flex; align-items: center; gap: 14px; }
.ph-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 20px -8px rgba(124,58,237,.6);
}
.ph-title { font-size: 20px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.3px; }
.ph-sub { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- Buttons (refresh) ---- */
.btn { gap: 7px; }
.btn i.bi { font-size: 14px; }
.btn-ghost {
    background: white; color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    padding: 0;
    transition: all .15s;
}
.btn-icon:hover { background: var(--primary); color: white; border-color: var(--primary); text-decoration: none; }
.btn-icon-danger:hover { background: var(--danger); border-color: var(--danger); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .actions form { display: inline-flex; }

/* ---- Card modern ---- */
.card-modern {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px -8px rgba(15,23,42,.10);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--gray-100);
}

/* ---- Filter bar ---- */
.filter-bar { padding: 16px 18px; }
.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}
.filters-grid .flex-grow { width: 100%; }
.filter-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.check-inline {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--gray-700); cursor: pointer;
}
@media (max-width: 900px) {
    .filters-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Input with icon ---- */
.input-icon { position: relative; }
.input-icon > i.bi {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 15px; pointer-events: none;
}
.input-icon input,
.input-icon select,
.input-icon textarea {
    padding-left: 36px;
}

/* ---- Form sections ---- */
.form-section {
    display: flex; align-items: center; gap: 8px;
    margin: 20px 0 14px;
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--gray-700);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.form-section:first-of-type { margin-top: 0; }
.form-section i.bi { color: var(--primary); font-size: 15px; }
.form-foot {
    display: flex; gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-100);
}
.form-sep { margin: 22px 0 0; border: none; border-top: 1px solid var(--gray-100); }
.form-group-end { display: flex; align-items: flex-end; }
.help { display: inline-flex; align-items: center; gap: 5px; }
.help i.bi { color: var(--info); }

/* ---- Switch ---- */
.switch {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 8px;
}
.switch input { display: none; }
.switch-slider {
    width: 44px; height: 24px; background: var(--gray-300);
    border-radius: 999px; position: relative;
    transition: background .2s;
}
.switch-slider::before {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; background: white; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { opacity: .5; cursor: not-allowed; }
.switch-text { font-size: 13px; color: var(--gray-700); font-weight: 500; }

/* ---- Empty state ---- */
.empty {
    padding: 50px 20px; text-align: center; color: var(--gray-500);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-icon { font-size: 42px; color: var(--gray-300); }

/* ---- Alerts with icons (refresh) ---- */
.alert {
    display: flex; align-items: center; gap: 10px;
    border-radius: 10px;
    padding: 12px 16px;
    transition: opacity .4s, transform .4s;
}
.alert i.bi { font-size: 18px; flex-shrink: 0; }
.alert-fade { opacity: 0; transform: translateY(-6px); pointer-events: none; }

/* ---- Sidebar backdrop ---- */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.55);
    z-index: 90;
    backdrop-filter: blur(2px);
}

/* ---- Client view ---- */
.client-hero {
    display: flex; align-items: center; gap: 18px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
    border-radius: 14px;
    border: 1px solid var(--gray-100);
    margin-bottom: 16px;
    flex-wrap: wrap;
    box-shadow: 0 4px 18px -10px rgba(15,23,42,.1);
}
.client-hero-av {
    width: 64px; height: 64px; border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white; font-size: 26px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 10px 24px -10px rgba(37,99,235,.6);
}
.client-hero-body { flex: 1; min-width: 200px; }
.client-hero-body h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.3px; }
.client-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: white; border: 1px solid var(--gray-200);
    padding: 4px 10px; border-radius: 999px;
    font-size: 12px; color: var(--gray-700); text-decoration: none;
}
.chip:hover { background: var(--gray-50); text-decoration: none; }
.chip i.bi { color: var(--primary); }
.client-hero-price { text-align: right; }
.client-hero-price .ch-price { font-size: 22px; font-weight: 700; color: var(--success); letter-spacing: -0.3px; }

.cv-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}
@media (max-width: 900px) { .cv-grid { grid-template-columns: 1fr; } }
.cv-side { display: flex; flex-direction: column; gap: 14px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    padding: 18px;
}
.detail-item .lbl {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--gray-500); font-weight: 600; margin-bottom: 3px;
}
.detail-item .lbl i.bi { font-size: 12px; color: var(--gray-400); }
.detail-item .val { font-size: 14px; color: var(--gray-900); word-break: break-word; }

.comments-box {
    margin: 0 18px 18px;
    border: 1px solid var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
}
.comments-head {
    background: var(--gray-50);
    padding: 8px 12px;
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
    color: var(--gray-600);
    display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid var(--gray-100);
}
.comments-body { padding: 12px; font-size: 14px; color: var(--gray-800); white-space: pre-wrap; }

.quick-form {
    display: flex; gap: 8px; padding: 14px;
}
.quick-form select { flex: 1; }

/* ---- Activity timeline ---- */
.activity-form {
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
    border: 1px dashed #c7d2fe;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.timeline { list-style: none; padding: 8px 0; margin: 0; position: relative; }
.timeline::before {
    content: ''; position: absolute;
    left: 20px; top: 12px; bottom: 12px;
    width: 2px; background: var(--gray-100);
}
.timeline-item {
    display: flex; gap: 14px; padding: 12px 0;
    align-items: flex-start;
    position: relative;
}
.timeline-marker {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
    z-index: 1; box-shadow: 0 0 0 3px white;
    font-size: 16px;
}
.tm-call { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.tm-meet { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-head {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    font-size: 14px; color: var(--gray-900);
}
.timeline-head .muted-12 i.bi { font-size: 11px; margin-right: 1px; }
.timeline-notes {
    margin-top: 6px; font-size: 13px; color: var(--gray-700);
    background: var(--gray-50); padding: 8px 12px; border-radius: 8px;
}
.timeline-del { align-self: center; }

/* ---- Profile ---- */
.profile-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
}
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-card { text-align: center; }
.profile-hero { padding: 28px 20px; border-bottom: 1px solid var(--gray-100); }
.profile-av {
    width: 84px; height: 84px; border-radius: 50%;
    background: linear-gradient(135deg, #f472b6, #7c3aed);
    color: white; font-size: 34px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 14px 30px -12px rgba(124,58,237,.55);
}
.profile-hero h2 { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.profile-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 16px 8px; gap: 10px;
    border-bottom: 1px solid var(--gray-100);
}
.profile-stats > div { text-align: center; }
.ps-v { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.ps-l { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.profile-foot { padding: 12px 18px; font-size: 13px; text-align: left; }

/* ---- Reports tfoot ---- */
.tfoot-total { background: linear-gradient(180deg, #f8fafc, #f1f5f9); font-weight: 700; }
.tfoot-total td { padding: 12px 14px; border-top: 2px solid var(--gray-200); }

/* ---- Code (username) ---- */
.username {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
}

/* ---- Mobile overrides for new sidebar ---- */
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; z-index: 100; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.4); }
    .sidebar.open ~ .sidebar-backdrop,
    body:has(.sidebar.open) .sidebar-backdrop { display: block; }
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .ph-icon { width: 40px; height: 40px; font-size: 18px; }
    .ph-title { font-size: 17px; }
    .user-chip .user-meta { display: none; }
    .breadcrumb a span, .breadcrumb > span { font-size: 12px; }
}
@media (max-width: 600px) {
    .topbar { padding: 10px 14px; }
    .content { padding: 16px; }
    .page-head { padding: 14px; }
    .filters-grid { grid-template-columns: 1fr; }
    .client-hero-price { text-align: left; }
}
