/* Jinercel CRM Lite: maroon brand on a white base */
:root {
  --brand: #7e0000;
  --brand-600: #6a0000;
  --brand-50: #fbf2f2;
  --brand-100: #f3dede;
  --ink: #1d1d1f;
  --muted: #6b6b73;
  --line: #e7e5e4;
  --bg: #f7f6f5;
  --sidebar-w: 236px;
  --bs-primary: #7e0000;
  --bs-primary-rgb: 126, 0, 0;
  --bs-link-color: #7e0000;
  --bs-link-color-rgb: 126, 0, 0;
  --bs-link-hover-color: #5a0000;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: #1d1d1f;
  --bs-border-color: #e7e5e4;
}
body { background: var(--bg); font-size: .925rem; }
a { text-decoration: none; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: #520000; --bs-btn-active-border-color: #520000; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.bg-brand-soft { background: var(--brand-50) !important; }
.form-control:focus, .form-select:focus { border-color: #c98d8d; box-shadow: 0 0 0 .2rem rgba(126, 0, 0, .12); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background-color: var(--brand); border-color: var(--brand); }
.nav-pills .nav-link.active { background: var(--brand); }
.nav-pills .nav-link { color: var(--ink); }

/* demo ribbon */
.demo-bar { background: #1d1d1f; color: #f1f1f1; font-size: .82rem; padding: .4rem 1rem; text-align: center; }
.demo-bar a { color: #ffb3b3; font-weight: 600; }

/* shell */
.app { display: flex; min-height: calc(100vh - 32px); }
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.sidebar .brand img { width: 34px; height: 34px; }
.sidebar .brand b { display: block; font-size: 1.02rem; line-height: 1.1; }
.sidebar .brand small { color: var(--muted); font-size: .72rem; }
.sidebar nav { padding: .8rem .6rem; overflow-y: auto; flex: 1; }
.sidebar .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #9a9aa2; padding: .9rem .8rem .3rem; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; color: #3a3a40; padding: .52rem .8rem; border-radius: .5rem; margin-bottom: 2px; font-weight: 500; }
.sidebar nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #8a8a92; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--brand-50); color: var(--brand); }
.sidebar nav a.active i { color: var(--brand); }
.sidebar nav a .badge { margin-left: auto; }
.sidebar .me { border-top: 1px solid var(--line); padding: .8rem 1rem; display: flex; align-items: center; gap: .6rem; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 650; }
.topbar .search { max-width: 340px; margin-left: auto; }
.content { padding: 1.4rem 1.5rem 3rem; }

.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex: 0 0 auto; }
.avatar.sm { width: 24px; height: 24px; font-size: .6rem; }
.avatar.lg { width: 44px; height: 44px; font-size: .9rem; }

/* cards */
.card { border: 1px solid var(--line); border-radius: .8rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; padding: .8rem 1rem; border-radius: .8rem .8rem 0 0 !important; }
.kpi { padding: 1rem 1.1rem; height: 100%; }
.kpi .label { color: var(--muted); font-size: .78rem; font-weight: 500; }
.kpi .value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; margin-top: .15rem; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi .icon { width: 38px; height: 38px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); font-size: 1.1rem; }
.progress { height: .5rem; background: #efedec; }
.progress-bar { background: var(--brand); }

/* chips and badges */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: #f1f0ef; color: #444; white-space: nowrap; }
.chip .dot { width: .5rem; height: .5rem; border-radius: 50%; }
.stage-pill { display: inline-block; padding: .16rem .55rem; border-radius: .35rem; font-size: .75rem; font-weight: 600; color: #fff; white-space: nowrap; }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: .3rem; font-size: .7rem; font-weight: 600; border: 1px solid; white-space: nowrap; }

/* tables */
.table { --bs-table-hover-bg: #faf8f7; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fbfaf9; border-bottom-width: 1px; white-space: nowrap; }
.table thead th a { color: var(--muted); }
.lead-name { font-weight: 600; color: var(--ink); }
.lead-name:hover { color: var(--brand); }
.small-muted { font-size: .78rem; color: var(--muted); }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ti { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f0ef; color: #555; flex: 0 0 auto; }
.timeline .ti.won { background: #e7f4e8; color: #2e7d32; }
.timeline .ti.lost { background: #eceff1; color: #37474f; }
.timeline .ti.claim, .timeline .ti.assign { background: var(--brand-50); color: var(--brand); }

/* kanban */
.board { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.col-stage { flex: 0 0 272px; background: #efedeb; border-radius: .8rem; display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col-stage header { padding: .75rem .85rem .55rem; border-top: 4px solid; border-radius: .8rem .8rem 0 0; }
.col-stage header b { font-size: .9rem; }
.col-stage .cards { padding: .2rem .55rem .7rem; overflow-y: auto; min-height: 80px; flex: 1; }
.deal { background: #fff; border-radius: .6rem; padding: .65rem .75rem; margin-bottom: .55rem; border: 1px solid var(--line); cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.deal:hover { border-color: #d7c4c4; }
.deal .t { font-weight: 600; font-size: .86rem; color: var(--ink); }
.deal .c { font-size: .76rem; color: var(--muted); }
.deal .v { font-weight: 700; font-size: .84rem; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 8px 20px rgba(0,0,0,.12); }

/* pool */
.pool-card { height: 100%; }
.pool-card .new { font-size: .68rem; }
.countdown { font-size: .74rem; font-weight: 600; }

/* calendar */
.cal { table-layout: fixed; }
.cal td { height: 118px; vertical-align: top !important; padding: .35rem !important; border: 1px solid var(--line); }
.cal td.out { background: #faf9f8; color: #b5b5bb; }
.cal td.today { background: var(--brand-50); }
.cal .d { font-size: .78rem; font-weight: 600; }
.cal .ev { display: block; font-size: .72rem; padding: .1rem .35rem; border-radius: .3rem; margin-top: .2rem; background: #f1f0ef; color: #333; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal .ev.done { text-decoration: line-through; color: #999; }
.cal .ev.overdue { background: #fde8e8; color: #9b1c1c; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-hero { background: linear-gradient(150deg, #7e0000 0%, #4a0000 100%); color: #fff; padding: 3.2rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero h1 { font-size: 2.3rem; font-weight: 750; letter-spacing: -.02em; }
.login-hero li { margin-bottom: .55rem; opacity: .95; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.role-btn { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: .95rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fff; margin-bottom: .75rem; transition: .15s; }
.role-btn:hover { border-color: var(--brand); background: var(--brand-50); }
.role-btn .ri { width: 42px; height: 42px; border-radius: .6rem; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }

@media (max-width: 991px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; box-shadow: 0 0 30px rgba(0,0,0,.15); }
  .sidebar.open { left: 0; }
  .topbar .search { display: none; }
  .content { padding: 1rem; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 2rem; }
}
