/* ============================================================
   Krishibid Properties Ltd. CRM - application styles
   Built on Bootstrap 5. Blue primary, white / light-gray surfaces.
   ============================================================ */
@font-face {
  font-family: "Inter";
  src: url("../vendor/inter/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e5e9f0;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --sidebar-w: 248px;
  --sidebar-mini: 72px;
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1d4ed8;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: #334155;
  --bs-body-font-size: .9rem;
  --bs-border-color: #e5e9f0;
}

body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
a { text-decoration: none; }
.small, small { font-size: .8rem; }

/* ---------- Buttons / forms ---------- */
.btn { border-radius: 10px; font-weight: 550; font-size: .875rem; padding: .5rem .95rem; transition: all .15s ease; }
.btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); --bs-btn-active-bg: var(--primary-dark); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(37, 99, 235, .28); transform: translateY(-1px); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: #c7d7fb; --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary); }
.btn-light { --bs-btn-bg: #f1f4f9; --bs-btn-border-color: #e5e9f0; --bs-btn-hover-bg: #e7ebf2; --bs-btn-hover-border-color: #dde2ea; color: var(--text); }
.form-control, .form-select { border-radius: 10px; border-color: #dbe1ea; font-size: .875rem; padding: .5rem .75rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; padding: .35rem .6rem; font-size: .82rem; }
.form-select-sm { padding-right: 1.9rem; }
.form-control:focus, .form-select:focus { border-color: #93b4f8; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .13); }
.form-label { font-weight: 550; color: var(--ink); font-size: .82rem; margin-bottom: .3rem; }
.form-label .req { color: var(--danger); }
.form-text { font-size: .76rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ---------- Shell ---------- */
#progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--primary); z-index: 2000; opacity: 0; transition: width .25s ease, opacity .3s ease; }
#progress-bar.on { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1, .7, .1, 1); }
#progress-bar.done { opacity: 0; width: 100%; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 1040; transition: width .2s ease, transform .2s ease; }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; min-height: 64px; border-bottom: 1px solid var(--line); color: var(--ink); overflow: hidden; }
.brand-mark { flex: 0 0 38px; height: 38px; width: 38px; border-radius: 11px; background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.brand-mark.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.5rem; border-radius: 16px; background: rgba(255, 255, 255, .16); }
.brand-logo { height: 38px; max-width: 46px; object-fit: contain; flex: 0 0 auto; }
.sidebar-brand .brand-full { height: 44px; width: auto; max-width: 100%; object-fit: contain; }
.sidebar-brand .brand-emblem { display: none; width: 42px; height: 42px; }
body.sidebar-mini .sidebar-brand .brand-full { display: none; }
body.sidebar-mini .sidebar-brand .brand-emblem { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.brand-text strong { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: .72rem; }
.sidebar-nav { padding: .8rem .7rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: var(--text); font-weight: 520; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.nav-item i { width: 20px; text-align: center; color: #94a3b8; font-size: .95rem; transition: color .15s ease; }
.nav-item:hover { background: #f3f6fb; color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 620; }
.nav-item.active i, .nav-item:hover i { color: var(--primary); }
.sidebar-foot { padding: .8rem 1rem; border-top: 1px solid var(--line); }
.role-chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; color: var(--muted); white-space: nowrap; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .8rem; padding: 0 1.25rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.topbar-date { align-items: center; gap: .45rem; color: var(--muted); font-size: .8rem; margin-right: .4rem; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); display: grid; place-items: center; transition: background .15s ease; }
.icon-btn:hover { background: #f1f4f9; }
.user-btn { display: flex; align-items: center; gap: .6rem; border: 0; background: transparent; padding: .25rem .4rem; border-radius: 10px; color: var(--text); }
.user-btn:hover { background: #f1f4f9; }
.user-btn strong { display: block; font-size: .82rem; color: var(--ink); line-height: 1.1; }
.user-btn small { display: block; font-size: .7rem; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; font-weight: 650; font-size: .78rem; flex: 0 0 auto; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.content { padding: 1.4rem 1.5rem; flex: 1; max-width: 1560px; width: 100%; }
.app-footer { padding: .9rem 1.5rem; color: #94a3b8; font-size: .75rem; }

body.sidebar-mini .sidebar { width: var(--sidebar-mini); }
body.sidebar-mini .main { margin-left: var(--sidebar-mini); }
body.sidebar-mini .brand-text, body.sidebar-mini .nav-item span, body.sidebar-mini .role-chip span { display: none; }
body.sidebar-mini .nav-item { justify-content: center; }
body.sidebar-mini .sidebar-brand { justify-content: center; padding-inline: .5rem; }
.sidebar-backdrop { display: none; }

/* ---------- Global search ---------- */
.global-search { position: relative; flex: 1; max-width: 460px; }
.global-search > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .85rem; }
.global-search input { width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #f6f8fb; padding: 0 .9rem 0 2.3rem; font-size: .85rem; outline: 0; transition: all .15s ease; }
.global-search input:focus { background: #fff; border-color: #93b4f8; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); max-height: 70vh; overflow-y: auto; padding: .4rem; min-width: 300px; }
.search-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; padding: .5rem .6rem .25rem; font-weight: 650; }
.search-item { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 9px; color: var(--text); }
.search-item:hover, .search-item:focus { background: #f3f6fb; color: var(--ink); }
.search-item i { color: #94a3b8; width: 18px; text-align: center; }
.search-item strong { display: block; font-size: .84rem; color: var(--ink); }
.search-item small { color: var(--muted); }
.search-empty { padding: 1rem; text-align: center; color: var(--muted); font-size: .84rem; }

/* ---------- Notifications ---------- */
.notif-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .64rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.notif-menu { width: 360px; max-width: 94vw; padding: 0; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(15, 23, 42, .14); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem .95rem; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; padding: .7rem .95rem; border-bottom: 1px solid #f1f4f9; color: var(--text); }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f5f8ff; }
.notif-item .ico { flex: 0 0 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: .8rem; }
.notif-item .ico.red { background: #fef2f2; color: var(--danger); }
.notif-item .ico.green { background: #f0fdf4; color: var(--success); }
.notif-item .ico.amber { background: #fffbeb; color: var(--warning); }
.notif-item strong { display: block; font-size: .82rem; color: var(--ink); }
.notif-item p { margin: 0; font-size: .78rem; line-height: 1.35; }
.notif-item time { font-size: .7rem; color: #94a3b8; }
.notif-empty { padding: 1.6rem; text-align: center; color: var(--muted); font-size: .84rem; }
.notif-foot { display: block; text-align: center; padding: .65rem; font-size: .8rem; font-weight: 600; border-top: 1px solid var(--line); }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1.2rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; }
.page-head p { margin: .15rem 0 0; color: var(--muted); font-size: .84rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.crumb { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: .9rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { font-size: .95rem; margin: 0; }
.card-body { padding: 1.15rem; }
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .09); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat-card { display: flex; align-items: center; gap: .85rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); transition: transform .15s ease, box-shadow .15s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .09); color: var(--text); }
.stat-icon { flex: 0 0 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1rem; background: color-mix(in srgb, var(--c, #2563eb) 12%, #fff); color: var(--c, #2563eb); }
.stat-card .num { font-size: 1.45rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card .lbl { font-size: .76rem; color: var(--muted); }
.stat-card.alert-red { border-color: #fecaca; background: #fffafa; }

.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 250px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem; background: var(--surface); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { margin: 0; --bs-table-bg: transparent; font-size: .85rem; }
.table > thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; background: #f8fafc; border-bottom: 1px solid var(--line); padding: .65rem .9rem; white-space: nowrap; }
.table > tbody td { padding: .7rem .9rem; vertical-align: middle; border-color: #eef1f6; }
.table > tbody tr { transition: background .12s ease; }
.table > tbody tr:hover { background: #f8fafd; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table a.row-link { color: var(--ink); font-weight: 600; }
.table a.row-link:hover { color: var(--primary); }
.table .sub { display: block; color: var(--muted); font-size: .76rem; }
th a.sort { color: inherit; display: inline-flex; align-items: center; gap: .3rem; }
th a.sort:hover, th a.sort.on { color: var(--primary); }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.pagination { --bs-pagination-border-radius: 8px; --bs-pagination-color: var(--text); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); gap: 3px; }
.pagination .page-link { border-radius: 8px; border-color: var(--line); min-width: 32px; text-align: center; }
.empty-state { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }
.empty-state i { font-size: 1.8rem; color: #cbd5e1; margin-bottom: .6rem; display: block; }
.empty-state h6 { margin-bottom: .2rem; }
.loading-overlay { position: relative; }
.loading-overlay.is-loading { opacity: .5; pointer-events: none; }

/* ---------- Badges ---------- */
.badge-status { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 620; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 11%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge-soft { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 620; white-space: nowrap; }
.badge-soft-danger { background: #fef2f2; color: #b91c1c; }
.badge-soft-warning { background: #fffbeb; color: #b45309; }
.badge-soft-success { background: #f0fdf4; color: #15803d; }
.badge-soft-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-info { background: #ecfeff; color: #0e7490; }

/* ---------- Filters / bulk bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.filter-bar .search-input { position: relative; flex: 1 1 220px; max-width: 320px; }
.filter-bar .search-input i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .8rem; }
.filter-bar .search-input input { padding-left: 2rem; }
.filter-bar .form-select { width: auto; max-width: 190px; }
.custom-range { display: inline-flex; align-items: center; gap: .4rem; }
.custom-range .form-control { width: 140px; }
.advanced-filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: #fafbfd; }
.bulk-bar { display: none; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--primary-soft); border-bottom: 1px solid #d5e2fd; font-size: .84rem; }
.bulk-bar.show { display: flex; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .7rem 1rem 0; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .85rem; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 580; font-size: .84rem; border-bottom: 2px solid transparent; display: inline-flex; gap: .4rem; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { font-size: .7rem; background: #eef2f7; color: var(--text); border-radius: 999px; padding: .05rem .45rem; }
.tabs a.active .count { background: var(--primary-soft); color: var(--primary); }
.tabs .count.red { background: #fef2f2; color: #b91c1c; }

/* ---------- Detail pages ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .95rem 1.2rem; }
.info-grid .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 650; }
.info-grid .v { color: var(--ink); font-weight: 520; word-break: break-word; }
.info-grid .wide { grid-column: 1 / -1; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: #edf0f5; }
.timeline li { position: relative; padding: 0 0 1rem 2.6rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid #e2e8f0; display: grid; place-items: center; font-size: .72rem; color: var(--muted); }
.timeline .dot.blue { border-color: #bfd3fb; color: var(--primary); }
.timeline .dot.green { border-color: #bbf7d0; color: var(--success); }
.timeline .dot.red { border-color: #fecaca; color: var(--danger); }
.timeline .dot.amber { border-color: #fde68a; color: var(--warning); }
.timeline p { margin: 0; font-size: .84rem; color: var(--ink); }
.timeline .meta { font-size: .74rem; color: var(--muted); }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 11px; padding: .7rem .85rem; margin-bottom: .6rem; font-size: .84rem; white-space: pre-wrap; word-break: break-word; }
.note .meta { display: block; font-size: .72rem; color: #92400e; margin-top: .3rem; white-space: normal; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.property-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #eef2f7; display: grid; place-items: center; color: #94a3b8; flex: 0 0 auto; }
.property-hero { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; }
.progress { height: 7px; border-radius: 999px; background: #eef2f7; }
.progress-bar { background: var(--primary); border-radius: 999px; }
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .2); }
.modal-header, .modal-footer { border-color: var(--line); padding: .9rem 1.15rem; }
.modal-title { font-size: 1rem; }
.confirm-icon { width: 54px; height: 54px; border-radius: 50%; background: #fef2f2; color: var(--danger); display: grid; place-items: center; font-size: 1.3rem; margin: 0 auto; }
.toast { border: 0; border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); font-size: .86rem; }
.toast .toast-body { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem .9rem; }
.dup-warning { border: 1px solid #fde68a; background: #fffbeb; border-radius: 11px; padding: .7rem .85rem; font-size: .84rem; }
.section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; font-weight: 700; margin: 0 0 .8rem; }
.dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: 0 12px 32px rgba(15, 23, 42, .12); font-size: .86rem; padding: .35rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--primary); }

/* ---------- Auth / error pages ---------- */
.auth-page { background: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: linear-gradient(150deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%); color: #fff; display: grid; place-items: center; padding: 3rem; }
.auth-side-inner { max-width: 400px; }
.auth-side h1 { color: #fff; font-size: 1.9rem; margin: 1.3rem 0 .6rem; }
.auth-side p { opacity: .9; font-size: 1rem; }
.auth-side ul { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .65rem; }
.auth-side li i { margin-right: .5rem; opacity: .9; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.2rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 2rem; }
.auth-card h2 { font-size: 1.35rem; margin-bottom: .25rem; }
.auth-logo { margin: -.2rem 0 1.4rem; text-align: center; }
.auth-logo img { width: 100%; max-width: 280px; height: auto; max-height: 80px; object-fit: contain; }
.auth-emblem { display: inline-grid; place-items: center; width: 104px; height: 104px; border-radius: 26px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .25); }
.auth-emblem img { width: 84px; height: 84px; }
.auth-foot { margin-top: 1.2rem; color: #94a3b8; font-size: .76rem; }
.error-page { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 1rem; }
.error-box { text-align: center; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 2.5rem 2rem; box-shadow: var(--shadow); }
.error-code { font-size: 3.6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-box h1 { font-size: 1.25rem; margin: .7rem 0 .4rem; }
.error-box p { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: 0 0 40px rgba(15, 23, 42, .2); }
  .main { margin-left: 0 !important; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 1035; }
  body.sidebar-mini .brand-text, body.sidebar-mini .role-chip span { display: flex; }
  body.sidebar-mini .sidebar-brand .brand-full { display: block; }
  body.sidebar-mini .sidebar-brand .brand-emblem { display: none; }
  body.sidebar-mini .nav-item span { display: inline; }
  body.sidebar-mini .nav-item { justify-content: flex-start; }
  .content { padding: 1rem; }
  .topbar { padding: 0 .75rem; gap: .4rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.15rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat-card { padding: .75rem; gap: .6rem; }
  .stat-card .num { font-size: 1.2rem; }
  .stat-icon { flex-basis: 36px; height: 36px; }
  .filter-bar .form-select { max-width: none; flex: 1 1 45%; }
  .filter-bar .search-input { max-width: none; flex-basis: 100%; }
  .custom-range { flex-wrap: wrap; }
  .page-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .page-actions, .filter-bar, .app-footer { display: none !important; } .main { margin: 0 !important; } }
.status-quick{line-height:1;text-decoration:none}.status-quick:hover .badge,.status-quick:focus .badge{filter:brightness(.92);outline:2px solid rgba(37,99,235,.25);outline-offset:1px}

/* Quick status filter above the lead list */
.status-chips { display: flex; flex-wrap: nowrap; gap: .4rem; padding: .65rem 1rem; overflow-x: auto; border-bottom: 1px solid var(--border, #e5e7eb); }
.status-chip { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; border: 1px solid var(--border, #e5e7eb); background: #fff; color: #374151; border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; font-weight: 600; cursor: pointer; }
.status-chip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--c, #6b7280); display: inline-block; }
.status-chip span { background: #f3f4f6; border-radius: 999px; padding: 0 .45rem; font-size: .72rem; color: #4b5563; }
.status-chip:hover { border-color: var(--c, #2563eb); }
.status-chip.active { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.status-chip.active span { background: rgba(255,255,255,.2); color: #fff; }

.quick-import { display: inline-flex; margin: 0; }
.quick-import .btn[disabled] { opacity: .85; }

/* ============================================================
   Team chat
   ============================================================ */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: inline-grid; place-items: center; }
body.sidebar-mini .nav-item { position: relative; }
body.sidebar-mini .nav-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: .6rem; }

body.page-chat .app-footer { display: none; }
body.page-chat .content { max-width: none; padding: 1rem 1.25rem; display: flex; }
.chat-app { --chat-h: calc(100vh - 64px - 2rem); display: grid; grid-template-columns: 340px minmax(0, 1fr); height: var(--chat-h); min-height: 420px; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
@supports (height: 100dvh) { .chat-app { --chat-h: calc(100dvh - 64px - 2rem); } }

/* left column */
.chat-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem .5rem; }
.chat-list-head h1 { font-size: 1.2rem; margin: 0; }
.chat-search { position: relative; margin: 0 1rem .6rem; }
.chat-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .8rem; }
.chat-search input { width: 100%; border: 1px solid var(--line); background: #f6f8fb; border-radius: 10px; padding: .5rem .75rem .5rem 2rem; font-size: .86rem; }
.chat-search input:focus { outline: 0; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.chat-items { flex: 1; overflow-y: auto; padding: 0 .5rem .75rem; }
.chat-item { display: flex; gap: .7rem; align-items: center; width: 100%; padding: .6rem .6rem; border: 0; background: none; border-radius: 12px; text-align: left; color: var(--text); }
.chat-item:hover { background: #f3f6fb; }
.chat-item.active { background: var(--primary-soft); }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.chat-item-name { display: flex; align-items: center; gap: .35rem; min-width: 0; flex: 1; }
.chat-item-name strong { font-weight: 620; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-top time { font-size: .72rem; color: var(--muted); flex: 0 0 auto; }
.chat-item-preview { flex: 1; min-width: 0; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item.unread .chat-item-preview { color: var(--ink); font-weight: 560; }
.chat-item.unread time { color: var(--primary); font-weight: 600; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; display: inline-grid; place-items: center; flex: 0 0 auto; }
.chat-hint { color: var(--muted); font-size: .84rem; text-align: center; padding: 1.5rem 1rem; }

/* avatars + priority tags */
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; font-weight: 650; font-size: .82rem; color: #fff; background: #64748b; }
.chat-avatar.sm { width: 32px; height: 32px; font-size: .7rem; align-self: flex-end; }
.chat-avatar-space { width: 32px; flex: 0 0 32px; }
.chat-avatar.group { background: #e0e7ff; color: #4338ca; font-size: .95rem; }
.chat-avatar.team { background: var(--primary); color: #fff; }
.c0 { --c: #2563eb; } .c1 { --c: #0891b2; } .c2 { --c: #7c3aed; } .c3 { --c: #db2777; }
.c4 { --c: #ea580c; } .c5 { --c: #16a34a; } .c6 { --c: #0d9488; } .c7 { --c: #9333ea; }
.chat-avatar[class*=" c"] { background: var(--c); }
.chat-sender { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-bottom: .15rem; font-size: .78rem; }
.chat-sender strong { color: var(--c, var(--primary)); font-weight: 650; }
.chat-tag { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .4rem; border-radius: 6px; font-size: .64rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; flex: 0 0 auto; line-height: 1.5; }
.chat-tag i { font-size: .55rem; }
.chat-tag-super_admin { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.chat-tag-admin { background: #fff7ed; color: #c2410c; box-shadow: inset 0 0 0 1px #fed7aa; }
.chat-tag-sales_manager { background: #eff6ff; color: #1d4ed8; box-shadow: inset 0 0 0 1px #bfdbfe; }

/* right column */
.chat-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #eef2f7; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 2rem; }
.chat-empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; font-size: 1.8rem; margin-bottom: .8rem; }
.chat-empty h2 { font-size: 1.1rem; color: var(--ink); }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .65rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-head-text { min-width: 0; }
.chat-head-name { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.chat-head-name strong { color: var(--ink); font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-sub { border: 0; background: none; padding: 0; color: var(--muted); font-size: .76rem; }
.chat-head-sub:hover { color: var(--primary); }
.chat-back { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .75rem 1rem 1rem; }
.chat-more { text-align: center; margin-bottom: .5rem; }
.chat-day { text-align: center; margin: .9rem 0 .5rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.chat-system { text-align: center; margin: .5rem 0; }
.chat-system span { display: inline-block; background: rgba(255, 255, 255, .8); color: var(--muted); font-size: .74rem; padding: .25rem .7rem; border-radius: 10px; }
.chat-row { display: flex; gap: .5rem; align-items: flex-end; margin-top: .6rem; }
.chat-row.compact { margin-top: .15rem; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { position: relative; max-width: min(72%, 560px); background: #fff; border-radius: 14px 14px 14px 4px; padding: .45rem .7rem .3rem; box-shadow: 0 1px 1px rgba(15, 23, 42, .06); color: var(--ink); }
.chat-row.compact .chat-bubble { border-radius: 14px 14px 14px 4px; }
.chat-row.mine .chat-bubble { background: #dbeafe; border-radius: 14px 14px 4px 14px; }
.chat-bubble.deleted .chat-text { color: var(--muted); font-style: italic; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.45; }
.chat-text a { color: var(--primary-dark); text-decoration: underline; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; font-size: .66rem; color: #94a3b8; margin-top: .1rem; }
.chat-tick { color: #94a3b8; } .chat-tick.seen { color: #2563eb; }
.chat-del { position: absolute; top: 4px; right: -34px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; color: var(--muted); box-shadow: var(--shadow); opacity: 0; transition: opacity .15s ease; }
.chat-row.mine .chat-del { right: auto; left: -34px; }
.chat-bubble:hover .chat-del, .chat-del:focus-visible { opacity: 1; }
.chat-del:hover { color: var(--danger); }
@media (hover: none) { .chat-del { opacity: .85; top: auto; bottom: 2px; } }
.chat-photo-link { display: block; margin: .1rem -.4rem .2rem; }
.chat-photo-link img { display: block; max-width: 100%; width: auto; max-height: 320px; min-height: 60px; border-radius: 10px; object-fit: cover; background: #e2e8f0; }
.chat-bubble.photo-only { padding: .3rem .3rem .25rem; }
.chat-bubble.photo-only .chat-photo-link { margin: 0; }
.chat-bubble.photo-only .chat-meta { padding-right: .35rem; }
.chat-file { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; margin: .1rem 0 .2rem; border-radius: 10px; background: rgba(15, 23, 42, .04); color: var(--ink); text-decoration: none; min-width: 220px; }
.chat-file:hover { background: rgba(15, 23, 42, .08); color: var(--ink); }
.chat-file-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 1.05rem; flex: 0 0 auto; }
.chat-file-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.chat-file-text strong { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-file-text small { color: var(--muted); font-size: .72rem; }
.chat-file-dl { color: var(--muted); }
.chat-jump { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); border: 0; border-radius: 20px; padding: .4rem .9rem; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 600; box-shadow: var(--shadow); z-index: 2; }

/* composer */
.chat-composer { background: var(--surface); border-top: 1px solid var(--line); padding: .6rem .75rem; }
.chat-compose-row { display: flex; align-items: flex-end; gap: .5rem; }
.chat-attach { cursor: pointer; margin: 0; flex: 0 0 auto; }
#chat-input { flex: 1; resize: none; border: 1px solid var(--line); background: #f6f8fb; border-radius: 20px; padding: .55rem .95rem; font-size: .9rem; line-height: 1.4; max-height: 160px; min-height: 40px; color: var(--ink); }
#chat-input:focus { outline: 0; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.chat-send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; flex: 0 0 auto; display: grid; place-items: center; }
.chat-send:hover { background: var(--primary-dark); }
.chat-send:disabled { opacity: .6; }
.chat-attachment { position: relative; display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; margin-bottom: .5rem; border-radius: 12px; background: #f6f8fb; border: 1px solid var(--line); overflow: hidden; }
.chat-attachment-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--primary); color: #fff; flex: 0 0 auto; }
.chat-attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-attachment-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-attachment-text strong { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.chat-attachment-text small { color: var(--muted); font-size: .72rem; }
.chat-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #e2e8f0; }
.chat-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.chat-drop { position: absolute; inset: 0; background: rgba(37, 99, 235, .1); border: 2px dashed var(--primary); border-radius: var(--radius); display: grid; place-items: center; z-index: 5; color: var(--primary); text-align: center; font-weight: 600; pointer-events: none; }
.chat-drop i { font-size: 2rem; }

/* people / members */
.chat-people { display: flex; flex-direction: column; }
.chat-person { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .75rem; border: 0; background: none; border-radius: 10px; text-align: left; cursor: pointer; margin: 0; color: var(--text); }
.chat-person:hover { background: #f3f6fb; }
#chat-members .chat-person { border-radius: 0; border-bottom: 1px solid var(--line); cursor: default; padding: .65rem 1rem; }
.chat-person .form-check-input { margin: 0; flex: 0 0 auto; }
.chat-person-text { min-width: 0; display: flex; flex-direction: column; }
.chat-person-name { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.chat-person-name strong { color: var(--ink); font-weight: 620; }
.chat-person-text small { color: var(--muted); font-size: .74rem; }
.chat-photo .modal-body img { max-width: 100%; max-height: 75vh; border-radius: 8px; }

@media (max-width: 991.98px) {
  body.page-chat .content { padding: .75rem; }
  .chat-app { --chat-h: calc(100vh - 64px - 1.5rem); grid-template-columns: 290px minmax(0, 1fr); }
  @supports (height: 100dvh) { .chat-app { --chat-h: calc(100dvh - 64px - 1.5rem); } }
}
@media (max-width: 767.98px) {
  body.page-chat .content { padding: 0; }
  .chat-app { --chat-h: calc(100vh - 64px); grid-template-columns: minmax(0, 1fr); border-radius: 0; border: 0; }
  @supports (height: 100dvh) { .chat-app { --chat-h: calc(100dvh - 64px); } }
  .chat-pane { display: none; }
  .chat-app.show-pane .chat-list { display: none; }
  .chat-app.show-pane .chat-pane { display: flex; }
  .chat-back { display: inline-grid; }
  .chat-bubble { max-width: 82%; }
  .chat-del { right: -30px; } .chat-row.mine .chat-del { left: -30px; }
  .chat-file { min-width: 0; }
}

/* Dashboard export menu */
.export-menu { min-width: 270px; }
.export-menu .dropdown-header { color: var(--ink); font-weight: 650; font-size: .8rem; padding-top: .5rem; }
.export-pair { display: flex; padding: 0 .4rem .2rem; gap: .2rem; }
.export-pair .dropdown-item { border-radius: 8px; padding: .35rem .6rem; }

/* "Who gets the leads?" options */
.assign-options { border: 0; padding: 0; margin: 0; }
.assign-option { display: flex; gap: .65rem; align-items: flex-start; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .45rem; cursor: pointer; }
.assign-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.assign-option .form-check-input { margin-top: .2rem; flex: 0 0 auto; }
.assign-option span { display: flex; flex-direction: column; }
.assign-option strong { color: var(--ink); font-weight: 620; font-size: .88rem; }
.assign-option small { color: var(--muted); font-size: .76rem; }
.assign-pool { margin: -.1rem 0 .6rem 2.1rem; display: flex; flex-direction: column; gap: .3rem; }
.assign-person { display: flex; align-items: center; gap: .45rem; font-size: .86rem; }
.assign-person .form-check-input { margin: 0; }
.qi-file { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; border-radius: 10px; background: #f0fdf4; color: #166534; font-weight: 600; font-size: .86rem; word-break: break-all; }
.qi-file i { font-size: 1.1rem; }

/* ============================================================
   Notes (Google Keep style)
   ============================================================ */
.note-c-default { --note: #ffffff; --note-line: var(--line); }
.note-c-coral { --note: #faafa8; --note-line: #f39b92; } .note-c-peach { --note: #f8c9a8; --note-line: #f2b083; }
.note-c-sand { --note: #fff8b8; --note-line: #f2e58f; }  .note-c-mint { --note: #e2f6d3; --note-line: #c7e8af; }
.note-c-sage { --note: #b4ddd3; --note-line: #93cbbd; }  .note-c-fog { --note: #d4e4ed; --note-line: #b7d0de; }
.note-c-storm { --note: #aeccdc; --note-line: #8fb6ca; } .note-c-dusk { --note: #d3bfdb; --note-line: #bfa3cb; }
.note-c-blossom { --note: #f6e2dd; --note-line: #ecc9c0; } .note-c-clay { --note: #e9e3d4; --note-line: #d9cfb8; }
.note-c-chalk { --note: #efeff1; --note-line: #dcdce0; }

.notes-search { position: relative; min-width: 260px; }
.notes-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .8rem; }
.notes-search input { padding-left: 2rem; border-radius: 10px; }
.notes-tabs { display: flex; gap: .35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.notes-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 20px; padding: .35rem .9rem; font-size: .84rem; font-weight: 560; }
.notes-tabs button.active { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

.note-composer { max-width: 600px; margin: 0 auto 1.6rem; background: var(--note, #fff); border: 1px solid var(--note-line, var(--line)); border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.note-composer:not(.open) { --note: #fff; }
.note-composer-collapsed { display: flex; align-items: center; padding: .25rem .4rem .25rem .25rem; }
.note-take { flex: 1; text-align: left; border: 0; background: none; padding: .6rem .8rem; color: var(--muted); font-weight: 560; }

.note-editor { position: relative; padding: .7rem .9rem .5rem; background: var(--note); border-radius: 12px; }
.note-title-input { width: 100%; border: 0; background: transparent; font-weight: 650; font-size: 1.02rem; color: var(--ink); padding: .2rem 2.2rem .35rem 0; outline: 0; }
.note-body-input { width: 100%; border: 0; background: transparent; resize: none; min-height: 46px; font-size: .92rem; color: var(--ink); line-height: 1.5; outline: 0; padding: 0; overflow: hidden; }
.note-editor-foot { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.note-tools { display: flex; gap: .1rem; }
.note-tools .icon-btn, .note-card-tools .icon-btn { width: 34px; height: 34px; color: #475569; background: transparent; }
.note-tools .icon-btn:hover, .note-card-tools .icon-btn:hover { background: rgba(15, 23, 42, .08); }
.note-edited { margin-left: auto; font-size: .72rem; color: #64748b; }
.note-pin { position: absolute; top: .45rem; right: .45rem; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #94a3b8; display: grid; place-items: center; }
.note-pin:hover { background: rgba(15, 23, 42, .08); color: var(--ink); }
.note-pin.on { color: var(--ink); }
.note-pin.on i { transform: rotate(-30deg); }
.note-palette { padding: .5rem; min-width: auto; width: 196px; flex-wrap: wrap; gap: .3rem; }
.note-palette.show { display: flex; }
.note-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--note-line); background: var(--note); padding: 0; }
.note-swatch.note-c-default { border-color: #cbd5e1; }
.note-swatch:hover, .note-swatch.on { border-color: #475569; }

.note-list-editor { display: flex; flex-direction: column; gap: .1rem; }
.note-li { display: flex; align-items: center; gap: .5rem; border-top: 1px solid transparent; }
.note-li .form-check-input { margin: 0; flex: 0 0 auto; }
.note-li-input { flex: 1; border: 0; background: transparent; padding: .3rem 0; font-size: .92rem; color: var(--ink); outline: 0; min-width: 0; }
.note-li.done .note-li-input { text-decoration: line-through; color: #64748b; }
.note-li-remove { width: 26px; height: 26px; opacity: 0; background: transparent; }
.note-li:hover .note-li-remove, .note-li-input:focus + .note-li-remove { opacity: 1; }
.note-li-add { border: 0; background: none; color: #64748b; text-align: left; padding: .35rem 0; font-size: .88rem; }

.notes-section { margin-bottom: 1.2rem; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.note-card { position: relative; display: block; background: var(--note); border: 1px solid var(--note-line); border-radius: 12px;
  padding: .75rem .85rem .35rem; cursor: pointer; transition: box-shadow .15s ease; }
.note-card:hover, .note-card:focus-visible { box-shadow: 0 2px 8px rgba(15, 23, 42, .16); outline: 0; }
.note-card .note-pin { opacity: 0; }
.note-card:hover .note-pin, .note-card .note-pin.on, .note-card:focus-within .note-pin { opacity: 1; }
.note-card-title { font-weight: 650; color: var(--ink); margin: 0 1.8rem .35rem 0; word-break: break-word; }
.note-card-body { white-space: pre-wrap; word-break: break-word; font-size: .9rem; color: var(--ink); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 14; -webkit-box-orient: vertical; overflow: hidden; }
.note-card-list { display: flex; flex-direction: column; gap: .15rem; }
.note-card-li { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; color: var(--ink); cursor: pointer; margin: 0; }
.note-card-li .form-check-input { margin-top: .2rem; flex: 0 0 auto; }
.note-card-li.done span { text-decoration: line-through; color: #64748b; }
.note-card-more { font-size: .76rem; color: #64748b; margin-top: .2rem; }
.note-card-tools { display: flex; gap: .1rem; margin: .35rem -.4rem 0; opacity: 0; transition: opacity .15s ease; }
.note-card:hover .note-card-tools, .note-card:focus-within .note-card-tools { opacity: 1; }
@media (hover: none) { .note-card-tools, .note-card .note-pin { opacity: 1; } }
.notes-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.notes-empty i { font-size: 3.5rem; color: #cbd5e1; margin-bottom: .8rem; }
.notes-trash-bar { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin-bottom: 1rem; font-style: italic; }
.note-modal-content { background: var(--note, #fff); overflow: hidden; }
.note-modal-content .note-editor { padding: 1rem 1.1rem .7rem; }
.note-modal-content .note-body-input { min-height: 120px; max-height: 60vh; overflow-y: auto; }
.note-snack { position: fixed; left: 1.2rem; bottom: 1.2rem; z-index: 1090; display: flex; align-items: center; gap: .8rem; background: #1e293b; color: #fff; padding: .65rem .9rem .65rem 1.1rem;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .3); font-size: .86rem; transform: translateY(150%); transition: transform .2s ease; }
.note-snack.show { transform: none; }
.note-snack .btn-link { color: #fcd34d; font-weight: 650; text-decoration: none; padding: 0; }

/* Dashboard notes card */
.dash-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.dash-note { display: block; background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; padding: .6rem .75rem; color: var(--ink); text-decoration: none; min-height: 70px; }
.dash-note:hover { color: var(--ink); box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.dash-note strong { display: block; font-size: .86rem; margin-bottom: .15rem; }
.dash-note p { margin: 0; font-size: .8rem; color: #334155; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 575.98px) {
  .notes-search { min-width: 0; flex: 1 1 100%; }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Company sections in the sidebar (KPL / KSP) */
.nav-section { display: flex; align-items: center; gap: .5rem; margin: .8rem .2rem .25rem; padding: 0 .55rem; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; white-space: nowrap; overflow: hidden; }
.nav-section-code { flex: 0 0 auto; padding: .1rem .4rem; border-radius: 6px; background: color-mix(in srgb, var(--co) 14%, #fff); color: var(--co); letter-spacing: .02em; }
.nav-section-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: .74rem; }
.nav-item.nav-sub { padding-left: 1.05rem; }
.nav-divider { height: 1px; background: var(--line); margin: .7rem .5rem .5rem; }
body.sidebar-mini .nav-section { justify-content: center; margin-inline: 0; padding: 0; }
body.sidebar-mini .nav-section-name { display: none; }
body.sidebar-mini .nav-item.nav-sub { padding-left: .75rem; }
@media (max-width: 991.98px) {
  body.sidebar-mini .nav-section { justify-content: flex-start; padding: 0 .55rem; }
  body.sidebar-mini .nav-section-name { display: inline; }
}
.co-badge { display: inline-flex; align-items: center; padding: .05rem .4rem; border-radius: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  background: color-mix(in srgb, var(--co, #2563eb) 13%, #fff); color: var(--co, #2563eb); vertical-align: middle; }
.co-tabs { display: inline-flex; gap: .25rem; padding: .2rem; background: #eef2f7; border-radius: 10px; }
.co-tabs a { padding: .3rem .8rem; border-radius: 8px; color: var(--text); font-weight: 600; font-size: .82rem; text-decoration: none; }
.co-tabs a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.company-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.company-pill { display: inline-flex; gap: .35rem; align-items: center; padding: .45rem .85rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-size: .86rem; }
.company-pill strong { color: var(--co); }
.company-pill.on { border-color: var(--co); background: color-mix(in srgb, var(--co) 9%, #fff); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--co) 15%, transparent); }
.qi-co { font-size: .7rem; font-weight: 700; padding: .05rem .35rem; border-radius: 5px; background: rgba(255,255,255,.22); margin-left: .2rem; }
