/* Leads4msme LMS — application stylesheet (loads after Bootstrap 5) */
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("../fonts/montserrat-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-weight: 400; font-display: swap; src: url("../fonts/hind-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-weight: 500; font-display: swap; src: url("../fonts/hind-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-weight: 600; font-display: swap; src: url("../fonts/hind-latin-600-normal.woff2") format("woff2"); }

:root {
    --navy: #063B82; --navy-deep: #032A63; --blue: #1261B5; --red: #ED1C24; --red-dark: #B5121B;
    --ink: #1F2A3A; --muted: #5B6676; --bg: #F5F8FC; --line: #DCE5F1; --white: #fff;
    --green: #17753F; --amber: #9A5B00; --teal: #0B6E73;
    --head: "Montserrat", "Segoe UI", Arial, sans-serif; --body: "Hind", "Segoe UI", Arial, sans-serif;
    --side-w: 262px; --side-w-min: 72px; --top-h: 64px; --radius: 10px;
    --shadow: 0 1px 3px rgba(3,42,99,.08), 0 6px 18px rgba(3,42,99,.06);
    --bs-body-font-family: var(--body); --bs-body-color: var(--ink); --bs-link-color-rgb: 18,97,181;
}
body { font-family: var(--body); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--bg); }
h1, h2, h3, h4, .h1, .h2, .h3, .h4 { font-family: var(--head); color: var(--navy-deep); font-weight: 700; letter-spacing: -.01em; }
h2, .h2 { font-size: 1.25rem; } h3, .h3 { font-size: 1.05rem; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 3000; background: var(--navy-deep); color: #fff; padding: .5rem 1rem; border-radius: 0 0 8px 8px; }
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--head); font-weight: 700; font-size: .82rem; letter-spacing: .03em; border-radius: 8px; padding: .55rem 1rem; border-width: 1.5px; }
.btn-sm { font-size: .76rem; padding: .35rem .7rem; }
.btn-brand { background: var(--red); border-color: var(--red); color: #fff; }
.btn-brand:hover, .btn-brand:focus-visible { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover, .btn-navy:focus-visible { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.btn-outline-navy { border-color: var(--navy); color: var(--navy); background: #fff; }
.btn-outline-navy:hover, .btn-outline-navy:focus-visible { background: var(--navy); color: #fff; }
.btn-outline-danger { --bs-btn-color: var(--red-dark); --bs-btn-border-color: var(--red-dark); --bs-btn-hover-bg: var(--red-dark); --bs-btn-hover-border-color: var(--red-dark); }
.btn-link-plain { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--navy-deep); color: #C9D8EF; display: flex; flex-direction: column; z-index: 1040; transition: width .18s ease, transform .2s ease; }
.sidebar-brand { display: flex; align-items: center; justify-content: center; height: var(--top-h); background: #fff; flex: none; border-bottom: 3px solid var(--red); padding: 0 .75rem; }
.sidebar-brand .brand-full { height: 46px; width: auto; }
.sidebar-brand .brand-mark { display: none; height: 38px; width: auto; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: #2b4f8a transparent; }
.side-link, .side-group-toggle { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .8rem; border-radius: 8px; color: #C9D8EF; text-decoration: none; font-family: var(--head); font-weight: 600; font-size: .86rem; background: none; border: 0; text-align: left; position: relative; white-space: nowrap; }
.side-link .bi, .side-group-toggle > .bi:first-child { font-size: 1.05rem; flex: none; width: 1.25rem; text-align: center; }
.side-link span:not(.count), .side-group-toggle span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover, .side-group-toggle:hover, .side-link:focus-visible, .side-group-toggle:focus-visible { background: rgba(255,255,255,.08); color: #fff; outline-color: #fff; }
.side-link.active { background: var(--navy); color: #fff; }
.side-link.active::before { content: ""; position: absolute; left: -2px; top: 22%; bottom: 22%; width: 5px; background: var(--red); transform: skewY(-24deg); }
.side-link.sub { font-weight: 500; font-family: var(--body); font-size: .95rem; padding: .48rem .8rem .48rem 1.1rem; }
.side-link.locked { color: #8FA5C8; }
.side-link .lock { font-size: .72rem; width: auto; }
.side-link .count { background: var(--red); color: #fff; font-family: var(--head); font-size: .68rem; font-weight: 700; padding: .05rem .42rem; border-radius: 999px; }
.side-group { margin-top: .2rem; }
.side-group-toggle { text-transform: uppercase; letter-spacing: .07em; font-size: .7rem; color: #9FB6DA; padding-top: .7rem; padding-bottom: .45rem; }
.side-group-toggle .caret { font-size: .7rem; transition: transform .15s ease; }
.side-group-toggle.collapsed .caret { transform: rotate(-90deg); }
.sidebar-plan { display: flex; align-items: center; gap: .7rem; margin: .6rem; padding: .7rem .8rem; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; text-decoration: none; flex: none; }
.sidebar-plan:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-plan .bi { font-size: 1.3rem; color: #FFD166; }
.sidebar-plan span { display: flex; flex-direction: column; font-size: .82rem; line-height: 1.25; color: #C9D8EF; }
.sidebar-plan strong { font-family: var(--head); color: #fff; font-size: .85rem; letter-spacing: .04em; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(3,20,50,.5); z-index: 1035; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .18s ease; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1020; height: var(--top-h); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem 0 .75rem; }
.topbar-title { font-size: 1.15rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 8px; border: 0; background: none; color: var(--navy-deep); font-size: 1.35rem; display: grid; place-items: center; text-decoration: none; }
.icon-btn:hover { background: var(--bg); color: var(--navy); }
.icon-btn .dot { position: absolute; top: 4px; right: 2px; background: var(--red); color: #fff; font: 700 .62rem var(--head); border-radius: 999px; padding: .05rem .3rem; }
.user-btn { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .25rem .4rem; border-radius: 8px; color: var(--ink); }
.user-btn:hover { background: var(--bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 .95rem var(--head); }
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.user-meta strong { font: 700 .85rem var(--head); color: var(--navy-deep); }
.user-meta small { color: var(--muted); font-size: .78rem; }
.dropdown-item .bi { margin-right: .4rem; color: var(--muted); }
.content { flex: 1; padding: 1.4rem 1.5rem 2rem; min-width: 0; }
.app-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

body.preload .sidebar, body.preload .main { transition: none !important; }
.page-actions .btn-group { flex-wrap: wrap; row-gap: .3rem; }
.page-actions { min-width: 0; }
/* collapsed (desktop) */
@media (min-width: 992px) {
    body.side-min .sidebar { width: var(--side-w-min); }
    body.side-min .main { margin-left: var(--side-w-min); }
    body.side-min .brand-full { display: none; }
    body.side-min .brand-mark { display: block; }
    body.side-min .side-group-toggle, body.side-min .side-link span, body.side-min .side-link .lock, body.side-min .sidebar-plan span { display: none; }
    body.side-min .side-group .collapse { display: block !important; height: auto !important; }
    body.side-min .side-group { border-top: 1px solid rgba(255,255,255,.1); padding-top: .25rem; }
    body.side-min .side-link, body.side-min .side-link.sub { justify-content: center; padding: .6rem 0; }
    body.side-min .side-link .count { position: absolute; top: 2px; right: 6px; }
    body.side-min .sidebar-plan { justify-content: center; }
}
/* off-canvas (tablet and phone) */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: min(var(--side-w), 86vw); }
    body.side-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    body.side-open .sidebar-backdrop { display: block; }
    .main { margin-left: 0; }
    .content { padding: 1rem .85rem 1.5rem; }
    .user-meta { display: none; }
    .topbar { padding-right: .6rem; }
}

/* ---------- Panels, stats, tables ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1rem; }
.panel-body { padding: 1.1rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-actions .lead-text { color: var(--muted); margin: 0; max-width: 60ch; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1rem; box-shadow: var(--shadow); border-left: 4px solid var(--navy); text-decoration: none; display: block; color: inherit; }
a.stat:hover { border-left-color: var(--red); color: inherit; }
.stat.red { border-left-color: var(--red); } .stat.green { border-left-color: var(--green); } .stat.amber { border-left-color: #E09B1B; }
.stat-label { color: var(--muted); font-size: .86rem; }
.stat-value { font: 800 1.65rem/1.15 var(--head); color: var(--navy-deep); font-variant-numeric: tabular-nums; }
.stat-note { font-size: .8rem; color: var(--muted); }

.table { --bs-table-bg: transparent; margin: 0; font-size: .94rem; }
.table thead th { font: 700 .72rem var(--head); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #F8FAFD; border-bottom: 1px solid var(--line); white-space: nowrap; padding: .65rem .8rem; }
.table td { padding: .65rem .8rem; vertical-align: middle; border-color: #EDF1F7; }
.table tbody tr:hover { background: #FAFCFF; }
.table a.row-link { font-weight: 600; color: var(--navy); text-decoration: none; }
.table a.row-link:hover { text-decoration: underline; color: var(--red-dark); }
.table-count { color: var(--muted); font-size: .86rem; margin: 0; }
.panel-foot { padding: .75rem 1.1rem; border-top: 1px solid var(--line); }
.sub { color: var(--muted); font-size: .84rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

.tag { display: inline-block; font: 700 .68rem var(--head); letter-spacing: .03em; padding: .2rem .5rem; border-radius: 5px; white-space: nowrap; }
.tag-blue { background: #E3EEFB; color: #0D4C92; } .tag-navy { background: #DDE6F5; color: var(--navy-deep); } .tag-green { background: #DFF3E7; color: #14532D; }
.tag-red { background: #FDE4E5; color: #8A0F16; } .tag-amber { background: #FFF0D1; color: #7A4700; } .tag-grey { background: #EBEEF3; color: #47505E; } .tag-teal { background: #D9F1F2; color: #0A5357; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.filters .form-control, .filters .form-select { width: auto; min-width: 130px; font-size: .9rem; padding: .4rem .65rem; }
.filters .grow { flex: 1 1 200px; }
.period-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.period-custom { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; color: var(--muted); font-size: .88rem; }
.period-custom .form-control { width: auto; }

.form-label { font: 600 .82rem var(--head); color: var(--navy-deep); margin-bottom: .3rem; }
.form-label .req { color: var(--red-dark); }
.form-control, .form-select { border: 1.5px solid #C4D0E0; border-radius: 8px; font-size: .97rem; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,97,181,.18); }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-hint { color: var(--muted); font-size: .85rem; }
.form-section { font: 700 .78rem var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .35rem; margin: .6rem 0 0; }

.empty-state { text-align: center; padding: 2.75rem 1rem; color: var(--muted); }
.empty-state .bi { font-size: 2.4rem; color: #A9B8CF; }
.empty-state h2, .empty-state h3 { margin: .6rem 0 .3rem; font-size: 1.1rem; }
.empty-state p { max-width: 46ch; margin: 0 auto 1rem; }

/* ---------- Lead view ---------- */
.kv { display: grid; grid-template-columns: 9.5rem 1fr; gap: .35rem .9rem; margin: 0; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; word-break: break-word; }
.score-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 800 1.3rem var(--head); color: var(--navy-deep); background: conic-gradient(var(--red) calc(var(--p) * 1%), #E6ECF5 0); position: relative; flex: none; }
.score-ring::before { content: ""; position: absolute; inset: 7px; background: #fff; border-radius: 50%; }
.score-ring span { position: relative; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 2.6rem; }
.timeline li::before { content: ""; position: absolute; left: .95rem; top: 1.9rem; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .t-icon { position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%; background: #E3EEFB; color: var(--navy); display: grid; place-items: center; font-size: .95rem; }
.timeline .t-icon.sys { background: #EBEEF3; color: #5B6676; }
.timeline .t-head { font-weight: 600; } .timeline .t-meta { color: var(--muted); font-size: .82rem; }
.timeline .t-body { white-space: pre-wrap; margin-top: .25rem; color: #333; font-size: .94rem; }

/* ---------- Pipeline board ---------- */
.board { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .75rem; align-items: flex-start; }
.board-col { flex: 0 0 270px; background: #E9EEF6; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 215px); }
.board-col-head { padding: .7rem .8rem .5rem; font: 700 .82rem var(--head); color: var(--navy-deep); display: flex; justify-content: space-between; gap: .5rem; border-top: 4px solid var(--navy); border-radius: var(--radius) var(--radius) 0 0; }
.board-col[data-status="Won"] .board-col-head { border-top-color: var(--green); } .board-col[data-status="Lost"] .board-col-head { border-top-color: var(--red); }
.board-col-head small { color: var(--muted); font-weight: 600; }
.board-list { padding: .3rem .55rem .6rem; overflow-y: auto; min-height: 70px; flex: 1; }
.board-list.drag-over { background: #D5E1F3; outline: 2px dashed var(--blue); outline-offset: -4px; border-radius: 8px; }
.board-card { background: #fff; border-radius: 8px; padding: .6rem .7rem; margin-bottom: .5rem; box-shadow: 0 1px 2px rgba(3,42,99,.12); cursor: grab; border-left: 3px solid #B8C6DC; font-size: .9rem; }
.board-card.hot { border-left-color: var(--red); } .board-card.warm { border-left-color: #E09B1B; }
.board-card.dragging { opacity: .45; }
.board-card a { font-weight: 600; color: var(--navy-deep); text-decoration: none; }
.board-card .sub { display: flex; justify-content: space-between; gap: .5rem; margin-top: .2rem; }
.board-card select { margin-top: .4rem; font-size: .8rem; padding: .15rem .4rem; }

/* ---------- Plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.plan-card { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 1.3rem 1.2rem; display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative; }
.plan-card.current { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(6,59,130,.14); }
.plan-card .plan-flag { position: absolute; top: -11px; left: 1rem; background: var(--navy); color: #fff; font: 700 .66rem var(--head); letter-spacing: .06em; padding: .2rem .55rem; border-radius: 5px; text-transform: uppercase; }
.plan-name { font: 800 1.05rem var(--head); letter-spacing: .06em; color: var(--navy-deep); }
.plan-card.supreme .plan-name { color: var(--red-dark); }
.plan-price { font: 800 2rem/1.1 var(--head); color: var(--navy-deep); margin: .5rem 0 .1rem; }
.plan-price small { font: 500 .85rem var(--body); color: var(--muted); }
.plan-tagline { color: var(--muted); font-size: .9rem; min-height: 2.7em; margin-bottom: .9rem; }
.plan-card .btn { margin-top: auto; }
.compare { font-size: .93rem; }
.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { font-size: .78rem; color: var(--navy-deep); }
.compare .yes { color: var(--green); font-size: 1.1rem; } .compare .no { color: #B9C3D3; }
.compare .col-current { background: #F1F6FD; }
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .form-check-input { width: 1.25em; height: 1.25em; }

/* ---------- Inactivity notice ---------- */
.idle-modal { border: 0; border-radius: 16px; border-top: 6px solid var(--red); }
.idle-modal .modal-body { padding: 2rem 1.75rem; }
.idle-icon { width: 72px; height: 72px; border-radius: 50%; background: #FDE4E5; color: var(--red-dark); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 1rem; }
.idle-modal h2 { font-size: 1.35rem; } .idle-text { font-size: 1.1rem; margin-bottom: .3rem; } .idle-sub { color: var(--muted); }
.modal-backdrop.show { opacity: .72; }

.chart-box { position: relative; height: 280px; }
.copy-box { display: flex; gap: .5rem; }
.copy-box input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; background: #F8FAFD; }
.note-box { background: #F1F6FD; border-left: 4px solid var(--navy); border-radius: 0 8px 8px 0; padding: .8rem 1rem; font-size: .93rem; }
.note-box.warn { background: #FFF6E3; border-left-color: #E09B1B; }
.otp-display { font: 800 2.2rem var(--head); letter-spacing: .35em; color: var(--navy-deep); background: #F1F6FD; border: 2px dashed var(--navy); border-radius: 10px; text-align: center; padding: .7rem; }

/* ---------- Public pages ---------- */
body.auth { min-height: 100vh; background: linear-gradient(115deg, transparent 0 62%, rgba(255,255,255,.05) 62% 74%, transparent 74% 80%, rgba(237,28,36,.55) 80% 81.2%, transparent 81.2%), linear-gradient(135deg, var(--navy-deep), var(--navy)); display: flex; align-items: center; justify-content: center; padding: 1.5rem .9rem; }
.auth-wrap { width: 100%; max-width: 440px; } .auth-wrap.wide { max-width: 620px; }
.auth-logo { display: block; background: #fff; border-radius: 12px 12px 0 0; padding: 1.1rem; text-align: center; border-bottom: 3px solid var(--red); }
.auth-logo img { height: 58px; width: auto; }
.auth-card { background: #fff; border-radius: 0 0 12px 12px; padding: 1.6rem 1.5rem 1.7rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card h1 { font-size: 1.35rem; margin-bottom: .3rem; }
.auth-card .lead-text { color: var(--muted); margin-bottom: 1.2rem; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; font-size: .93rem; }
.auth-foot { color: #C9D8EF; text-align: center; font-size: .82rem; margin: 1rem 0 0; }
.hp { position: absolute !important; left: -9999px !important; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .app-footer, .page-actions .btn, .filters { display: none !important; } .main { margin: 0; } }

/* ---------- Directory search ---------- */
.reveal-mobile { display: inline-flex; align-items: center; gap: .4rem; background: #F1F6FD; border: 1px solid #C4D0E0; border-radius: 6px; padding: .2rem .55rem; font: inherit; font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--navy-deep); cursor: pointer; }
.reveal-mobile:hover, .reveal-mobile:focus-visible { background: var(--navy); border-color: var(--navy); color: #fff; }
.reveal-mobile .bi { font-size: .9rem; }
.mobile-full { font-weight: 600; font-variant-numeric: tabular-nums; }
.more-filters > summary { cursor: pointer; font: 700 .85rem var(--head); color: var(--navy); padding: .2rem 0; list-style-position: inside; }
.usage-meter { height: 6px; border-radius: 999px; background: #E6ECF5; overflow: hidden; min-width: 140px; }
.usage-meter > span { display: block; height: 100%; background: var(--navy); }
.usage-meter.high > span { background: var(--red); }
