/* =====================================================================
   style.css - આખા CRM નું design
   Colours: Teal (જૂના TikitDesk જેવા). Font: Plus Jakarta Sans + Noto Sans Gujarati/Devanagari
   ===================================================================== */
:root {
    --brand: #008489;
    --brand-dark: #006b6f;
    --brand-soft: rgba(0, 132, 137, .09);
    --gray-50: #f7f8fc;
    --gray-100: #f0f2f7;
    --gray-200: #e4e8f0;
    --gray-300: #c0c7d9;
    --gray-400: #8b92a9;
    --gray-500: #5e6680;
    --gray-900: #1a1f35;
    --success: #10b981; --success-soft: #d1fae5;
    --warning: #f59e0b; --warning-soft: #fef3c7;
    --danger: #ef4444;  --danger-soft: #fee2e2;
    --info: #3b82f6;    --info-soft: #dbeafe;
    --surface: #fff;
    --topbar-h: 60px;
    --sidebar-w: 236px;
    --bottom-h: 64px;
    --radius: 14px;
    --font: 'Plus Jakarta Sans', 'Noto Sans Gujarati', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-font-sans-serif: var(--font);
    --bs-body-font-family: var(--font);
}

html, body { font-family: var(--font); }
body { background: var(--gray-50); color: var(--gray-900); font-size: 14.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
/* ગુજરાતી / હિન્દી અક્ષરો માટે થોડી વધુ line-height */
body.lang-gu, body.lang-hi { line-height: 1.75; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem 1rem; }
.btn-lg { padding: .75rem 1.25rem; font-size: 1rem; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-brand:disabled { background: var(--brand); border-color: var(--brand); opacity: .65; color: #fff; }
.btn-outline-brand { color: var(--brand); border-color: var(--brand); background: transparent; }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.btn-soft { background: var(--gray-100); border-color: var(--gray-100); color: var(--gray-900); }
.btn-soft:hover { background: var(--gray-200); }
.icon-btn { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; font-size: 1.2rem; color: var(--gray-500); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-icon-sm { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--gray-200); padding: .6rem .85rem; font-size: 15px; min-height: 44px; }
textarea.form-control { min-height: 90px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-label { font-weight: 600; font-size: 13px; color: var(--gray-500); margin-bottom: .3rem; }
.form-label .req { color: var(--danger); }
.invalid-msg { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.is-invalid { border-color: var(--danger) !important; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Top bar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 1030; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gray-900); font-weight: 700; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.brand-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch { display: inline-flex; background: var(--gray-100); border-radius: 10px; padding: 3px; }
.lang-switch a { padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--gray-500); text-decoration: none; min-width: 38px; text-align: center; }
.lang-switch a.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.lang-switch-lg { display: flex; }
.lang-switch-lg a { flex: 1; padding: 10px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 6px; border-radius: 12px; }
.user-btn:hover { background: var(--gray-100); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.user-name { font-weight: 700; font-size: 13px; }
.user-role { font-size: 11.5px; color: var(--gray-400); }
.bell-count { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dropdown-menu { border-radius: 12px; border-color: var(--gray-200); box-shadow: 0 10px 30px rgba(26,31,53,.12); }
.notif-menu { width: 340px; max-width: 92vw; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--gray-100); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--gray-100); color: inherit; text-decoration: none; }
.notif-item:hover { background: var(--gray-50); color: inherit; }
.notif-item.unread { background: var(--brand-soft); }
.notif-item .n-title { font-weight: 600; font-size: 13.5px; }
.notif-item .n-time { font-size: 11.5px; color: var(--gray-400); }

/* ---------- Sidebar + layout ---------- */
.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--gray-200); flex-direction: column; justify-content: space-between; padding: 16px 12px; z-index: 1020; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #b8dcde transparent; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb { background: #cfe6e8; border-radius: 10px; }
.side-nav::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--gray-500); font-weight: 600; text-decoration: none; }
.side-link i { font-size: 1.15rem; }
.side-link:hover { background: var(--gray-100); color: var(--gray-900); }
.side-link.active { background: var(--brand-soft); color: var(--brand); }
.side-foot { padding: 10px 14px 0; flex: 0 0 auto; border-top: 1px solid var(--gray-100); margin-top: 8px; }
.main-area { padding-top: var(--topbar-h); min-height: 100vh; }
.page-wrap { padding: 22px 16px calc(var(--bottom-h) + 28px); max-width: 1280px; margin: 0 auto; }
@media (min-width: 992px) {
    .main-area { margin-left: var(--sidebar-w); }
    .page-wrap { padding: 28px 32px 40px; }
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--gray-200); display: flex; z-index: 1030; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--gray-400); text-decoration: none; font-size: 11px; font-weight: 600; }
.bn-item i { font-size: 1.35rem; }
.bn-item.active { color: var(--brand); }
.more-sheet { border-radius: 18px 18px 0 0; height: auto !important; max-height: 85vh; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; border-radius: 14px; background: var(--gray-50); color: var(--gray-900); text-decoration: none; font-weight: 600; font-size: 13px; text-align: center; }
.more-item i { font-size: 1.5rem; color: var(--brand); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--gray-400); font-size: 13.5px; }

/* ---------- Cards ---------- */
.card-soft { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(26,31,53,.03); }
.card-soft .card-h { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-soft .card-h h5 { margin: 0; font-size: 1rem; }
.card-soft .card-b { padding: 20px; }
.stat-card { padding: 18px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,31,53,.08); color: inherit; }
.stat-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-ico.teal { background: var(--brand-soft); color: var(--brand); }
.stat-ico.blue { background: var(--info-soft); color: var(--info); }
.stat-ico.amber { background: var(--warning-soft); color: #b45309; }
.stat-ico.green { background: var(--success-soft); color: #047857; }
.stat-ico.red { background: var(--danger-soft); color: #b91c1c; }
.stat-num { font-size: 1.65rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--gray-500); font-size: 13px; font-weight: 600; }

/* ---------- Badges ---------- */
.badge-soft { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--gray-100); color: var(--gray-500); white-space: nowrap; }
.badge-soft.teal { background: var(--brand-soft); color: var(--brand-dark); }
.badge-soft.green { background: var(--success-soft); color: #047857; }
.badge-soft.red { background: var(--danger-soft); color: #b91c1c; }
.badge-soft.amber { background: var(--warning-soft); color: #92400e; }
.badge-soft.blue { background: var(--info-soft); color: #1d4ed8; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-bar .search-box { position: relative; flex: 1 1 220px; }
.filter-bar .search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.filter-bar .search-box input { padding-left: 38px; }
.filter-bar select { flex: 0 1 170px; }

/* ---------- Data table (mobile પર cards બની જાય) ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--gray-50); color: var(--gray-500); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 700; display: block; color: var(--gray-900); text-decoration: none; }
a.cell-main:hover { color: var(--brand); }
.cell-sub { font-size: 12.5px; color: var(--gray-400); display: block; }
.row-actions { white-space: nowrap; text-align: right; }
@media (max-width: 767.98px) {
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 14px 16px; border-bottom: 8px solid var(--gray-50); }
    .data-table td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .data-table td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--gray-400); text-align: left; flex-shrink: 0; }
    .data-table td.cell-first { display: block; text-align: left; padding-bottom: 8px; }
    .data-table td.cell-first::before { display: none; }
    .data-table td.row-actions { justify-content: flex-end; padding-top: 10px; }
    .data-table td.row-actions::before { display: none; }
}

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--gray-100); color: var(--gray-500); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; }
.pager button { border: 1px solid var(--gray-200); background: var(--surface); border-radius: 9px; min-width: 38px; height: 38px; font-weight: 600; color: var(--gray-500); }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .45; }

/* ---------- Empty / loading ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: 10px; color: var(--gray-300); }
.empty-state h4 { color: var(--gray-500); font-size: 1.05rem; }
.spinner-row { text-align: center; padding: 40px; color: var(--gray-400); }

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 16px; }
.modal-header { border-bottom: 1px solid var(--gray-100); padding: 16px 22px; }
.modal-title { font-weight: 700; font-size: 1.1rem; }
.modal-body { padding: 20px 22px; }
.modal-footer { border-top: 1px solid var(--gray-100); padding: 14px 22px; }
@media (max-width: 575.98px) {
    .modal-dialog { margin: 0; min-height: 100%; align-items: flex-end; display: flex; }
    .modal-content { border-radius: 18px 18px 0 0; width: 100%; max-height: 92vh; }
    .modal-body { overflow-y: auto; }
}

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 70px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast-msg { background: var(--surface); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(26,31,53,.18); min-width: 260px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .2s ease; }
.toast-msg.error { border-left-color: var(--danger); }
.toast-msg.success { border-left-color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Timeline (activity) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: -6px; width: 2px; background: var(--gray-200); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.timeline .t-text { font-weight: 600; }
.timeline .t-meta { font-size: 12px; color: var(--gray-400); }

/* ---------- Detail info grid ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 24px; }
.info-grid .i-label { font-size: 12px; color: var(--gray-400); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.info-grid .i-value { font-weight: 600; word-break: break-word; }

/* ---------- Bar chart (CSS વાળો, library વગર) ---------- */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 46px; background: var(--brand); border-radius: 8px 8px 0 0; min-height: 3px; }
.bar-val { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.bar-label { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.progress { height: 10px; border-radius: 6px; background: var(--gray-100); }
.progress-bar { background: var(--brand); }

/* =====================================================================
   Login / Register (public pages)
   ===================================================================== */
.public-body { background: var(--surface); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; }
.auth-side { flex: 1; background: linear-gradient(145deg, #006b6f 0%, #008489 55%, #14a3a8 100%); color: #fff; padding: 48px; display: none; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 2rem; font-weight: 800; line-height: 1.25; }
.auth-side ul { list-style: none; padding: 0; margin: 24px 0 0; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; opacity: .95; }
.auth-side li i { font-size: 1.2rem; margin-top: 2px; }
.auth-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px 18px; background: var(--gray-50); }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border-radius: 18px; padding: 30px 28px; box-shadow: 0 10px 40px rgba(26,31,53,.08); border: 1px solid var(--gray-200); }
.auth-top { width: 100%; max-width: 460px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
@media (min-width: 992px) { .auth-side { display: flex; } .auth-main { flex: 0 0 540px; } }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 38px; height: 38px; color: var(--gray-400); }

/* Onboarding wizard */
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps .step { flex: 1; height: 6px; border-radius: 4px; background: var(--gray-200); }
.steps .step.done { background: var(--brand); }
.pick-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 480px) { .pick-grid.two { grid-template-columns: 1fr 1fr; } }
.pick { border: 2px solid var(--gray-200); border-radius: 14px; padding: 16px; cursor: pointer; display: flex; gap: 14px; align-items: center; background: var(--surface); text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.pick:hover { border-color: var(--brand); }
.pick.selected { border-color: var(--brand); background: var(--brand-soft); }
.pick .p-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--brand); flex-shrink: 0; }
.pick.selected .p-ico { background: var(--brand); color: #fff; }
.pick .p-title { font-weight: 700; font-size: 1.02rem; display: block; }
.pick .p-sub { font-size: 12.5px; color: var(--gray-500); display: block; line-height: 1.4; }
.pick .p-big { font-size: 1.25rem; font-weight: 800; }

/* Page-level small helpers */
.text-brand { color: var(--brand) !important; }
.fw-800 { font-weight: 800; }
.overdue { color: var(--danger); font-weight: 700; }
.cursor-pointer { cursor: pointer; }

/* ---------- Deals kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 14px; align-items: stretch; min-height: 60vh; scrollbar-width: thin; scrollbar-color: #b8dcde transparent; }
.kanban::-webkit-scrollbar { height: 8px; } .kanban::-webkit-scrollbar-thumb { background: #cfe6e8; border-radius: 10px; } .kanban::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.kcol { flex: 0 0 270px; background: var(--gray-100); border-radius: var(--radius); padding: 10px; min-height: 60vh; transition: background .15s, box-shadow .15s; }
.kcol.over { background: #e3f3f4; box-shadow: inset 0 0 0 2px var(--brand); }
.kcard.dragging { opacity: .45; }
.kcol-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; padding: 4px 6px 10px; }
.kcol-h small { color: var(--gray-500); font-weight: 600; }
.kcard { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: grab; }
.kcard:hover { border-color: var(--brand); }
.kcard .k-title { font-weight: 700; display: block; margin-bottom: 4px; }
.kcard .k-val { color: var(--brand-dark); font-weight: 800; }
@media (max-width: 767.98px) { .kcol { flex-basis: 85vw; } }

/* ---------- row click + confirm modal ---------- */
tr.row-click { cursor: pointer; }
.kcard { cursor: pointer; }
.confirm-box { border: 0; border-radius: 18px; box-shadow: 0 20px 60px rgba(26,31,53,.25); }
.confirm-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 14px; }
.confirm-ico.danger { background: #fde8e8; color: var(--danger); }
.confirm-msg { font-weight: 600; color: var(--gray-900); }
.main-area, .modal-body, .table-responsive { scrollbar-width: thin; scrollbar-color: #cfe6e8 transparent; }

/* ---------- WhatsApp ---------- */
.btn-wa { background: #25d366; color: #fff; border: 0; } .btn-wa:hover { background: #1ebe5b; color: #fff; }
.text-wa { color: #25d366; }
.wa-item { display: block; padding: 12px 14px; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.wa-item:hover { border-color: #25d366; background: #f3fcf6; }
.wa-item b { display: block; margin-bottom: 2px; } .wa-item span { display: block; font-size: .85rem; color: #6b7280; white-space: pre-wrap; }
.item-row { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fafcfc; }

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: .72rem; font-weight: 700; color: #6b7280; padding: 6px 0; text-transform: uppercase; }
.cal-c { min-height: 64px; border: 1px solid #eef0f2; border-radius: 10px; padding: 5px 6px; cursor: pointer; background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.cal-c:hover { border-color: var(--brand); } .cal-c.empty { border: 0; background: transparent; cursor: default; }
.cal-c.today { background: var(--brand-soft); border-color: var(--brand); } .cal-c.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-n { font-weight: 700; font-size: .85rem; } .cal-dots { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.cal-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); } .cal-dots i.followup { background: #f59e0b; } .cal-dots i.late { background: #dc2626; }
.cal-ev { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #f6f9fa; margin-bottom: 8px; text-decoration: none; color: inherit; }
.cal-ev i { color: var(--brand); } .cal-ev.followup i { color: #f59e0b; } .cal-ev small { margin-left: auto; color: #6b7280; }
@media (max-width: 575px) { .cal-c { min-height: 48px; padding: 3px; } }

/* ---------- global search ---------- */
.gs-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; }
.gs-item:hover, .gs-item.active { background: var(--brand-soft); }
.gs-ico { width: 34px; height: 34px; border-radius: 10px; background: #eef6f6; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.gs-item small { display: block; color: #6b7280; } .gs-type { margin-left: auto; font-size: .7rem; color: #6b7280; text-transform: uppercase; }
.bulk-bar { position: sticky; top: 70px; z-index: 5; background: var(--surface); border: 1px solid var(--brand); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- brand logo / charts ---------- */
.brand-img { height: 36px; width: auto; max-width: 140px; border-radius: 8px; object-fit: contain; }
.chart-svg { width: 100%; height: auto; } .chart-t { font-size: 9px; fill: var(--gray-500); font-weight: 700; } .chart-l { font-size: 9px; fill: var(--gray-400); }
.chart-donut { width: 120px; height: 120px; flex: 0 0 auto; } .chart-big { font-size: 22px; font-weight: 800; fill: var(--gray-900); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.target-ring { width: 120px; height: 120px; }

/* ---------- Dark mode ---------- */
html[data-theme="dark"] {
    --surface: #1a2128; --gray-50: #11161b; --gray-100: #1f272f; --gray-200: #2b3640; --gray-300: #3a4754; --gray-400: #8795a3; --gray-500: #a3b0bd; --gray-900: #e9eff5;
    --brand-soft: rgba(45, 190, 196, .16); --success-soft: rgba(16,185,129,.18); --warning-soft: rgba(245,158,11,.18); --danger-soft: rgba(239,68,68,.18); --info-soft: rgba(59,130,246,.2);
}
html[data-theme="dark"] body { background: var(--gray-50); color: var(--gray-900); }
html[data-theme="dark"] .modal-content, html[data-theme="dark"] .dropdown-menu { background: var(--surface); color: var(--gray-900); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { background-color: #11161b; border-color: var(--gray-200); color: var(--gray-900); }
html[data-theme="dark"] .data-table td, html[data-theme="dark"] .data-table th { border-color: var(--gray-200); }
html[data-theme="dark"] .item-row, html[data-theme="dark"] .cal-c, html[data-theme="dark"] .cal-ev { background: #161d23; border-color: var(--gray-200); }
html[data-theme="dark"] .cal-c.today { background: var(--brand-soft); } html[data-theme="dark"] .cal-c.empty { background: transparent; }
html[data-theme="dark"] .wa-item:hover { background: rgba(37,211,102,.1); }
html[data-theme="dark"] .gs-ico { background: #11161b; } html[data-theme="dark"] .kcol { background: #11161b; }
html[data-theme="dark"] .text-dark { color: var(--gray-900) !important; } html[data-theme="dark"] .bg-light { background: #11161b !important; color: var(--gray-900); }
html[data-theme="dark"] .btn-soft { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-200); }
html[data-theme="dark"] .lang-switch a.active { background: var(--surface); }
html[data-theme="dark"] .auth-card, html[data-theme="dark"] .public-body { background: var(--surface); }
html[data-theme="dark"] .confirm-msg { color: var(--gray-900); }

/* ===== Sidebar toggle (collapse to icons) ===== */
.topbar-left { display: flex; align-items: center; gap: 8px; }
.sidebar, .main-area { transition: width .18s ease, margin-left .18s ease; }
@media (min-width: 992px) {
  html.sb-collapsed { --sidebar-w: 68px; }
  html.sb-collapsed .side-link { justify-content: center; padding: 11px 0; }
  html.sb-collapsed .side-link span, html.sb-collapsed .side-foot { display: none; }
  html.sb-collapsed .sidebar { padding: 16px 8px; }
  html.sb-collapsed .side-nav { margin-right: 0; padding-right: 0; }
  html.sb-collapsed .side-nav::-webkit-scrollbar { width: 0; }
}
