@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url("vendor/fonts/Vazirmatn-Regular.cdc140628f11.woff2") format('woff2'); }
@font-face { font-family: Vazirmatn; font-weight: 500; font-display: swap; src: url("vendor/fonts/Vazirmatn-Medium.dd2193b32cbe.woff2") format('woff2'); }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url("vendor/fonts/Vazirmatn-Bold.7958481fe611.woff2") format('woff2'); }

:root {
  --brand: #1f4e79;
  --brand-2: #2e75b6;
  --bg: #f4f6fa;
  --card-border: #e3e8ef;
  --muted: #6b7686;
  --bs-body-font-family: Vazirmatn, Tahoma, sans-serif;
  --bs-primary: #1f4e79;
  --bs-primary-rgb: 31, 78, 121;
  --bs-link-color: #1f4e79;
  --bs-link-color-rgb: 31, 78, 121;
  --bs-link-hover-color: #2e75b6;
}

body { background: var(--bg); font-family: var(--bs-body-font-family); font-size: .92rem; }
input, select, textarea, button, .btn, .form-control { font-family: inherit !important; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); --bs-btn-active-bg: #183e60; }
.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); }

.navbar-crm { background: var(--brand); }
.navbar-crm .navbar-brand { font-weight: 700; letter-spacing: -.2px; }
.navbar-crm .nav-link { color: rgba(255,255,255,.82); border-radius: .4rem; padding: .4rem .75rem !important; }
.navbar-crm .nav-link:hover, .navbar-crm .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.25rem 0 1rem; }
.page-head h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .85rem; }

.card { border-color: var(--card-border); border-radius: .7rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom-color: var(--card-border); font-weight: 700; padding: .75rem 1rem; }
.card-header .small { font-weight: 400; }

.stat { padding: 1rem 1.1rem; }
.stat .label { color: var(--muted); font-size: .8rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; margin-top: .15rem; }
.stat.danger .value { color: #b42318; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { color: var(--muted); font-weight: 500; font-size: .8rem; background: #f8fafc; white-space: nowrap; }
.table-hover tbody tr { cursor: default; }
tr.row-link { cursor: pointer; }

.badge { font-weight: 500; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.timeline { position: relative; padding-inline-start: 1.25rem; }
.timeline::before { content: ''; position: absolute; inset-block: .3rem; inset-inline-start: .35rem; width: 2px; background: var(--card-border); }
.tl-item { position: relative; margin-bottom: 1rem; }
.tl-item::before { content: ''; position: absolute; inset-inline-start: -1.13rem; top: .45rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--brand-2); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand-2); }
.tl-item .meta { color: var(--muted); font-size: .8rem; }
.tl-item .body { white-space: pre-wrap; margin-top: .25rem; }

/* customer history: notes, tasks, deals and calls */
.note-compose { background: #f8fafc; border: 1px solid var(--card-border); border-radius: .6rem; padding: .75rem; }
.note-compose textarea { resize: vertical; min-height: 3.2rem; }
.history-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.history-search { max-width: 15rem; }
@media (max-width: 575.98px) { .history-search { max-width: none; } }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { border: 1px solid var(--card-border); background: #fff; color: var(--muted); border-radius: 99px; padding: .2rem .75rem; font-size: .8rem; }
.chip b { color: inherit; font-weight: 700; margin-inline-start: .15rem; }
.chip-open { color: #b54708; border-color: #fcd9a8; }
.chip:hover { border-color: var(--brand-2); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.month-label { position: sticky; top: 0; z-index: 1; background: #fff; color: var(--brand); font-weight: 700; font-size: .82rem; padding: .35rem 0; margin-bottom: .35rem; }
.pinned-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: .6rem; padding: .25rem .9rem .1rem; margin-bottom: 1rem; }
.pinned-box .month-label { background: transparent; color: #b54708; position: static; }
.history .tl-item, .pinned-box .tl-item { padding: .1rem 0 .1rem; }
.tl-item.k-task::before { background: #d97706; box-shadow: 0 0 0 1px #d97706; }
.tl-item.k-deal::before { background: #059669; box-shadow: 0 0 0 1px #059669; }
.tl-item.k-call::before { background: #94a3b8; box-shadow: 0 0 0 1px #94a3b8; }
.tl-item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .4rem; }
.kind-tag { font-weight: 700; color: var(--brand); }
.k-task .kind-tag { color: #b54708; }
.k-deal .kind-tag { color: #047857; }
.k-call .kind-tag { color: #475569; }
.origin { font-size: .68rem; border: 1px solid var(--card-border); border-radius: .3rem; padding: 0 .3rem; color: var(--muted); }
.tl-item:has(.note-actions) .meta { padding-inline-end: 3.2rem; }
.note-actions { position: absolute; top: .1rem; inset-inline-end: 0; display: flex; gap: .15rem; }
.icon-btn { border: 0; background: none; padding: 0 .3rem; font-size: .8rem; opacity: .35; line-height: 1.4; }
.icon-btn:hover, .icon-btn.on { opacity: 1; }
.tl-item:not(:hover) .icon-btn:not(.on) { visibility: hidden; }
@media (hover: none) { .tl-item .icon-btn { visibility: visible !important; } }
.task-line { display: flex; gap: .5rem; align-items: flex-start; }
.task-check { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .3rem; border: 1.5px solid #d97706; border-radius: .3rem; background: #fff; color: #fff; font-size: .75rem; line-height: 1; padding: 0; }
.is-done .task-check { background: #d97706; }
.is-done .task-line .body { text-decoration: line-through; color: var(--muted); }
.deal-line { display: flex; align-items: center; gap: .75rem; margin-top: .25rem; }
.prob { display: inline-flex; align-items: center; gap: .35rem; }
.prob .bar { width: 5rem; }
.prob .bar > span { background: #059669; }
.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.clamp.expanded { display: block; }
.more-btn { border: 0; background: none; color: var(--brand-2); font-size: .78rem; padding: 0; }

/* dashboard activity */
.period-tabs { display: flex; gap: .3rem; }
.period-tabs .chip { text-decoration: none; font-weight: 500; }
.activity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .75rem; }
.activity-grid .metric { border: 1px solid var(--card-border); border-radius: .6rem; padding: .7rem .85rem; background: #fbfcfe; }
.activity-grid .label { color: var(--muted); font-size: .78rem; }
.activity-grid .value { font-size: 1.6rem; font-weight: 700; color: var(--brand); line-height: 1.3; }
.activity-grid .hint { color: var(--muted); font-size: .72rem; min-height: 1.1em; }
.team-table th, .team-table td { white-space: nowrap; }
.team-table .sep { border-inline-start: 2px solid var(--card-border); }

/* access levels */
.access-matrix .cap-col { position: sticky; inset-inline-start: 0; background: #fff; min-width: 15rem; z-index: 1; }
.access-matrix thead th { text-align: center; vertical-align: bottom; }
.access-matrix thead th.cap-col { text-align: start; }
.access-matrix td select { min-width: 10rem; }
.access-matrix .section-row th { background: #f1f5fa; color: var(--brand); font-size: .82rem; position: sticky; inset-inline-start: 0; }

/* confidentiality */
.share-box summary { color: var(--brand-2); cursor: pointer; }
.share-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .1rem .75rem; max-height: 11rem; overflow: auto; padding: .4rem .2rem; }
.share-list .form-check { margin: 0; font-size: .85rem; }
.level-badge { font-size: .68rem; }
.locked { color: var(--muted); font-style: italic; }
.locked-row td { color: var(--muted); }
.secret-docs { border: 1px solid #fcd9a8; background: #fffbf3; border-radius: .6rem; }

.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .3rem; }
.form-text { font-size: .78rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; color: #b42318; font-size: .8rem; }
.section-title { font-weight: 700; font-size: .95rem; color: var(--brand); margin: .25rem 0 .75rem; }

.lookup-results .list-group-item { cursor: pointer; }
.lookup-results .exact { border-inline-start: 3px solid #d97706; }
.selected-customer { background: #ecfdf3; border: 1px solid #abefc6; border-radius: .6rem; padding: .75rem 1rem; }

.nav-tabs .nav-link { color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--brand); font-weight: 700; }
.kv dt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.kv dd { margin-bottom: .65rem; }

.bar { height: .5rem; background: #e8eef6; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-2); }

.preset { display: block; background: #fff; border: 1px solid var(--card-border); border-radius: .6rem; padding: .55rem .85rem; text-decoration: none; color: inherit; max-width: 16rem; }
.preset:hover { border-color: var(--brand-2); box-shadow: 0 2px 8px rgba(16,24,40,.06); color: inherit; }
.filter-menu { max-height: 320px; overflow-y: auto; min-width: 14rem; }
.filter-menu .dropdown-item { white-space: normal; cursor: pointer; }
.pivot th, .pivot td { white-space: nowrap; }
.pivot thead th { position: sticky; top: 0; }
.pivot tbody th { background: #fff; position: sticky; inset-inline-start: 0; }
.pivot .total { background: #f1f5fa !important; font-weight: 700; }
.pivot tfoot th, .pivot tfoot td { border-top: 2px solid var(--card-border); }

/* tasks */
.task-people dt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.task-people dd { margin-bottom: .55rem; }
.person { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--card-border); border-radius: 99px; padding: .05rem .55rem; font-size: .82rem; margin: 0 0 .2rem .2rem; background: #fff; }
.person.done { border-color: #abefc6; background: #ecfdf3; color: #067647; }
.checklist-item { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--card-border); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item .title { flex: 1; }
.checklist-item.done .title { text-decoration: line-through; color: var(--muted); }
.checklist-item .tools { display: flex; gap: .25rem; flex: none; }
.cl-check { flex: none; width: 1.2rem; height: 1.2rem; margin-top: .15rem; border: 1.5px solid var(--brand-2); border-radius: .3rem; background: #fff; color: #fff; font-size: .75rem; line-height: 1; padding: 0; }
.checklist-item.done .cl-check { background: var(--brand-2); }
.report { border: 1px solid var(--card-border); border-radius: .6rem; padding: .6rem .8rem; margin-bottom: .6rem; background: #fff; }
.report.system { background: #f8fafc; border-style: dashed; padding: .35rem .8rem; font-size: .82rem; color: var(--muted); }
.report .meta { color: var(--muted); font-size: .78rem; display: flex; flex-wrap: wrap; gap: .1rem .5rem; }
.report .text { white-space: pre-wrap; margin-top: .2rem; }
.mention { color: var(--brand-2); font-weight: 500; }
.breadcrumb-tasks { font-size: .82rem; color: var(--muted); }
.breadcrumb-tasks a { text-decoration: none; }

/* people picker */
.picker { border: 1px solid var(--bs-border-color); border-radius: .375rem; padding: .4rem; background: #fff; }
.picker-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .35rem; min-height: 1.4rem; }
.picker-chip { border: 1px solid #c7d7ea; background: #eef4fb; color: var(--brand); border-radius: 99px; padding: 0 .55rem; font-size: .8rem; }
.picker-list { max-height: 9.5rem; overflow: auto; margin-top: .35rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0 .75rem; }
.picker-list .form-check { margin: 0; font-size: .85rem; }

/* notifications */
.notif-bell { position: relative; font-size: 1.05rem; }
.notif-count { position: absolute; top: .1rem; inset-inline-end: 0; font-size: .62rem; padding: .15rem .3rem; }
.notif-menu { width: min(22rem, 92vw); }
.notif-item { white-space: normal; font-size: .85rem; border-bottom: 1px solid var(--card-border); }
.notif-row.unread { background: #f3f8fe; }
.toast { background: #fff; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }

@media print {
  .navbar, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
}
