:root {
    --brown-950: #24120b;
    --brown-900: #32180e;
    --brown-800: #4d2614;
    --brown-700: #67361f;
    --brown-600: #815039;
    --accent: #b16a3a;
    --cream: #fffff0;
    --paper: #fffefa;
    --bg: #f5f2ed;
    --line: #e7e0d8;
    --line-strong: #d7cdc3;
    --text: #25201d;
    --muted: #746b64;
    --success: #1f7a52;
    --success-bg: #eaf7f0;
    --danger: #b33a3a;
    --danger-bg: #fbecec;
    --warning: #a36012;
    --warning-bg: #fff4df;
    --info: #3f6686;
    --info-bg: #edf4f9;
    --shadow: 0 6px 22px rgba(45, 27, 17, .055);
    --radius: 10px;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html { font-size: 15px; background: var(--bg); }
body { margin: 0; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.65rem, 2.4vw, 2.2rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin-bottom: 3px; font-size: 1.05rem; letter-spacing: -.015em; }
h3 { font-size: .92rem; margin: 20px 0 8px; }
small { color: var(--muted); }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 40;
    display: flex; flex-direction: column; color: #f7eee7;
    background: linear-gradient(180deg, var(--brown-950), var(--brown-900));
    border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 15px 19px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
    width: 39px; height: 39px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    border-radius: 9px; background: var(--cream); color: var(--brown-800); font-weight: 900; letter-spacing: -.06em;
}
.brand strong { display: block; line-height: 1.2; }
.brand small { display: block; margin-top: 3px; color: #bbaaa0; font-size: .72rem; }
.nav { padding: 14px 10px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 11px; margin: 2px 0; border-radius: 7px; color: #d9cbc2; font-size: .91rem; }
.nav a:hover, .nav a.active { color: white; background: rgba(255,255,255,.085); }
.nav-icon { width: 22px; text-align: center; color: #c99b7c; font-size: .93rem; }
.nav-section { margin: 18px 10px 6px; color: #8f7d72; font-size: .68rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 14px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.12); }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: #744329; font-weight: 800; }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy strong { font-size: .82rem; }
.sidebar-user-copy small { color: #aa998e; font-size: .68rem; }
.icon-button, .button-reset { border: 0; background: none; color: inherit; }
.icon-button { color: #bfaea4; font-size: 1.2rem; padding: 4px; }

.main { margin-left: var(--sidebar-width); min-width: 0; width: calc(100% - var(--sidebar-width)); }
.topbar {
    height: 66px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 0 28px; background: rgba(255,254,250,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.mobile-menu { display: none; border: 0; background: transparent; font-size: 1.4rem; }
.global-search { width: min(510px, 50vw); display: flex; align-items: center; gap: 9px; color: #948981; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.notification-button { position: relative; width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; }
.notification-button span { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 20px; background: var(--danger); color: white; font-size: .62rem; font-weight: 800; }

.content { max-width: 1640px; margin: 0 auto; padding: 28px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.page-header p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: var(--accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; margin-bottom: 5px; }

.button {
    min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 8px;
    background: white; color: var(--text); font-weight: 650; font-size: .84rem; line-height: 1;
}
.button:hover { border-color: #b9aba0; transform: translateY(-1px); }
.button-primary { color: white; background: var(--brown-800); border-color: var(--brown-800); }
.button-primary:hover { background: var(--brown-700); }
.button-danger { color: var(--danger); background: var(--danger-bg); border-color: #efcaca; }
.button-large { min-height: 44px; padding: 10px 18px; }
.alert { padding: 12px 15px; border: 1px solid; border-radius: 8px; margin-bottom: 18px; }
.alert-success { background: var(--success-bg); color: #145a3c; border-color: #c7e6d6; }
.alert-danger { background: var(--danger-bg); color: #8d2929; border-color: #f0caca; }

.panel {
    min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.panel-heading > a { color: var(--brown-700); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.panel-empty { padding: 27px 12px; color: var(--muted); text-align: center; font-size: .86rem; }
.panel-wide { grid-column: span 2; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.compact-stats { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.stat-card { min-width: 0; padding: 17px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card strong { display: block; margin: 7px 0 4px; font-size: 1.45rem; letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-highlight { border-left: 4px solid var(--warning); }
.stat-danger { border-left: 4px solid var(--danger); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }

.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th { padding: 10px 13px; color: var(--muted); background: #faf8f4; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; text-transform: uppercase; font-size: .66rem; letter-spacing: .06em; white-space: nowrap; }
td { padding: 12px 13px; border-bottom: 1px solid #eee8e2; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fdfbf8; }
.table-action { color: var(--brown-700); font-weight: 750; font-size: .78rem; white-space: nowrap; }
.two-lines, .two-lines small { display: block; }
.actions-cell { display: flex; gap: 8px; }

.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 99px; font-size: .69rem; font-weight: 750; white-space: nowrap; }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: #736a63; background: #eeeae6; }

.entity-cell { display: flex; align-items: center; gap: 10px; }
.entity-logo { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: #eee3d9; color: var(--brown-700); font-weight: 850; }
.entity-logo.large { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 11px; }
.entity-cell strong, .entity-cell small { display: block; }
.entity-cell small { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-hero { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.entity-hero h2 { font-size: 1.25rem; margin-bottom: 7px; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #eee8e2; }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { margin-top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #c5bbb3; flex: 0 0 auto; }
.feed-item.unread .feed-dot { background: var(--accent); box-shadow: 0 0 0 4px #f5e8df; }
.feed-item strong, .feed-item small, .feed-item time { display: block; }
.feed-item strong { font-size: .82rem; }
.feed-item small { margin: 2px 0 4px; }
.feed-item time { color: #a09790; font-size: .65rem; }

.opportunity-list { display: flex; flex-direction: column; }
.opportunity-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto 120px 50px; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid #eee8e2; }
.opportunity-row:last-child { border-bottom: 0; }
.opportunity-row strong, .opportunity-row span { display: block; }
.opportunity-row > div > span { color: var(--muted); font-size: .78rem; }
.opportunity-value { text-align: right; font-weight: 750; }
.probability { color: var(--muted); text-align: right; }
.task-list { display: flex; flex-direction: column; }
.task-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 9px; padding: 11px 0; border-bottom: 1px solid #eee8e2; align-items: center; }
.task-check { width: 15px; height: 15px; border: 1px solid #bfb3aa; border-radius: 4px; }
.task-item strong, .task-item small { display: block; }
.task-item time { color: var(--muted); font-size: .7rem; }

.filters { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.search-field { min-width: 290px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; min-height: 38px; }
select, input, textarea {
    width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--text);
    padding: 9px 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #9e745c; box-shadow: 0 0 0 3px rgba(177,106,58,.11); }
textarea { resize: vertical; }
.form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-layout.single { grid-template-columns: minmax(0, 900px); }
.form-layout > .panel:last-of-type:nth-child(odd) { grid-column: span 2; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field legend { font-size: .77rem; color: #625950; font-weight: 750; }
.field small { font-size: .7rem; }
.span-2 { grid-column: span 2; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; }
.checkbox-field { flex-direction: row; align-items: center; align-self: end; min-height: 41px; }
.checkbox-field input { width: auto; }
.form-footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; padding: 2px 0 20px; }
.form-actions-right { display: flex; justify-content: flex-end; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 150px; flex: 1; }
.return-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.approval-actions { display: flex; justify-content: flex-end; }

.detail-grid { display: grid; grid-template-columns: minmax(270px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-summary { position: sticky; top: 84px; }
.detail-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.details-list { margin: 0; }
.details-list > div { display: grid; grid-template-columns: 115px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eee8e2; }
.details-list dt { color: var(--muted); font-size: .73rem; }
.details-list dd { margin: 0; font-size: .83rem; overflow-wrap: anywhere; }
.note-box { padding: 12px 13px; border: 1px solid #e8ded6; border-radius: 8px; background: #fbf7f2; font-size: .82rem; }
.metric-block { padding: 15px; margin: -4px -4px 18px; border-radius: 8px; background: var(--brown-900); color: white; }
.metric-block span { display: block; color: #cbb9ae; font-size: .72rem; }
.metric-block strong { display: block; font-size: 1.6rem; margin-top: 4px; letter-spacing: -.04em; }
.progress-block { margin-bottom: 17px; }
.progress-block > div:first-child { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .75rem; }
.progress { height: 6px; overflow: hidden; border-radius: 9px; background: #e9e1da; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.record-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee8e2; }
.record-card.static { cursor: default; }
.record-card:last-child { border-bottom: 0; }
.record-card strong, .record-card small { display: block; }
.mini-record { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eee8e2; }
.mini-record:last-child { border-bottom: 0; }
.mini-record strong, .mini-record small { display: block; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 9px; padding: 8px 0; }
.timeline-item > span { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #f3e6dc; }
.timeline-item p { margin: 3px 0; font-size: .82rem; }
.action-panel { border-top: 4px solid var(--accent); }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(265px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kanban-column { background: #ebe6df; border: 1px solid #ded5cc; border-radius: 10px; padding: 10px; min-height: 300px; }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; padding: 4px 5px 10px; }
.kanban-heading strong { font-size: .79rem; }
.kanban-heading span { min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 20px; background: white; font-size: .68rem; }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; }
.kanban-card { padding: 12px; background: white; border: 1px solid #ded6cf; border-radius: 8px; box-shadow: 0 3px 10px rgba(48,30,19,.04); }
.kanban-card:hover { border-color: #bca89a; transform: translateY(-1px); }
.kanban-company { display: block; color: var(--accent); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.kanban-card strong { display: block; margin: 4px 0 6px; font-size: .88rem; }
.kanban-card p { color: var(--muted); font-size: .74rem; min-height: 32px; margin-bottom: 8px; }
.kanban-meta { display: flex; justify-content: space-between; font-size: .76rem; font-weight: 750; margin-bottom: 7px; }
.kanban-card small { font-size: .66rem; }
.kanban-empty { padding: 25px 8px; color: #91867e; text-align: center; font-size: .75rem; border: 1px dashed #cfc4bb; border-radius: 7px; }

.table-progress { width: 90px; height: 5px; display: inline-block; vertical-align: middle; margin-right: 5px; border-radius: 8px; background: #e6ded7; overflow: hidden; }
.table-progress span { display: block; height: 100%; background: var(--accent); }
.inline-payment { display: flex; align-items: center; gap: 5px; }
.inline-payment input { width: 95px; padding: 5px 6px; font-size: .75rem; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.role-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.role-card:hover { border-color: #c4b3a7; transform: translateY(-1px); }
.role-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: #efe3da; color: var(--brown-700); font-size: 1.1rem; }
.role-card p { color: var(--muted); font-size: .78rem; margin: 4px 0 10px; }
.role-stats { grid-column: 2; display: flex; gap: 12px; color: var(--muted); font-size: .7rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.checkbox-card, .permission-card { display: flex; gap: 10px; align-items: flex-start; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.checkbox-card input, .permission-card input { width: auto; margin-top: 3px; }
.checkbox-card strong, .checkbox-card small, .permission-card strong, .permission-card small { display: block; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.permission-card small { margin-top: 3px; font-size: .65rem; }
.toggle-all { font-size: .74rem; color: var(--muted); }
.toggle-all input { width: auto; vertical-align: middle; }

.empty-state { min-height: 55vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-state.compact { min-height: 250px; }
.empty-icon { min-width: 58px; height: 58px; padding: 0 10px; display: grid; place-items: center; border-radius: 13px; background: #eee3da; color: var(--brown-700); font-weight: 900; font-size: 1.1rem; margin-bottom: 13px; }
.empty-state p { color: var(--muted); max-width: 470px; }
.debug-trace { max-width: min(900px, 90vw); max-height: 350px; overflow: auto; text-align: left; padding: 12px; background: #201e1d; color: #f3f0ed; border-radius: 8px; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
    radial-gradient(circle at 10% 0%, rgba(177,106,58,.16), transparent 35%),
    linear-gradient(140deg, var(--brown-950) 0 45%, #eee7df 45% 100%);
}
.auth-card { width: min(430px, 100%); padding: 31px; background: rgba(255,254,250,.98); border: 1px solid rgba(255,255,255,.7); border-radius: 14px; box-shadow: 0 25px 80px rgba(31,18,11,.22); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 35px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-copy h1 { font-size: 1.9rem; }
.auth-copy p { color: var(--muted); margin-bottom: 22px; }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-stack label > span { display: block; margin-bottom: 6px; font-size: .77rem; font-weight: 750; }
.auth-security { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: .68rem; }

@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .panel-wide { grid-column: auto; }
    .form-layout { grid-template-columns: 1fr; }
    .form-layout > .panel:last-of-type:nth-child(odd), .form-footer { grid-column: auto; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px rgba(0,0,0,.22); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }
    .mobile-menu { display: block; }
    .topbar { padding: 0 16px; }
    .global-search { width: auto; flex: 1; }
    .content { padding: 20px 16px; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-summary { position: static; }
    .two-columns { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .top-actions .button { display: none; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-actions { justify-content: flex-start; }
    .stats-grid, .compact-stats { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .filters { align-items: stretch; flex-direction: column; }
    .search-field { min-width: 0; }
    .opportunity-row { grid-template-columns: 1fr auto; }
    .opportunity-value, .probability { text-align: left; }
    .checkbox-grid, .permission-grid { grid-template-columns: 1fr; }
    .return-form { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
}

.compact-form { gap: 10px; }
.task-actions { display:flex; align-items:center; gap:10px; }
.task-actions time { display:block; }

.directory-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #d9e3ea;
    border-radius: 8px;
    background: var(--info-bg);
    color: #31556f;
    font-size: .8rem;
}
.directory-notice strong { white-space: nowrap; }
.directory-row-restricted { background: #fbfaf8; }
.directory-row-restricted .entity-logo { filter: grayscale(.35); opacity: .75; }
.directory-row-restricted .entity-cell strong { color: #5f5852; }

/* Searchable company picker used when creating a sales opportunity. */
.entity-picker { position: relative; }
.entity-picker-control { position: relative; display: flex; align-items: center; }
.entity-picker-control input { padding-left: 35px; padding-right: 35px; }
.entity-picker-icon { position: absolute; left: 11px; z-index: 1; color: var(--muted); pointer-events: none; }
.entity-picker-clear {
    position: absolute; right: 7px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.entity-picker-clear:hover { background: #f1eae4; color: var(--text); }
.entity-picker-results {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; max-height: 340px; overflow-y: auto;
    padding: 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: white;
    box-shadow: 0 16px 38px rgba(56, 35, 24, .15);
}
.entity-picker-option {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 10px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--text);
    text-align: left; cursor: pointer;
}
.entity-picker-option:hover, .entity-picker-option.is-active { background: #f7f1ec; }
.entity-picker-option[aria-selected="true"] { background: #f2e6dc; }
.entity-picker-option-main, .entity-picker-option-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entity-picker-option-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.entity-picker-option-main small, .entity-picker-option-meta small { color: var(--muted); font-size: .69rem; }
.entity-picker-option-meta { flex: 0 0 auto; align-items: flex-end; }
.entity-picker-empty { padding: 20px 14px; text-align: center; color: var(--muted); }
.entity-picker-empty strong, .entity-picker-empty span { display: block; }
.entity-picker-empty strong { color: var(--text); margin-bottom: 4px; }
.entity-picker-empty .button { display: inline-flex; width: auto; margin-top: 12px; }
.field-error { color: #b33a3a !important; }

@media (max-width: 640px) {
    .entity-picker-option-meta small { display: none; }
    .entity-picker-results { max-height: 300px; }
}
.entity-picker-results[hidden], .entity-picker-option[hidden], .entity-picker-empty[hidden], .entity-picker-clear[hidden] { display: none !important; }
.status-dot { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 99px; background: #eeeae6; color: #736a63; font-size: .65rem; font-weight: 750; white-space: nowrap; }
.status-dot.status-active { background: var(--success-bg); color: var(--success); }
.status-dot.status-potential { background: var(--info-bg); color: var(--info); }
.status-dot.status-blocked, .status-dot.status-lost { background: var(--danger-bg); color: var(--danger); }
.status-dot.status-inactive { background: #eeeae6; color: #736a63; }


.inline-delete { display: inline-flex; margin: 0; }
.table-action-danger { color: var(--danger) !important; }
.button-danger-soft { border-color: #e2b8b8 !important; background: #fff7f7 !important; color: var(--danger) !important; }
.button-danger-soft:hover { background: var(--danger-bg) !important; }
.actions-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.table-note { display: block; margin-top: 2px; color: var(--muted); font-size: .65rem; }
.danger-zone { border-color: #e1c1c1 !important; background: #fffafa !important; }
.danger-zone .panel-heading h2 { color: var(--danger); }
.role-delete { grid-column: 2; justify-self: start; }
