@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); }

.backbar { margin-top: .8rem; }
.backbar + .page-head, .backbar + .messages + .page-head { margin-top: .4rem; }
.back-link { display: inline-block; border: 1px solid var(--card-border); border-radius: 99px; padding: .15rem .8rem; font-size: .82rem; text-decoration: none; color: var(--muted); background: #fff; }
.back-link:hover { color: var(--brand); border-color: var(--brand-2); }
.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.k-request::before { background: #7c3aed; box-shadow: 0 0 0 1px #7c3aed; }
.k-request .kind-tag { color: #6d28d9; }
.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: .55; line-height: 1.4; }
.icon-btn.del { color: #b42318; }
.icon-btn:hover, .icon-btn.on { opacity: 1; }
.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; }

.quick-new { border: 0; background: none; color: var(--brand-2); font-size: .78rem; font-weight: 500; padding: 0; }
.quick-new:hover { text-decoration: underline; }

/* text field with a searchable suggestion list */
.suggest-wrap { position: relative; }
.suggest-menu { position: absolute; inset-inline: 0; top: 100%; z-index: 1050; margin: .15rem 0 0; padding: .25rem 0; list-style: none; background: #fff; border: 1px solid var(--card-border); border-radius: .5rem; box-shadow: 0 6px 18px rgba(16,24,40,.12); max-height: 15rem; overflow-y: auto; }
.suggest-menu li { padding: .35rem .75rem; cursor: pointer; font-size: .88rem; }
.suggest-menu li:hover, .suggest-menu li.active { background: #eef4fb; color: var(--brand); }
.suggest-menu li.empty { color: var(--muted); cursor: default; font-size: .8rem; }

/* 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, .chat-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; }

.password-group .eye-btn { border-color: var(--bs-border-color); background: #fff; line-height: 1; }
.password-group .eye-btn:hover { background: #f1f5fa; }
.tag { display: inline-block; border-radius: 99px; padding: .05rem .55rem; font-size: .75rem; font-weight: 500; border: 1px solid; margin: 0 0 .15rem .15rem; }
.tag-blue { color: #1e4f8a; background: #eaf2fc; border-color: #bcd4f2; }
.tag-green { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.tag-orange { color: #b54708; background: #fff6ed; border-color: #fcd9a8; }
.tag-red { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.tag-purple { color: #5925dc; background: #f4f3ff; border-color: #d9d6fe; }
.tag-teal { color: #0e7490; background: #ecfeff; border-color: #a5f0fc; }
.tag-gray { color: #475467; background: #f2f4f7; border-color: #d0d5dd; }

/* task board (kanban), quick add and side panel */
.task-tabs .nav-link { font-weight: 500; }
.quick-add { display: flex; gap: .4rem; align-items: center; background: #fff; border: 1px solid var(--card-border); border-radius: .7rem; padding: .45rem .55rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); flex-wrap: wrap; }
.quick-add .quick-plus { color: var(--brand-2); font-size: 1.3rem; font-weight: 700; padding: 0 .3rem; }
.quick-add .quick-title { flex: 1 1 16rem; border: 0; box-shadow: none; }
.quick-add .quick-title:focus { box-shadow: none; }
.quick-add select { width: auto; max-width: 11rem; }
.quick-add .quick-due { width: 10.5rem; }
.task-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.task-filters .form-control { max-width: 15rem; }
.task-filters .form-select { width: auto; }
.chip-blue.active { background: #1e4f8a; border-color: #1e4f8a; } .chip-green.active { background: #067647; border-color: #067647; }
.chip-orange.active { background: #b54708; border-color: #b54708; } .chip-red.active { background: #b42318; border-color: #b42318; }
.chip-purple.active { background: #5925dc; border-color: #5925dc; } .chip-teal.active { background: #0e7490; border-color: #0e7490; }
.chip-gray.active { background: #475467; border-color: #475467; }
.board { display: grid; grid-template-columns: repeat(4, minmax(15rem, 1fr)); gap: .75rem; overflow-x: auto; align-items: start; }
.board-col { background: #eef2f7; border-radius: .8rem; padding: .5rem; min-height: 14rem; }
.board-col header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .88rem; padding: .25rem .35rem .5rem; }
.board-col.col-todo header { color: #475467; } .board-col.col-doing header { color: var(--brand); }
.board-col.col-review header { color: #b54708; } .board-col.col-done header { color: #067647; }
.board-cards { display: flex; flex-direction: column; gap: .5rem; min-height: 10rem; border-radius: .6rem; transition: background .15s; }
.board-cards.drop-hover { background: rgba(46,117,182,.12); outline: 2px dashed var(--brand-2); outline-offset: 2px; }
.board-empty { color: var(--muted); font-size: .8rem; text-align: center; padding: 1.5rem .5rem; }
.task-card { background: #fff; border: 1px solid var(--card-border); border-inline-start: 3px solid #cfd8e3; border-radius: .6rem; padding: .55rem .65rem; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.task-card:hover, .task-card:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 3px 10px rgba(16,24,40,.08); }
.task-card.prio-high { border-inline-start-color: #f79009; } .task-card.prio-urgent { border-inline-start-color: #d92d20; }
.task-card.dragging { opacity: .45; }
.task-card .tc-top { display: flex; flex-wrap: wrap; gap: .15rem; align-items: center; }
.task-card .tc-prio { font-size: .7rem; color: #b42318; font-weight: 700; margin-inline-start: auto; }
.task-card .tc-title { font-weight: 500; line-height: 1.5; margin: .15rem 0; }
.task-card .tc-sub { font-size: .75rem; color: var(--muted); }
.task-card .tc-progress { height: .3rem; margin: .35rem 0 .1rem; }
.task-card .tc-foot { display: flex; justify-content: space-between; align-items: center; gap: .3rem; margin-top: .35rem; }
.tc-people { display: flex; }
.tc-avatar { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .7rem; display: grid; place-items: center; border: 2px solid #fff; margin-inline-start: -.35rem; }
.tc-avatar:first-child { margin-inline-start: 0; } .tc-avatar.done { background: #12b76a; }
.tc-meta { display: flex; gap: .45rem; font-size: .72rem; color: var(--muted); align-items: center; }
.task-card.overdue .tc-due { color: #b42318; font-weight: 700; }
.task-offcanvas { width: min(46rem, 100vw) !important; }
.task-summary .ts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem 1rem; }
.task-summary .ts-label { font-size: .75rem; color: var(--muted); margin-bottom: .1rem; }
.task-summary .ts-desc { white-space: pre-wrap; margin-top: .75rem; padding-top: .65rem; border-top: 1px dashed var(--card-border); }
.task-summary .ts-action { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--card-border); }
.task-inner-tabs .nav-link { font-weight: 500; }
.task-panel .page-head { margin-top: 0; }
.task-panel .page-head h1 { font-size: 1.1rem; }
@media (max-width: 991.98px) { .board { grid-template-columns: repeat(4, 16rem); } }

/* audit trail */
.audit-changes { list-style: none; padding: 0; margin: .25rem 0 0; font-size: .8rem; }
.audit-changes li { margin-bottom: .1rem; }
.audit-changes .old { color: #b42318; text-decoration: line-through; }
.audit-changes .new { color: #067647; }
.a-badge-create { background: #ecfdf3; color: #067647; } .a-badge-update { background: #eef4fb; color: var(--brand); }
.a-badge-delete { background: #fef3f2; color: #b42318; } .a-badge-restore { background: #fff6ed; color: #b54708; }

/* access levels */
.level-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .75rem; }
.level-card { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--card-border); border-radius: .7rem; background: #fff; text-decoration: none; color: inherit; }
.level-card:hover { border-color: var(--brand-2); color: inherit; box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.level-card.add { border-style: dashed; justify-content: center; }
.cap-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--card-border); flex-wrap: wrap; }
.cap-row:last-child { border-bottom: 0; }
.cap-label { flex: 1 1 14rem; }
.cap-scopes { display: flex; flex-wrap: wrap; gap: .25rem; }
.cap-choice { border: 1px solid var(--card-border); border-radius: 99px; padding: .15rem .65rem; font-size: .8rem; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; }
.cap-choice:has(input:checked) { border-color: var(--brand); background: #eef4fb; color: var(--brand); }
.cap-choice input { margin: 0; }

/* org chart: a top-down tree drawn with borders */
.org-wrap { overflow-x: auto; }
.org-tree, .org-tree ul { display: flex; justify-content: center; padding: 1.1rem 0 0; margin: 0; list-style: none; position: relative; }
.org-tree { padding-top: 0; min-width: max-content; }
.org-tree li { position: relative; padding: 1.1rem .35rem 0; text-align: center; list-style: none; }
.org-tree li::before, .org-tree li::after { content: ''; position: absolute; top: 0; inset-inline-end: 50%; width: 50%; height: 1.1rem; border-top: 2px solid #cfd8e3; }
.org-tree li::after { inset-inline-end: auto; inset-inline-start: 50%; border-inline-end: 2px solid #cfd8e3; }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-inline-end: 2px solid #cfd8e3; border-start-end-radius: 6px; }
.org-tree li:first-child::after { border-start-start-radius: 6px; }
.org-tree ul::before { content: ''; position: absolute; top: 0; inset-inline-start: 50%; height: 1.1rem; border-inline-start: 2px solid #cfd8e3; }
.org-tree > li { padding-top: 0; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-node { display: inline-flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 8.5rem; padding: .55rem .7rem; border: 1px solid var(--card-border); border-radius: .7rem; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); text-decoration: none; color: inherit; }
a.org-node[href]:hover { border-color: var(--brand-2); box-shadow: 0 2px 8px rgba(16,24,40,.08); color: inherit; }
.org-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.org-name { font-weight: 700; font-size: .85rem; }
.org-title { font-size: .8rem; color: var(--brand); font-weight: 500; }
.org-edit { font-size: .68rem; color: var(--muted); visibility: hidden; }
a.org-node[href]:hover .org-edit { visibility: visible; }
.org-dept { font-size: .7rem; border-radius: 99px; padding: 0 .5rem; background: #eaf2fc; color: var(--brand); }
.org-node.no-dept .org-avatar { background: #98a2b3; }
.dept-tree, .dept-tree ul { list-style: none; padding-inline-start: 1.1rem; margin: 0; }
.dept-tree { padding-inline-start: 0; }
.dept-tree li { position: relative; padding: .25rem 0; }
.dept-tree ul li::before { content: '└'; position: absolute; inset-inline-start: -1rem; color: #cfd8e3; }

.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; }
}

/* ===================================================================== tasks, redesigned (2026-10) */
.tasks-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem; margin: .5rem 0 .75rem; border-bottom: 1px solid var(--card-border); }
.tasks-title { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .25rem 1.25rem; }
.tasks-title h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .55rem; }
.task-tabs { gap: .15rem; flex-wrap: wrap; }
.task-tabs .nav-link { color: var(--muted); font-weight: 500; padding: .5rem .8rem; border-bottom: 2.5px solid transparent; border-radius: 0; }
.task-tabs .nav-link:hover { color: var(--brand); }
.task-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }
.tab-count { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 99px; background: #e8eef6; color: var(--brand); font-size: .72rem; text-align: center; }
.task-tabs .active .tab-count { background: var(--brand); color: #fff; }
.tasks-top > .d-flex { margin-bottom: .5rem; }
.view-switch { display: inline-flex; background: #e9eef5; border-radius: .55rem; padding: .15rem; }
.view-switch a { padding: .25rem .7rem; border-radius: .45rem; font-size: .82rem; color: var(--muted); text-decoration: none; }
.view-switch a.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.quick-add { display: block; padding: .35rem .45rem; border-radius: .8rem; box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.quick-add .qa-main { display: flex; align-items: center; gap: .35rem; }
.quick-add .quick-title { flex: 1 1 auto; min-width: 8rem; font-size: .95rem; }
.quick-add .qa-who { width: 9.5rem; flex: none; }
.quick-add .quick-due { width: 9rem; flex: none; }
.quick-add .qa-more-btn { flex: none; border: 1px solid var(--card-border); }
.quick-add.open .qa-more-btn { background: #e8eef6; color: var(--brand); }
.quick-add .qa-extra { display: none; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .5rem .4rem .2rem; margin-top: .35rem; border-top: 1px dashed var(--card-border); font-size: .8rem; color: var(--muted); }
.quick-add.open .qa-extra { display: flex; }
.quick-add .qa-extra label { display: inline-flex; align-items: center; gap: .35rem; }
.quick-add .qa-extra select { width: auto; max-width: 12rem; }
@media (max-width: 575.98px) {
  .quick-add .qa-main { flex-wrap: wrap; }
  .quick-add .quick-title { flex-basis: calc(100% - 2rem); }
  .quick-add .qa-who, .quick-add .quick-due { flex: 1 1 40%; width: auto; }
}

.task-filters { gap: .35rem; }
.task-filters .tf-search { flex: 0 1 16rem; }
.task-filters .tf-search .form-control { max-width: none; }
.task-filters .form-select { width: auto; background-color: #fff; }
.task-filters .tf-sep { width: 1px; height: 1.3rem; background: var(--card-border); margin: 0 .2rem; }
.task-filters .chip { text-decoration: none; }

/* board */
.board { gap: .9rem; }
.board-col { background: #eef2f7; border-radius: .9rem; padding: .45rem; border-top: 3px solid #98a2b3; }
.board-col.col-doing { border-top-color: var(--brand-2); } .board-col.col-review { border-top-color: #f79009; } .board-col.col-done { border-top-color: #12b76a; }
.board-col header { gap: .4rem; justify-content: flex-start; padding: .35rem .4rem .55rem; }
.board-col header .col-name { flex: 1; }
.col-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #98a2b3; flex: none; }
.col-doing .col-dot { background: var(--brand-2); } .col-review .col-dot { background: #f79009; } .col-done .col-dot { background: #12b76a; }
.col-count { background: #fff; color: #475467; border: 1px solid var(--card-border); font-weight: 600; }
.board-cards { max-height: calc(100vh - 15rem); overflow-y: auto; padding: .1rem .15rem .3rem; scrollbar-width: thin; }
.task-card { border-radius: .7rem; padding: .6rem .7rem .55rem; border-inline-start-width: 4px; transition: transform .12s, box-shadow .12s; }
.task-card:hover { transform: translateY(-1px); }
.task-card.overdue { background: linear-gradient(0deg, #fff, #fff), #fff; box-shadow: inset 0 0 0 1px #fecdca; }
.task-card .tc-top { margin-bottom: .2rem; }
.task-card .tc-prio { font-size: .7rem; font-weight: 700; padding: 0 .4rem; border-radius: 99px; }
.tc-prio.prio-high { color: #b54708; background: #fff6ed; } .tc-prio.prio-urgent { color: #b42318; background: #fef3f2; }
.task-card .tc-title { font-weight: 600; font-size: .9rem; line-height: 1.55; color: #1d2939; }
.task-card .tc-sub { font-size: .75rem; }
.tc-progress-row { display: flex; align-items: center; gap: .4rem; margin: .4rem 0 .1rem; font-size: .7rem; color: var(--muted); }
.tc-progress-row .tc-progress { flex: 1; margin: 0; }
.task-card .tc-foot { margin-top: .5rem; }
.tc-meta { gap: .5rem; }
.tc-av { margin-inline-start: -.4rem; position: relative; } .tc-av:first-child { margin-inline-start: 0; }
.tc-av.done::after { content: '✓'; position: absolute; bottom: -.2rem; left: -.15rem; background: #12b76a; color: #fff; border-radius: 50%; width: .8rem; height: .8rem; font-size: .5rem; display: grid; place-items: center; border: 1.5px solid #fff; }
.tc-av .avatar { border: 2px solid #fff; }

/* avatars, chips, pills */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 600; letter-spacing: -.02em; width: 2.1rem; height: 2.1rem; font-size: .78rem; user-select: none; }
.avatar-sm { width: 1.6rem; height: 1.6rem; font-size: .62rem; }
.due-chip { display: inline-flex; align-items: center; gap: .15rem; white-space: nowrap; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 99px; background: #f2f4f7; color: #475467; }
.due-chip.due-late { background: #fef3f2; color: #b42318; } .due-chip.due-today { background: #fff6ed; color: #b54708; }
.due-chip.due-soon { background: #eaf2fc; color: #1e4f8a; } .due-chip.due-closed { background: #ecfdf3; color: #067647; font-weight: 500; }
.status-pill, .prio-pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: .1rem .6rem; border-radius: 99px; white-space: nowrap; }
.status-pill.st-open { background: #eaf2fc; color: #1e4f8a; } .status-pill.st-doing { background: #e0f2fe; color: #026aa2; }
.status-pill.st-review { background: #fff6ed; color: #b54708; } .status-pill.st-done { background: #ecfdf3; color: #067647; }
.status-pill.st-cancelled { background: #f2f4f7; color: #667085; text-decoration: line-through; }
.prio-pill.prio-low { background: #f2f4f7; color: #667085; } .prio-pill.prio-high { background: #fff6ed; color: #b54708; } .prio-pill.prio-urgent { background: #fef3f2; color: #b42318; }
.prio-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.prio-dot.prio-high { background: #f79009; } .prio-dot.prio-urgent { background: #d92d20; }

/* list */
.task-group { overflow: hidden; }
.task-group-head { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .88rem; background: #fff; }
.task-group-head .col-count { margin-inline-start: auto; }
.g-overdue { border-top: 3px solid #d92d20; } .g-overdue .col-dot { background: #d92d20; } .g-overdue .task-group-head { color: #b42318; }
.g-today { border-top: 3px solid #f79009; } .g-today .col-dot { background: #f79009; }
.g-tomorrow .col-dot, .g-week .col-dot { background: var(--brand-2); }
.g-closed .col-dot { background: #12b76a; }
.task-table thead th { font-size: .75rem; color: var(--muted); font-weight: 500; background: #fafbfc; }
.task-table td { padding-top: .6rem; padding-bottom: .6rem; }
.tt-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.tt-sub { display: flex; flex-wrap: wrap; gap: .1rem .7rem; font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.tt-people { display: flex; align-items: center; }

/* detail */
.task-h1 { font-size: 1.3rem; font-weight: 700; line-height: 1.5; }
.task-summary { border-top: 4px solid var(--brand-2); }
.task-summary.st-review { border-top-color: #f79009; } .task-summary.st-done { border-top-color: #12b76a; }
.task-summary.st-cancelled { border-top-color: #98a2b3; } .task-summary.is-late { border-top-color: #d92d20; }
.task-summary .ts-grid { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .5rem; }
.task-summary .ts-item { background: #f8fafc; border: 1px solid #eef1f5; border-radius: .6rem; padding: .5rem .65rem; }
.task-summary .ts-label { font-size: .72rem; margin-bottom: .3rem; }
.ts-people { display: flex; flex-wrap: wrap; gap: .3rem; }
.person-av { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; }
.ts-people .person-av { background: #fff; border: 1px solid var(--card-border); border-radius: 99px; padding: .1rem .15rem .1rem .55rem; }
.ts-people .person-av.done { border-color: #abefc6; background: #ecfdf3; }
.ts-progress { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; }
.task-summary .ts-desc { background: #fffdf5; border: 1px solid #f5ecd0; border-radius: .6rem; padding: .65rem .8rem; line-height: 1.9; }
.task-summary .ts-action { border-top-style: dashed; }
.task-inner-tabs { border-bottom: 0; gap: .15rem; }
.task-inner-tabs .nav-link { color: var(--muted); border: 1px solid transparent; border-bottom: 0; font-size: .86rem; padding: .45rem .8rem; }
.task-inner-tabs .nav-link.active { color: var(--brand); font-weight: 600; border-color: var(--card-border); background: #fff; }

/* reports */
.report-compose { background: #f8fafc; border: 1px solid var(--card-border); border-radius: .8rem; padding: .6rem; transition: box-shadow .15s, border-color .15s; }
.report-compose:focus-within { border-color: #b7cde6; box-shadow: 0 0 0 3px rgba(46,117,182,.1); }
.report-compose .rc-row { display: flex; gap: .55rem; align-items: flex-start; }
.report-compose textarea { border: 0; background: transparent; box-shadow: none !important; resize: vertical; min-height: 3rem; }
.report-compose .rc-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .4rem; padding-top: .45rem; border-top: 1px solid #edf0f4; }
.rc-attach { border: 1px solid var(--card-border); cursor: pointer; }
.file-picked { color: var(--brand); background: #eaf2fc; border-radius: .45rem; padding: .3rem .6rem; margin-top: .4rem; word-break: break-all; }
.report-feed { display: flex; flex-direction: column; gap: .7rem; }
.report-item { display: flex; gap: .55rem; align-items: flex-start; }
.report-bubble { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--card-border); border-radius: .2rem .9rem .9rem .9rem; padding: .5rem .8rem .6rem; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.report-item.mine .report-bubble { background: #f3f8fd; border-color: #d7e5f4; }
.report-bubble .meta { color: var(--muted); font-size: .76rem; display: flex; flex-wrap: wrap; gap: .1rem .55rem; align-items: center; }
.report-bubble .meta b { color: #1d2939; font-size: .84rem; }
.report-bubble .text { white-space: pre-wrap; margin-top: .25rem; line-height: 1.85; word-break: break-word; }
.report-sys { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; color: var(--muted); padding: .1rem 0; padding-inline-start: 2.6rem; position: relative; }
.report-sys::before { content: ''; position: absolute; inset-inline-start: .9rem; top: 50%; width: .45rem; height: .45rem; border-radius: 50%; background: #d0d5dd; transform: translateY(-50%); }
.report-files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.empty-state { text-align: center; color: var(--muted); padding: 1.6rem .5rem; font-size: 1.6rem; }
.empty-state div { font-size: .84rem; margin-top: .3rem; }

/* files */
.dropzone .dz-label { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.25rem; border: 2px dashed #c7d2e0; border-radius: .9rem; background: #f8fafc; cursor: pointer; text-align: center; transition: background .15s, border-color .15s; }
.dropzone .dz-label:hover, .dropzone.dz-over .dz-label { border-color: var(--brand-2); background: #eef5fc; }
.dropzone.busy .dz-label { opacity: .6; pointer-events: none; }
.dropzone .dz-icon { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: #e3edf8; color: var(--brand); font-size: 1.1rem; margin-bottom: .2rem; }
.report-compose.dz-over { border-color: var(--brand-2); background: #eef5fc; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .55rem; }
.file-card { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--card-border); border-radius: .7rem; padding: .45rem .55rem; min-width: 0; }
.file-card:hover { border-color: #b7cde6; }
.file-card.compact { max-width: 17rem; padding: .3rem .45rem; background: #f8fafc; }
.fc-thumb { width: 2.9rem; height: 2.9rem; flex: none; border-radius: .5rem; background: #f2f4f7; display: grid; place-items: center; overflow: hidden; text-decoration: none; position: relative; }
.compact .fc-thumb { width: 2.2rem; height: 2.2rem; }
.fc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fc-thumb span { font-size: 1.3rem; line-height: 1; }
.fc-thumb small { position: absolute; bottom: .1rem; font-size: .5rem; color: #667085; font-weight: 700; }
.fc-body { flex: 1; min-width: 0; }
.fc-name { display: block; font-size: .84rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: #1d2939; }
.fc-meta { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-tools { display: flex; gap: .15rem; flex: none; }
.fc-tools a, .fc-tools button { border: 0; background: none; width: 1.7rem; height: 1.7rem; border-radius: .4rem; display: grid; place-items: center; text-decoration: none; color: #475467; font-size: .85rem; }
.fc-tools a:hover, .fc-tools button:hover { background: #f2f4f7; }
.fc-tools form { margin: 0; }

/* ===================================================================== daily reports */
.daily-nav { display: flex; align-items: center; gap: .35rem; }
.daily-nav input { width: 8.5rem; text-align: center; }
.daily-list { display: flex; flex-direction: column; gap: .65rem; }
.daily-card { background: #fff; border: 1px solid var(--card-border); border-radius: .8rem; padding: .75rem .9rem; border-inline-start: 4px solid #12b76a; }
.daily-card.has-issues { border-inline-start-color: #f79009; }
.daily-card.missing { border-inline-start-color: #d0d5dd; background: #fafbfc; }
.dc-head { display: flex; align-items: center; gap: .6rem; }
.daily-stats { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.stat-chip { font-size: .74rem; background: #f2f4f7; color: #344054; border-radius: 99px; padding: .1rem .55rem; white-space: nowrap; }
.daily-body { margin-top: .5rem; }
.db-sec { margin-top: .45rem; }
.db-label { font-size: .74rem; color: var(--muted); font-weight: 600; margin-bottom: .1rem; }
.db-text { line-height: 1.9; word-break: break-word; }
.db-sec.issues .db-text { background: #fff6ed; border-radius: .45rem; padding: .3rem .6rem; color: #93370d; }
.daily-feedback { margin-top: .6rem; background: #f3f8fd; border: 1px solid #d7e5f4; border-radius: .6rem; padding: .5rem .7rem; font-size: .88rem; }
.daily-mine textarea { line-height: 1.9; }

/* the top menu keeps one line on laptop screens */
@media (min-width: 1200px) {
  .navbar-crm .navbar-nav .nav-link { white-space: nowrap; padding-inline: .5rem; font-size: .86rem; }
  .navbar-crm .navbar-nav { gap: 0 !important; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .navbar-crm .navbar-nav .nav-link { padding-inline: .35rem; font-size: .8rem; }
  .navbar-crm .navbar-brand { font-size: 1rem; margin-left: .5rem; }
}

/* ===================================================================== staff monitoring */
.mon-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.mon-stat { background: #fff; border: 1px solid var(--card-border); border-radius: .7rem; padding: .65rem .85rem; display: flex; flex-direction: column; gap: .1rem; }
.mon-stat b { font-size: 1.35rem; line-height: 1.3; }
.mon-stat b small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.mon-stat span:last-child { color: var(--muted); font-size: .78rem; }
.mon-stat.warn b { color: #b54708; } .mon-stat.bad b { color: #b42318; }
.mon-stat .dot { margin-bottom: .15rem; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #d0d5dd; vertical-align: middle; }
.dot-online { background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
.dot-idle { background: #f79009; box-shadow: 0 0 0 3px #fef0c7; }
.dot-present { background: #2e75b6; } .dot-absent, .dot-offline { background: #d0d5dd; }
.mon-table td { white-space: nowrap; }
.mon-bar { height: .4rem; background: #f2f4f7; border-radius: 99px; overflow: hidden; margin-bottom: .15rem; }
.mon-bar span { display: block; height: 100%; background: linear-gradient(90deg, #2e75b6, #12b76a); border-radius: 99px; }
.mon-actions .list-group-item { font-size: .84rem; }

/* ===================================================================== chat */
.chat-app { display: grid; grid-template-columns: 20rem 1fr; height: calc(100vh - 7.5rem); min-height: 28rem; background: #fff; border: 1px solid var(--card-border); border-radius: .8rem; overflow: hidden; }
.chat-side { border-inline-end: 1px solid var(--card-border); display: flex; flex-direction: column; min-height: 0; }
.chat-side-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .8rem .4rem; }
.chat-search { margin: 0 .8rem .5rem; width: auto; }
.chat-rooms { overflow-y: auto; flex: 1; }
.chat-room-item { display: flex; gap: .6rem; align-items: center; padding: .55rem .8rem; text-decoration: none; color: inherit; border-inline-start: 3px solid transparent; }
.chat-room-item:hover { background: #f6f8fb; }
.chat-room-item.active { background: #eaf2fc; border-inline-start-color: var(--brand); }
.chat-room-item .avatar { position: relative; width: 2.6rem; height: 2.6rem; font-size: .85rem; }
.online-dot { position: absolute; bottom: 0; left: 0; width: .7rem; height: .7rem; border-radius: 50%; background: #12b76a; border: 2px solid #fff; }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cr-top, .cr-bottom { display: flex; justify-content: space-between; gap: .4rem; align-items: center; min-width: 0; }
.cr-top b { font-weight: 600; }
.cr-at { font-size: .72rem; color: var(--muted); flex: none; }
.cr-bottom { font-size: .8rem; color: #475467; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f4f6fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23e3e8ef'/%3E%3C/svg%3E"); }
.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 18rem; }
.chat-empty div { font-size: 2.6rem; }
.chat-room { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; background: #fff; border-bottom: 1px solid var(--card-border); }
.chat-back { display: none; }
.min-w-0 { min-width: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.chat-day { text-align: center; margin: .6rem 0 .3rem; }
.chat-day span { background: rgba(16,24,40,.08); color: #475467; font-size: .72rem; padding: .1rem .7rem; border-radius: 99px; }
.chat-sys { text-align: center; font-size: .76rem; color: var(--muted); margin: .2rem 0; }
.chat-more { text-align: center; margin-bottom: .4rem; }
.chat-msg { display: flex; flex-direction: column; max-width: min(75%, 36rem); position: relative; }
.chat-msg.mine { align-self: flex-start; align-items: flex-start; }
.chat-msg.theirs { align-self: flex-end; align-items: flex-end; }
.chat-who { font-size: .74rem; font-weight: 600; margin: 0 .5rem .05rem; }
.chat-bubble { background: #fff; border-radius: 1rem; padding: .4rem .7rem .25rem; box-shadow: 0 1px 1px rgba(16,24,40,.08); min-width: 4.5rem; }
.chat-msg.mine .chat-bubble { background: #dcecfb; border-start-start-radius: .3rem; }
.chat-msg.theirs .chat-bubble { border-start-end-radius: .3rem; }
.chat-text { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.chat-meta { font-size: .68rem; color: #667085; text-align: end; margin-top: .05rem; }
.chat-meta .tick { margin-inline-start: .25rem; color: #98a2b3; letter-spacing: -.25em; }
.chat-meta .tick.seen { color: #2e90fa; }
.chat-quote { display: block; border-inline-start: 3px solid var(--brand-2); background: rgba(46,117,182,.08); border-radius: .35rem; padding: .15rem .5rem; margin-bottom: .25rem; text-decoration: none; color: inherit; font-size: .8rem; }
.chat-quote b { display: block; color: var(--brand); font-size: .74rem; }
.chat-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; }
.chat-img img { max-width: 100%; max-height: 16rem; border-radius: .6rem; display: block; margin: .15rem 0; }
.chat-file { display: flex; gap: .35rem; align-items: center; background: rgba(16,24,40,.04); border-radius: .5rem; padding: .3rem .5rem; text-decoration: none; margin: .15rem 0; word-break: break-all; }
.chat-tools { position: absolute; top: .1rem; display: none; gap: .1rem; background: #fff; border: 1px solid var(--card-border); border-radius: 99px; padding: .05rem .2rem; box-shadow: 0 2px 6px rgba(16,24,40,.1); }
.chat-msg.mine .chat-tools { inset-inline-start: calc(100% + .3rem); }
.chat-msg.theirs .chat-tools { inset-inline-end: calc(100% + .3rem); }
.chat-msg:hover .chat-tools { display: flex; }
.chat-tools button { border: 0; background: none; font-size: .8rem; padding: .05rem .3rem; border-radius: 99px; }
.chat-tools button:hover { background: #f2f4f7; }
.chat-msg.flash .chat-bubble { box-shadow: 0 0 0 3px #fdb022; }
.chat-replybar { display: flex; align-items: center; gap: .5rem; background: #fff; border-top: 1px solid var(--card-border); border-inline-start: 3px solid var(--brand-2); padding: .35rem .8rem; font-size: .85rem; }
.chat-compose { display: flex; align-items: flex-end; gap: .45rem; padding: .55rem .7rem; background: #fff; border-top: 1px solid var(--card-border); }
.chat-compose textarea { resize: none; max-height: 10rem; border-radius: 1.1rem; line-height: 1.7; }
.chat-compose.busy { opacity: .6; pointer-events: none; }
.chat-attach, .chat-send { border-radius: 50%; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; padding: 0; flex: none; }
.chat-send { transform: scaleX(-1); }
.chat-picked { margin-bottom: .25rem; }
#chat-link { margin-inline-end: .1rem; }
#chat-link.active { background: rgba(255,255,255,.12); border-radius: .4rem; }
@media (max-width: 767.98px) {
  .chat-app { grid-template-columns: 1fr; height: calc(100vh - 6.5rem); }
  .chat-app .chat-main { display: none; }
  .chat-app.room-open .chat-side { display: none; }
  .chat-app.room-open .chat-main { display: flex; }
  .chat-back { display: inline-block; }
  .chat-msg { max-width: 88%; }
  .chat-tools { position: static; display: flex; box-shadow: none; border: 0; background: none; }
}

/* ===================================================================== correspondence */
.kind-chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .5rem; border-radius: .35rem; white-space: nowrap; }
.kind-chip.k-internal { background: #f4f3ff; color: #5925dc; }
.kind-chip.k-outgoing { background: #ecfdf3; color: #067647; }
.kind-chip.k-incoming { background: #eff8ff; color: #175cd3; }
.status-pill.ls-draft { background: #f2f4f7; color: #475467; } .status-pill.ls-pending { background: #fff6ed; color: #b54708; }
.status-pill.ls-returned { background: #fef3f2; color: #b42318; } .status-pill.ls-registered { background: #eaf2fc; color: #1e4f8a; }
.status-pill.ls-sent { background: #ecfdf3; color: #067647; } .status-pill.ls-archived { background: #f2f4f7; color: #667085; }
.letter-row { display: flex; align-items: center; gap: .6rem; }
.letter-row.unread { background: #f6faff; }
.letter-row.unread b { font-weight: 800; }
.letter-no { font-weight: 600; color: var(--brand); white-space: nowrap; }
.letter-paper .card-body { padding: 1.4rem 1.6rem; }
.letter-meta { display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; border-bottom: 1px dashed var(--card-border); padding-bottom: .8rem; margin-bottom: 1rem; }
.letter-text { line-height: 2.1; font-size: .97rem; min-height: 8rem; text-align: justify; }
.letter-sign { text-align: left; margin-top: 2rem; }
.letter-body { line-height: 2; font-size: .97rem; }
.person-chip { display: inline-block; background: #f2f4f7; border-radius: 99px; padding: 0 .55rem; margin: .1rem; font-size: .82rem; }
.sign-box { background: #fffcf5; }
