.password-input-control { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.password-input-control input { flex: 1; min-width: 0; }
.app-shell .password-input-control .btn { flex: 0 0 auto; min-width: 62px; color: var(--ink); }

:root {
  --ink: #181613;
  --muted: #81796f;
  --cream: #f7f1e7;
  --cream-deep: #eee3d3;
  --paper: #fffdfa;
  --white: #ffffff;
  --sidebar: #151514;
  --sidebar-soft: #23221f;
  --gold: #c6a15b;
  --gold-soft: #ead8ac;
  --gold-pale: #f8efd9;
  --green: #2f6b4f;
  --green-pale: #e7f1e9;
  --red: #a84c45;
  --red-pale: #f6e6e4;
  --amber: #b97824;
  --amber-pale: #fbefdc;
  --line: rgba(51, 40, 27, 0.11);
  --shadow: 0 16px 40px rgba(69, 47, 20, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--cream); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: flex; background: var(--cream); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px; padding: 28px 18px 20px; display: flex; flex-direction: column; overflow: hidden; background: var(--sidebar); color: #fff; }
.sidebar::after { position: absolute; right: -24%; bottom: -2%; z-index: 0; width: 150%; height: 52%; opacity: .18; background: linear-gradient(180deg, rgba(21,21,20,.88) 0%, rgba(21,21,20,.15) 30%, rgba(21,21,20,.02) 100%), url('/assets/aureum-mall-design.jpg') center bottom / cover no-repeat; pointer-events: none; content: ""; }
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 30px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--gold-soft); border: 1px solid rgba(234, 216, 172, .55); border-radius: 50%; font-family: "Playfair Display", serif; font-size: 19px; }
.brand-mark { color: transparent; border: 0; border-radius: 0; background: url('/assets/aureum-logo.png') center / contain no-repeat; }
.brand-logo { display: block; width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; object-position: center; }
.sidebar .brand-logo { width: 42px; height: 42px; }
.brand-title { font-family: "Playfair Display", serif; font-size: 20px; letter-spacing: .05em; }
.brand-subtitle { margin-top: 3px; color: #958d82; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-label { padding: 0 13px 9px; color: #706a61; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px; color: #aaa39a; border: 0; border-radius: 11px; background: transparent; text-align: left; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(198,161,91,.28), rgba(198,161,91,.07)); box-shadow: inset 3px 0 var(--gold); }
.nav-icon { width: 18px; color: currentColor; text-align: center; font-size: 16px; }
.nav-item .nav-label { font-size: 13px; font-weight: 600; }
.nav-item .nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: auto; padding: 0 5px; color: #1b1711; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: var(--gold); font-size: 10px; font-weight: 800; line-height: 1; }
.nav-item.active .nav-badge { background: var(--gold-soft); }
.app-shell .sidebar .nav-item .nav-badge { display: inline-flex; flex: 0 0 auto; min-width: 21px; height: 21px; font-size: 11px; }
.app-shell .sidebar .nav-item .nav-badge[hidden] { display: none; }
.sidebar-footer { margin-top: auto; padding: 15px 12px 0; border-top: 1px solid rgba(255,255,255,.1); }
.secure-note { display: flex; align-items: center; gap: 9px; color: #9f978b; font-size: 11px; line-height: 1.4; }
.secure-dot { width: 8px; height: 8px; border-radius: 50%; background: #7eb393; box-shadow: 0 0 0 4px rgba(126,179,147,.12); }

.main { width: calc(100% - 250px); margin-left: 250px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(247,241,231,.9); backdrop-filter: blur(16px); }
.crumbs { color: var(--muted); font-size: 12px; }
.crumbs strong { color: var(--ink); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.top-search { display: flex; align-items: center; gap: 8px; width: 210px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.55); color: var(--muted); }
.top-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 700; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #62a37d; box-shadow: 0 0 0 4px rgba(98,163,125,.13); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.icon-btn:hover { color: var(--ink); border-color: rgba(198,161,91,.65); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; border-radius: 50%; background: linear-gradient(145deg, #b69c72, #33291e); font-family: "Playfair Display", serif; font-size: 14px; }
.account-wrap { position: relative; }
.user-menu { position: absolute; top: 46px; right: 0; z-index: 30; width: 220px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow); }
.user-menu-name { font-size: 12px; font-weight: 800; }
.user-menu-role { margin: 4px 0 13px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.presence-picker { display: grid; gap: 5px; margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.presence-picker label { color: var(--muted); font-size: 10px; font-weight: 700; }
.presence-picker select { width: 100%; min-height: 31px; padding: 0 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-size: 11px; }
.presence-picker small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.user-menu .btn { width: 100%; }
.page { padding: 35px 38px 50px; max-width: 1600px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.eyebrow { margin-bottom: 8px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-family: "Playfair Display", serif; font-weight: 600; }
h1 { margin-bottom: 8px; font-size: clamp(29px, 3vw, 42px); letter-spacing: -.02em; }
h2 { margin-bottom: 5px; font-size: 25px; }
h3 { margin-bottom: 4px; font-size: 19px; }
.page-subtitle { margin: 0; max-width: 650px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 700; transition: .2s ease; }
.btn-primary { color: #fff; background: var(--ink); box-shadow: 0 8px 18px rgba(24,22,19,.12); }
.btn-primary:hover { background: #383127; transform: translateY(-1px); }
.btn-gold { color: #2d2419; background: var(--gold); box-shadow: 0 8px 18px rgba(198,161,91,.2); }
.btn-gold:hover { background: #d7b875; transform: translateY(-1px); }
.btn-secondary { color: var(--ink); border-color: var(--line); background: var(--paper); }
.btn-secondary:hover { border-color: var(--gold); }
.btn-danger { color: var(--red); border-color: rgba(168,76,69,.25); background: var(--red-pale); }
.btn-sm { min-height: 31px; padding: 0 10px; font-size: 11px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,250,.85); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.kpi-card { position: relative; overflow: hidden; padding: 20px; }
.kpi-card::after { position: absolute; right: -30px; bottom: -40px; width: 110px; height: 110px; border: 1px solid rgba(198,161,91,.18); border-radius: 50%; content: ""; }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.kpi-value { margin: 9px 0 7px; font-family: "Playfair Display", serif; font-size: 29px; }
.kpi-foot { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-link { color: var(--gold); font-size: 11px; font-weight: 700; }

.chart-card { padding: 22px; min-height: 300px; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 174px; padding: 15px 4px 0; border-bottom: 1px solid var(--line); }
.bar-group { display: flex; flex: 1; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.bar { width: 11px; border-radius: 5px 5px 0 0; background: var(--gold); }
.bar.alt { background: var(--cream-deep); }
.bar-labels { display: flex; justify-content: space-around; padding-top: 9px; color: var(--muted); font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.legend i.soft { background: var(--cream-deep); }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 204px; }
.donut { display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--gold) 0 35%, #e4c782 35% 63%, #b6904f 63% 81%, #765c3a 81% 93%, #d8cbb7 93% 100%); }
.donut::before { width: 96px; height: 96px; border-radius: 50%; background: var(--paper); content: ""; }
.donut-label { position: absolute; text-align: center; }
.donut-label strong { display: block; font-family: "Playfair Display", serif; font-size: 24px; }
.donut-label span { color: var(--muted); font-size: 10px; }
.source-list { display: grid; gap: 10px; min-width: 130px; }
.source-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 11px; }
.source-name { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.source-name i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.source-row b { font-size: 11px; }
.progress-row { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 11px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 8px; background: var(--cream-deep); }
.progress-value { height: 100%; border-radius: inherit; background: var(--gold); }
.progress-row b { color: var(--ink); text-align: right; }

.table-card { overflow: hidden; }
.table-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 22px 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { padding: 11px 22px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 22px; border-bottom: 1px solid rgba(51,40,27,.07); font-size: 12px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(239,228,210,.35); }
.person { display: flex; align-items: center; gap: 10px; }
.profile-link-button { display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.profile-link-button:hover .person-name, .profile-link-button:focus-visible .person-name { color: var(--gold); }
.person-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; color: var(--deep-brown, #2a2118); border-radius: 50%; background: var(--gold-pale); font-family: "Playfair Display", serif; font-size: 12px; }
.person-name { font-weight: 700; }
.person-meta { margin-top: 3px; color: var(--muted); font-size: 10px; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 7px; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.badge-hot, .badge-booking { color: #7a4b0b; background: var(--gold-pale); }
.badge-new { color: #726047; background: var(--cream-deep); }
.badge-warm, .badge-follow { color: #805a24; background: var(--amber-pale); }
.badge-closed, .badge-completed { color: var(--green); background: var(--green-pale); }
.badge-overdue, .badge-lost { color: var(--red); background: var(--red-pale); }
.badge-neutral { color: #716b63; background: #eeeae4; }
.table-action { color: var(--gold); border: 0; background: none; font-size: 11px; font-weight: 800; }
.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(247,241,231,.45); }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 185px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.select { min-height: 34px; padding: 0 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--paper); font-size: 11px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 22px; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 10px 11px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 18px; }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-stat { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,250,.7); }
.mini-stat-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.mini-stat-value { margin-top: 8px; font-family: "Playfair Display", serif; font-size: 24px; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline-item::before { position: absolute; top: 12px; bottom: -4px; left: 6px; width: 1px; background: var(--line); content: ""; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 13px; height: 13px; margin-top: 3px; border: 3px solid var(--gold-pale); border-radius: 50%; background: var(--gold); }
.timeline-title { font-size: 12px; font-weight: 700; }
.timeline-copy { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.timeline-time { margin-top: 4px; color: var(--gold); font-size: 10px; }

.chat-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 270px; min-height: 650px; overflow: hidden; }
.chat-sidebar, .chat-details { padding: 20px; background: rgba(239,228,210,.35); }
.chat-sidebar { border-right: 1px solid var(--line); }
.chat-details { border-left: 1px solid var(--line); }
.chat-search { margin-bottom: 21px; }
.chat-label { margin: 17px 0 9px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.channel { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; color: var(--muted); border: 0; border-radius: 8px; background: transparent; font-size: 11px; text-align: left; }
.channel:hover, .channel.active { color: var(--ink); background: var(--paper); }
.unread { display: grid; place-items: center; min-width: 18px; height: 18px; color: #fff; border-radius: 9px; background: var(--gold); font-size: 9px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--line); }
.chat-channel-title { font-family: "Playfair Display", serif; font-size: 19px; }
.chat-channel-copy { margin-top: 4px; color: var(--muted); font-size: 10px; }
.messages { display: grid; gap: 21px; flex: 1; padding: 24px 28px; overflow: auto; }
.message { display: flex; gap: 11px; }
.message.mine { flex-direction: row-reverse; }
.message-body { max-width: 77%; }
.message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.mine .message-meta { justify-content: flex-end; }
.message-meta b { color: var(--ink); font-size: 11px; }
.message-bubble { padding: 11px 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; background: var(--paper); font-size: 12px; line-height: 1.55; }
.mine .message-bubble { border-color: rgba(198,161,91,.25); border-radius: 12px 12px 3px 12px; background: var(--gold-pale); }
.chat-compose { display: flex; align-items: center; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
.chat-compose input { flex: 1; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--paper); font-size: 11px; }
.member-list { display: grid; gap: 12px; }
.member { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.member .person-avatar { width: 28px; height: 28px; font-size: 10px; }
.online { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #6da97f; }
.offline { background: #b1aaa0; }

.notification-wrap { position: relative; }
.notification-button { position: relative; }
.notification-count { position: absolute; top: -4px; right: -4px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; color: #fff; border: 2px solid var(--paper); border-radius: 20px; background: var(--red); font-size: 9px; font-weight: 800; }
.notification-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 30; width: min(360px, calc(100vw - 28px)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.notification-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notification-head small, .notification-item small, .notification-item time { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.notification-filter { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.notification-filter label { font-weight: 700; }
.notification-filter select { min-width: 0; flex: 1; padding: 6px 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font: inherit; }
.notification-item { display: flex; width: 100%; gap: 10px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.notification-item:hover, .notification-item.unread { background: var(--cream-deep); }
.notification-dot { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--gold); }
.notification-item:not(.unread) .notification-dot { background: var(--line); }
.notification-item b { color: var(--ink); font-size: 11px; }
.notification-item time { font-size: 9px; }
.global-search-popover { position: absolute; top: calc(100% + 10px); left: 0; z-index: 29; width: min(480px, calc(100vw - 260px)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.search-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 15px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.search-result:hover { background: var(--cream-deep); }
.search-result > span:nth-child(2) { display: grid; gap: 3px; flex: 1; }
.search-result-type { min-width: 62px; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-result small { color: var(--muted); font-size: 10px; }
.search-result svg { width: 13px; color: var(--muted); }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-sidebar { display: grid; gap: 4px; padding: 14px; position: sticky; top: 85px; }
.settings-sidebar-title { padding: 7px 9px 11px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.settings-tab { padding: 11px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; font-size: 11px; cursor: pointer; }
.settings-tab:hover, .settings-tab.active { color: var(--ink); background: var(--gold-pale); font-weight: 700; }
.settings-content { min-width: 0; }
.settings-section-card { margin-bottom: 18px; }
.settings-note, .settings-note-card { margin-top: 18px; padding: 14px; border: 1px solid rgba(198,161,91,.22); border-radius: 10px; background: var(--gold-pale); }
.settings-note p, .settings-note-card p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-save-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; padding: 14px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.settings-add-form { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-add-form .form-field { margin: 0; }
.settings-add-form input[type=color] { min-height: 38px; padding: 3px; }
.settings-list { display: grid; }
.settings-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-list-row:last-child { border-bottom: 0; }
.settings-list-main { display: flex; align-items: center; gap: 9px; }
.settings-list-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.color-dot { width: 9px; height: 9px; border-radius: 50%; }
.permission-state { display: inline-flex; padding: 5px 7px; border-radius: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.permission-state.allowed { color: var(--green); background: var(--green-pale); }
.permission-state.blocked { color: var(--muted); background: var(--cream-deep); }
.settings-toggle-list { display: grid; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.settings-toggle-row > span { display: grid; gap: 3px; }
.settings-toggle-row small { color: var(--muted); font-size: 10px; }
.settings-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; width: 38px; height: 21px; border-radius: 20px; background: var(--line); transition: background .18s ease; }
.toggle-ui::after { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.16); content: ''; transition: transform .18s ease; }
.settings-toggle-row input:checked + .toggle-ui { background: var(--gold); }
.settings-toggle-row input:checked + .toggle-ui::after { transform: translateX(17px); }

@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .settings-sidebar-title { display: none; }
  .settings-tab { white-space: nowrap; }
  .global-search-popover { width: min(390px, calc(100vw - 180px)); }
  .settings-add-form { grid-template-columns: 1fr 76px auto; }
}

.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: #101820; }
.login-brand { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px 54px; color: #fff; background: #0b0b0b; }
.login-brand-visual { position: absolute; inset: 0; opacity: .78; background: linear-gradient(90deg, rgba(5,8,10,.92) 0%, rgba(5,8,10,.57) 46%, rgba(5,8,10,.86) 100%), linear-gradient(165deg, transparent 0 38%, rgba(201,162,77,.16) 38.2% 38.7%, transparent 39% 100%), linear-gradient(90deg, transparent 0 17%, rgba(222,195,130,.14) 17.2% 17.7%, transparent 18% 31%, rgba(222,195,130,.1) 31.2% 31.8%, transparent 32% 100%), linear-gradient(155deg, #1b2529 0%, #0b0b0b 55%, #1c1711 100%); }
.login-brand-visual { background-image: linear-gradient(90deg, rgba(5,8,10,.9) 0%, rgba(5,8,10,.48) 52%, rgba(5,8,10,.82) 100%), url('/assets/aureum-mall-design.jpg'); background-size: cover; background-position: center; }
.login-brand-visual::before { position: absolute; right: -12%; bottom: -20%; width: 78%; height: 90%; border: 1px solid rgba(227,200,120,.34); border-radius: 50% 50% 0 0; box-shadow: 0 0 0 46px rgba(227,200,120,.035), 0 0 0 92px rgba(227,200,120,.025); content: ""; }
.login-brand-visual::after { position: absolute; inset: 16% 8% 0 auto; width: 35%; opacity: .3; background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.16) 23px 24px), linear-gradient(180deg, transparent, rgba(201,162,77,.18)); clip-path: polygon(32% 0, 100% 13%, 100% 100%, 0 100%, 15% 18%); content: ""; }
.login-brand-content { position: relative; z-index: 1; display: flex; min-height: calc(100vh - 88px); flex-direction: column; justify-content: space-between; }
.login-brand .brand { padding: 0; }
.login-brand .brand-title { color: #fff; }
.login-brand .brand-subtitle { color: #c8b890; }
.login-location { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #c8b890; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.login-copy { max-width: 560px; margin: auto 0; }
.login-copy h1 { max-width: 560px; color: #fff; font-size: clamp(39px, 4vw, 64px); letter-spacing: -.035em; }
.login-copy p { max-width: 470px; color: #c6b9a7; font-size: 14px; line-height: 1.75; }
.login-badge { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 10px; color: var(--gold-soft); border: 1px solid rgba(234,216,172,.3); border-radius: 30px; background: rgba(11,11,11,.3); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.login-feature-row { display: flex; gap: 12px; color: #c6b9a7; font-size: 10px; }
.login-feature { min-width: 112px; padding: 11px 13px; border: 1px solid rgba(201,162,77,.35); border-radius: 10px; background: rgba(20,24,28,.48); box-shadow: 0 8px 24px rgba(0,0,0,.16); backdrop-filter: blur(8px); text-transform: uppercase; letter-spacing: .06em; }
.login-feature strong { display: block; margin-bottom: 5px; color: #fff; font-family: "Playfair Display", serif; font-size: 17px; letter-spacing: 0; text-transform: none; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; background: #101820; }
.login-form { width: min(100%, 430px); padding: 38px; border: 1px solid rgba(201,162,77,.35); border-radius: 22px; color: #f7f3ea; background: linear-gradient(145deg, rgba(27,37,43,.98), rgba(13,18,22,.98)); box-shadow: 0 24px 80px rgba(0,0,0,.34); }
.login-form-brand { display: flex; align-items: center; gap: 12px; padding: 0 0 34px; }
.login-form-brand .brand-mark { width: 34px; height: 34px; border-color: rgba(201,162,77,.7); color: var(--gold-soft); background: transparent; }
.login-form-brand .brand-logo { width: 48px; height: 48px; flex-basis: 48px; }
.login-brand .brand-logo { width: 58px; height: 58px; flex-basis: 58px; }
.loading-screen .brand-logo { width: 56px; height: 56px; margin-bottom: 12px; }
.login-form .brand-title { color: #fff; font-family: "Playfair Display", serif; font-size: 18px; }
.login-form .brand-subtitle { color: var(--gold-soft); }
.login-form .page-subtitle { color: #9ba5a7; }
.login-form .form-field label { color: #c7c1b7; }
.login-form .form-field input { color: #fff; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); }
.login-form .form-field input::placeholder { color: #7f898c; }
.login-form .form-field input:focus { border-color: var(--gold); background: rgba(255,255,255,.09); }
.login-form .form-help { color: #9ba5a7; }
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle { position: absolute; top: 50%; right: 10px; width: 26px; height: 26px; color: var(--gold-soft); border: 0; border-radius: 50%; background: transparent; transform: translateY(-50%); }
.secure-sso { color: #9fbda7; font-size: 10px; font-weight: 700; }
.login-form .btn-primary { color: #17130d; background: linear-gradient(135deg, #e3c878, #b38e3b); }
.login-form .btn-primary:hover { background: linear-gradient(135deg, #f0d98b, #c39e4a); }
.login-routing { display: grid; gap: 5px; margin-top: 18px; padding: 12px 13px; color: #9ba5a7; border: 1px solid rgba(201,162,77,.18); border-radius: 9px; background: rgba(201,162,77,.05); font-size: 10px; line-height: 1.55; }
.login-routing strong { color: var(--gold-soft); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.login-routing b { color: #d9d2c5; font-weight: 600; }
.login-form .demo-note { color: #7f898c; }
.login-form .demo-note strong { color: #c7b375; }
.login-security { margin-top: 18px; color: #6f7b7d; font-size: 9px; letter-spacing: .05em; text-align: center; text-transform: uppercase; }

/* Keep the desktop sign-in experience within one viewport on shorter laptop
   screens; the stacked mobile layout below remains naturally scrollable. */
@media (min-width: 851px) and (max-height: 820px) {
  .login-page { height: 100dvh; min-height: 100dvh; overflow: hidden; }
  .login-brand { height: 100dvh; min-height: 0; padding: 28px 40px; }
  .login-brand-content { min-height: 0; }
  .login-form-wrap { height: 100dvh; min-height: 0; padding: 20px 30px; }
  .login-form { padding: 24px 30px; }
  .login-form-brand { padding-bottom: 18px; }
  .login-form .page-subtitle { margin-bottom: 14px !important; }
  .login-form .form-field { gap: 5px; margin-bottom: 11px; }
  .login-form .form-help { margin: 0 0 14px; }
  .login-form .login-note { margin: 12px 0 0; }
}

/* Dashboard module */
.dashboard-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 25px 28px; border: 1px solid rgba(198,161,91,.32); border-radius: 16px; background: linear-gradient(125deg, #efe4d2, #f8f2e8 62%, #e8d4ae); box-shadow: 0 12px 30px rgba(42,33,24,.07); }
.dashboard-welcome-side { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 12px; }
.dashboard-welcome-side .dashboard-date-filter { justify-content: flex-end; }
.dashboard-welcome-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; }
.dashboard-welcome h2 { margin: 5px 0 6px; color: var(--ink); font-size: clamp(25px, 3vw, 36px); }
.dashboard-welcome p { max-width: 620px; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.dashboard-scope { color: #765c3a; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-welcome-mark { display: grid; place-items: center; width: 68px; height: 68px; flex: 0 0 68px; color: #6f542c; border: 1px solid rgba(198,161,91,.65); border-radius: 50%; background: rgba(255,255,255,.36); font-family: "Playfair Display", serif; font-size: 30px; }
.dashboard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -5px 0 18px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.55); }
.dashboard-toolbar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.dashboard-scope-label { color: #6f542c; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-date-filter { display: flex; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dashboard-date-filter label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.dashboard-date-filter select, .dashboard-date-filter input { min-height: 30px; padding: 6px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--white); font: inherit; text-transform: none; }
.dashboard-date-filter select:focus, .dashboard-date-filter input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.12); }
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dashboard-stat-card { display: flex; align-items: flex-start; gap: 12px; min-height: 113px; padding: 17px; border: 1px solid rgba(198,161,91,.27); border-radius: 14px; background: var(--white); box-shadow: 0 8px 22px rgba(42,33,24,.06); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dashboard-stat-card:hover, .dashboard-stat-card:focus-visible { border-color: rgba(198,161,91,.7); box-shadow: 0 13px 28px rgba(42,33,24,.12); outline: 0; transform: translateY(-2px); }
.dashboard-stat-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; color: #755a30; border: 1px solid rgba(198,161,91,.42); border-radius: 50%; background: #f4ead8; font-size: 13px; font-weight: 700; }
.dashboard-stat-title { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.dashboard-stat-value { margin-top: 7px; color: var(--ink); font-family: "Playfair Display", serif; font-size: 27px; font-weight: 700; }
.dashboard-stat-subtitle { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.dashboard-stat-danger { border-color: rgba(185,74,72,.32); }
.dashboard-stat-danger .dashboard-stat-icon { color: var(--red); border-color: rgba(185,74,72,.25); background: #f8e8e5; }
.dashboard-stat-warning .dashboard-stat-icon { color: var(--amber); border-color: rgba(200,138,45,.28); background: #fbf0d9; }
.dashboard-stat-success .dashboard-stat-icon { color: var(--green); border-color: rgba(47,107,79,.25); background: #e8f1eb; }
.dashboard-chart-grid, .dashboard-content-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.dashboard-chart-card, .dashboard-actions-card, .dashboard-table-card, .dashboard-followup-card { min-width: 0; padding: 21px; }
.dashboard-chart-wide { min-width: 0; }
.dashboard-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.dashboard-card-heading-actions { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.dashboard-recent-agent-filter-label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-recent-agent-filter { min-width: 145px; min-height: 30px; padding: 6px 9px; font-size: 10px; text-transform: none; }
.dashboard-card-heading h3 { margin-bottom: 4px; font-size: 16px; }
.dashboard-card-heading p { color: var(--muted); font-size: 11px; }
.dashboard-agent-filter { position: relative; flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.dashboard-agent-filter summary { min-width: 125px; padding: 7px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--white); cursor: pointer; font: inherit; list-style: none; text-transform: none; }
.dashboard-agent-filter summary::-webkit-details-marker { display: none; }
.dashboard-agent-filter summary:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.12); }
.dashboard-agent-filter-menu { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; display: grid; min-width: 220px; max-height: 280px; padding: 9px; overflow: auto; gap: 7px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--white); box-shadow: 0 12px 28px rgba(16,24,32,.2); text-transform: none; }
.dashboard-agent-filter-menu label { display: flex; align-items: center; gap: 7px; padding: 3px; cursor: pointer; font-size: 10px; font-weight: 500; }
.dashboard-agent-filter-menu input { accent-color: var(--gold); }
.dashboard-agent-filter-actions { display: flex; gap: 6px; padding-top: 7px; border-top: 1px solid var(--line); }
.dashboard-line-chart { position: relative; min-height: 300px; padding-top: 0; overflow: visible; }
.dashboard-line-chart svg { display: block; width: 100%; height: 280px; overflow: visible; }
.dashboard-line-chart .chart-gridline { stroke: rgba(198,161,91,.16); stroke-dasharray: 3 5; stroke-width: 1; }
.dashboard-line-chart .chart-axis { stroke: rgba(198,161,91,.42); stroke-width: 1; }
.dashboard-line-chart .chart-axis-number, .dashboard-line-chart .chart-axis-label { fill: var(--muted); font-family: inherit; font-size: 10px; }
.dashboard-line-chart .chart-axis-title { fill: var(--muted); font-family: inherit; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-line-chart .chart-area { fill: url(#lead-inflow-fill); }
.dashboard-line-chart .chart-line { fill: none; stroke: var(--gold); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.dashboard-line-chart circle { fill: var(--paper); stroke: var(--gold); stroke-width: 2; }
.dashboard-line-hotspots { position: absolute; inset: 0; height: 280px; pointer-events: none; }
.dashboard-line-hotspot { position: absolute; width: 34px; height: 34px; border-radius: 50%; cursor: help; pointer-events: auto; transform: translate(-50%, -50%); }
.dashboard-line-hotspot.is-first .dashboard-chart-tooltip { left: 0; transform: translate(0, 6px); }
.dashboard-line-hotspot.is-first:hover .dashboard-chart-tooltip, .dashboard-line-hotspot.is-first:focus-visible .dashboard-chart-tooltip { transform: translate(0, 0); }
.dashboard-line-hotspot.is-first .dashboard-chart-tooltip::after { left: 17px; }
.dashboard-line-hotspot.is-last .dashboard-chart-tooltip { right: 0; left: auto; transform: translate(0, 6px); }
.dashboard-line-hotspot.is-last:hover .dashboard-chart-tooltip, .dashboard-line-hotspot.is-last:focus-visible .dashboard-chart-tooltip { transform: translate(0, 0); }
.dashboard-line-hotspot.is-last .dashboard-chart-tooltip::after { right: 17px; left: auto; }
.dashboard-chart-labels { display: grid; grid-template-columns: repeat(12, 1fr); color: var(--muted); font-size: 9px; text-align: center; }
.dashboard-source-layout { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 25px; min-height: 245px; }
.dashboard-donut { position: relative; display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; cursor: help; }
.dashboard-donut::before { width: 98px; height: 98px; border-radius: 50%; background: var(--paper); content: ""; }
.dashboard-donut > div { position: absolute; display: grid; justify-items: center; gap: 2px; }
.dashboard-donut strong { color: var(--ink); font-family: "Playfair Display", serif; font-size: 21px; }
.dashboard-donut span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.dashboard-source-list { display: grid; gap: 12px; }
.dashboard-source-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; cursor: help; }
.dashboard-source-row > span { display: inline-flex; align-items: center; gap: 8px; }
.dashboard-source-row i { width: 8px; height: 8px; border-radius: 50%; }
.dashboard-source-row b { color: var(--ink); font-size: 11px; }
.dashboard-performance-list, .dashboard-agent-list, .dashboard-conversion-list { display: grid; gap: 14px; min-height: 245px; align-content: center; }
.dashboard-performance-row { display: grid; grid-template-columns: 94px 1fr 35px; align-items: center; gap: 10px; font-size: 11px; cursor: help; }
.dashboard-performance-row > div:first-child { display: grid; gap: 3px; }
.dashboard-performance-row > div:first-child > span { color: var(--ink); font-weight: 700; }
.dashboard-performance-row small { color: var(--muted); font-size: 9px; }
.dashboard-performance-row b { color: var(--ink); text-align: right; }
.dashboard-performance-track, .dashboard-agent-track, .dashboard-conversion-row > div { height: 8px; overflow: hidden; border-radius: 20px; background: var(--cream-deep); }
.dashboard-performance-track i, .dashboard-agent-track i, .dashboard-conversion-row i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.dashboard-performance-track i.dashboard-overdue, .dashboard-performance-track i.dashboard-missed { background: var(--red); }
.dashboard-performance-track i.dashboard-completed { background: var(--green); }
.dashboard-performance-track i.dashboard-rescheduled { background: var(--amber); }
.dashboard-agent-row { display: grid; grid-template-columns: 31px 1fr 48px; align-items: center; gap: 10px; cursor: help; }
.dashboard-agent-avatar { display: grid; place-items: center; width: 31px; height: 31px; color: #73572c; border-radius: 50%; background: #efe4d2; font-size: 9px; font-weight: 700; }
.dashboard-agent-main { display: grid; gap: 5px; min-width: 0; }
.dashboard-agent-main strong { color: var(--ink); font-size: 11px; }
.dashboard-agent-main span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-agent-track { height: 5px; }
.dashboard-agent-track i { background: var(--gold); }
.dashboard-agent-row > b { color: var(--ink); font-size: 11px; text-align: right; }
.dashboard-conversion-row { display: grid; grid-template-columns: 90px 1fr 55px; align-items: center; gap: 10px; font-size: 10px; cursor: help; }
.dashboard-conversion-row > span { color: var(--muted); }
.dashboard-conversion-row i { background: linear-gradient(90deg, var(--gold), var(--gold-soft)); }
.dashboard-conversion-row b { color: var(--ink); font-size: 10px; text-align: right; }
.dashboard-tooltip-anchor { position: relative; }
.dashboard-tooltip-anchor:focus-visible { outline: 2px solid rgba(198,161,91,.72); outline-offset: 3px; }
.dashboard-chart-tooltip { position: absolute; left: 50%; bottom: calc(100% + 11px); z-index: 30; display: grid; gap: 4px; min-width: 150px; max-width: min(230px, 80vw); padding: 9px 11px; color: #f7f3ea; border: 1px solid rgba(201,162,77,.35); border-radius: 8px; background: #0b1117; box-shadow: 0 16px 34px rgba(0,0,0,.36); font-size: 10px; line-height: 1.35; text-align: left; text-transform: none; white-space: normal; opacity: 0; pointer-events: none; transform: translate(-50%, 6px); transition: opacity .16s ease, transform .16s ease; }
.dashboard-chart-tooltip::after { position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; border-right: 1px solid rgba(201,162,77,.35); border-bottom: 1px solid rgba(201,162,77,.35); background: #0b1117; content: ""; transform: translateX(-50%) rotate(45deg); }
.dashboard-chart-tooltip strong { color: #fff8df; font-size: 11px; font-weight: 800; }
.dashboard-chart-tooltip span { display: block; color: #cbd5df; font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.dashboard-tooltip-anchor:hover .dashboard-chart-tooltip, .dashboard-tooltip-anchor:focus-visible .dashboard-chart-tooltip { opacity: 1; transform: translate(-50%, 0); }
.dashboard-donut .dashboard-chart-tooltip { bottom: auto; top: calc(100% + 13px); }
.dashboard-donut .dashboard-chart-tooltip::after { top: -6px; bottom: auto; border: 0; border-top: 1px solid rgba(201,162,77,.35); border-left: 1px solid rgba(201,162,77,.35); }
.dashboard-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dashboard-quick-actions .btn { flex: 1 1 145px; justify-content: space-between; }
.dashboard-content-grid { grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); }
.dashboard-table-wrap { margin: 0 -4px; }
.dashboard-data-table { min-width: 720px; }
.dashboard-data-table .person { min-width: 150px; }
.dashboard-followup-list { display: grid; gap: 0; }
.dashboard-followup-row { display: grid; grid-template-columns: 65px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.dashboard-followup-row:last-child { border-bottom: 0; }
.dashboard-followup-row.is-overdue { margin: 0 -10px; padding-right: 10px; padding-left: 10px; border-radius: 8px; background: #fcf0ee; }
.dashboard-followup-time { color: var(--gold); font-size: 11px; font-weight: 700; }
.dashboard-followup-main { display: grid; gap: 4px; min-width: 0; }
.dashboard-followup-main strong { color: var(--ink); font-size: 12px; }
.dashboard-followup-main span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); font-size: 12px; text-align: center; }
.dashboard-loading-grid { display: grid; gap: 18px; }
.dashboard-skeleton { position: relative; overflow: hidden; min-height: 120px; border-radius: 14px; background: var(--cream-deep); }
.dashboard-skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); content: ""; animation: dashboardShimmer 1.4s infinite; transform: translateX(-100%); }
.dashboard-skeleton-banner { min-height: 120px; }
.dashboard-skeleton-kpis { min-height: 150px; }
.dashboard-skeleton-charts { min-height: 330px; }
@keyframes dashboardShimmer { to { transform: translateX(100%); } }
.dashboard-error { display: grid; justify-items: center; gap: 9px; padding: 48px 20px; text-align: center; }
.dashboard-error-mark { display: grid; place-items: center; width: 44px; height: 44px; color: var(--red); border: 1px solid rgba(185,74,72,.25); border-radius: 50%; background: #f8e8e5; font-weight: 700; }
.dashboard-error h2 { font-family: "Playfair Display", serif; font-size: 24px; }
.dashboard-error p { max-width: 440px; color: var(--muted); font-size: 12px; }
.form-field { display: grid; gap: 7px; margin-bottom: 17px; }
.form-field label { color: var(--muted); font-size: 11px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 12px 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--white); font-size: 12px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.12); }
.form-field select.tag-multi-select { min-height: 108px; padding: 6px 8px; }
.form-field select.tag-multi-select option { padding: 5px 6px; }
.form-help { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 20px; color: var(--muted); font-size: 11px; }
.checkbox { display: flex; align-items: center; gap: 7px; }
.checkbox input { accent-color: var(--gold); }
.link-gold { color: var(--gold); font-weight: 700; }
.login-form .btn { width: 100%; min-height: 46px; }
.demo-note { margin: 20px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }
.login-error { margin: -4px 0 16px; padding: 10px 12px; color: var(--red); border: 1px solid rgba(168,76,69,.2); border-radius: 9px; background: var(--red-pale); font-size: 11px; }
.loading-screen { display: grid; place-items: center; align-content: center; gap: 15px; min-height: 100vh; color: var(--muted); background: var(--cream); font-size: 12px; }
.access-denied { display: grid; place-items: center; min-height: 62vh; padding: 50px 20px; text-align: center; }
.access-mark { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 22px; color: var(--red); border: 1px solid rgba(168,76,69,.28); border-radius: 50%; background: var(--red-pale); font-size: 26px; }
.access-denied h1 { margin-bottom: 10px; }
.access-denied p { margin-bottom: 15px; color: var(--muted); }
.access-path { margin-bottom: 24px; padding: 9px 12px; color: var(--muted); border-radius: 8px; background: var(--cream-deep); font-size: 11px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(24,22,19,.33); backdrop-filter: blur(3px); }
.import-dialog-backdrop { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 20px; background: rgba(24,22,19,.55); backdrop-filter: blur(4px); }
.import-dialog { width: min(820px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; padding: 24px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 28px 80px rgba(0,0,0,.35); }
.import-dialog .drawer-header { margin-bottom: 18px; }
.import-preview { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); }
.import-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.import-preview .table-wrap { max-height: 260px; overflow: auto; }
.import-preview table { min-width: 980px; }
.import-preview-input { width: 150px; min-height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); font: inherit; font-size: 12px; }
.import-preview-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.import-options { margin-top: 16px; }
.import-result { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); }
.import-result-list { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 51; width: min(490px, 100%); overflow-y: auto; padding: 26px; border-left: 1px solid rgba(198,161,91,.22); background: var(--paper); box-shadow: -24px 0 60px rgba(24,22,19,.18); animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.drawer-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--cream-deep); }
.drawer-section { padding: 19px 0; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border-bottom: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-label { margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.detail-value { font-size: 12px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 13px; }
.form-grid .full { grid-column: 1 / -1; }

.empty-state { padding: 40px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: "Playfair Display", serif; font-size: 20px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 70; padding: 13px 17px; color: #fff; border-radius: 10px; background: var(--sidebar); box-shadow: var(--shadow); font-size: 12px; animation: toastIn .22s ease; }

/* Device appearance preference. Keep the same Aureum gold accent while swapping the
   neutral surfaces so every shared card, table, form, menu, and drawer stays legible. */
html[data-theme="dark"] {
  --ink: #f4f0e8;
  --muted: #b0aaa1;
  --cream: #0d141b;
  --cream-deep: #1a242d;
  --paper: #121c25;
  --white: #18232d;
  --sidebar: #0a1015;
  --sidebar-soft: #17212a;
  --line: rgba(232, 214, 177, .18);
  --gold-pale: #332b1d;
  --green-pale: #183027;
  --red-pale: #351f21;
  --amber-pale: #382b1c;
  --shadow: 0 18px 44px rgba(0, 0, 0, .34);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell { background: var(--cream); color: var(--ink); }
html[data-theme="dark"] .topbar { background: rgba(13, 20, 27, .92); }
html[data-theme="dark"] .top-search,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .user-menu,
html[data-theme="dark"] .presence-picker,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .select,
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .card,
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .global-search-popover { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .top-search input,
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .select { color: var(--ink); }
html[data-theme="dark"] .btn-secondary { color: var(--ink); background: var(--paper); }
html[data-theme="dark"] .btn-primary { color: #17130d; background: var(--gold); }
html[data-theme="dark"] .channel:hover,
html[data-theme="dark"] .channel.active,
html[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .notification-item.unread,
html[data-theme="dark"] .search-result:hover { background: var(--cream-deep); }
html[data-theme="dark"] .message-bubble { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .message-bubble.mine { background: var(--gold-pale); }
html[data-theme="dark"] .table-wrap { scrollbar-color: var(--gold) var(--cream-deep); }
html[data-theme="dark"] .report-filter-bar,
html[data-theme="dark"] .report-metric-card,
html[data-theme="dark"] .report-section { background: #121c25; }

/* Reports used to carry their own dark palette. Keep the same layout, but let the
   active workspace theme control every report surface and label. */
.report-filter-bar,
.report-metric-card,
.report-section { color: var(--ink); border-color: var(--line); background: var(--paper); }
.report-filter-heading h3,
.report-table-card h3,
.report-section h3 { color: var(--ink); }
.report-filter-grid label { color: var(--muted); }
.report-filter-grid select,
.report-filter-grid input { color: var(--ink); border-color: var(--line); background: var(--white); }
.report-filter-footer,
.report-table-card .table-head p,
.report-section > p,
.report-metric-card .report-metric-label,
.report-metric-card small,
.report-loading-state { color: var(--muted); }
.report-metric-card strong { color: var(--ink); }
.report-mini-grid .report-metric-card { background: var(--white); }
.report-bar-row { color: var(--muted); }
.report-bar-value { color: var(--gold); }
.report-drawer { color: var(--ink); border-color: var(--line); background: var(--paper); box-shadow: -20px 0 60px rgba(0, 0, 0, .24); }
.report-drawer h2,
.report-drawer h3 { color: var(--ink); }

.appearance-theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.appearance-theme-option { position: relative; display: grid; gap: 8px; padding: 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; cursor: pointer; }
.appearance-theme-option:hover, .appearance-theme-option:focus-within { border-color: var(--gold); }
.appearance-theme-option input { position: absolute; opacity: 0; }
.appearance-theme-option:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(198, 161, 91, .23); }
.appearance-theme-option:has(input:checked)::after { position: absolute; top: 8px; right: 8px; color: var(--gold); content: '✓'; font-weight: 800; }
.appearance-preview { display: grid; grid-template-columns: 22px 1fr; gap: 4px; height: 44px; padding: 5px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #f7f1e7; }
.appearance-preview span { border-radius: 3px; background: #151514; }
.appearance-preview i { display: block; height: 6px; margin: 3px 0; border-radius: 3px; background: #c6a15b; box-shadow: 0 9px #d8cbb7, 0 18px #eee3d3; }
.appearance-theme-option[data-theme-option="dark"] .appearance-preview { background: #0d141b; }
.appearance-theme-option[data-theme-option="dark"] .appearance-preview span { background: #081016; }
.appearance-theme-option[data-theme-option="dark"] .appearance-preview i { background: #e4c782; box-shadow: 0 9px #52616d, 0 18px #26333e; }
.appearance-theme-option[data-theme-option="system"] .appearance-preview { background: linear-gradient(90deg, #f7f1e7 50%, #0d141b 50%); }
.appearance-theme-option strong { font-size: 12px; }
.appearance-theme-option small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.appearance-example-list { display: grid; gap: 7px; margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--paper) 72%, var(--gold-pale)); }
.appearance-example-list div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.appearance-example-list b { color: var(--ink); font-weight: 700; }
@media (max-width: 620px) { .appearance-theme-options { grid-template-columns: 1fr; } }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .chat-details { display: none; }
  .dashboard-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-chart-grid, .dashboard-content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .sidebar { position: fixed; width: 74px; padding: 18px 9px; }
  .brand { justify-content: center; padding: 0 0 24px; }
  .brand-copy, .sidebar-label, .nav-item > span:not(.nav-icon):not(.nav-badge), .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .nav-item .nav-badge { position: absolute; top: 2px; right: 2px; margin-left: 0; }
  .main { width: calc(100% - 74px); margin-left: 74px; }
  .topbar { padding: 0 20px; }
  .top-search { width: 150px; }
  .page { padding: 28px 20px 40px; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 430px; padding: 30px; }
  .login-brand-content { min-height: 370px; }
  .login-form-wrap { padding: 26px 20px; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-welcome { align-items: flex-start; }
}
@media (max-width: 620px) {
  .grid-4, .grid-3, .grid-2, .metric-strip { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .topbar { min-height: 66px; }
  .crumbs { display: none; }
  .topbar-actions { margin-left: auto; }
  .top-search { width: 120px; }
  .live-pill { display: none; }
  .page { padding: 24px 14px 30px; }
  .card-pad, .chart-card, .kpi-card { padding: 17px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .messages { padding: 20px 15px; }
  .login-feature-row { gap: 8px; }
  .login-feature { min-width: 0; flex: 1; padding: 9px; }
  .login-location { margin-top: 8px; font-size: 9px; }
  .login-form { padding: 25px 20px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .dashboard-kpi-grid { grid-template-columns: 1fr; }
  .dashboard-welcome { padding: 20px; }
  .dashboard-welcome-side { align-items: flex-start; width: 100%; }
  .dashboard-welcome-side .dashboard-date-filter { justify-content: flex-start; }
  .dashboard-welcome-actions { align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; }
  .dashboard-welcome-mark { display: none; }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-date-filter { justify-content: flex-start; }
  .dashboard-chart-card, .dashboard-actions-card, .dashboard-table-card, .dashboard-followup-card { padding: 17px; }
  .dashboard-source-layout { grid-template-columns: 1fr; justify-items: center; }
  .dashboard-source-list { width: 100%; }
  .dashboard-followup-row { grid-template-columns: 58px minmax(0, 1fr); }
  .dashboard-followup-row > div:last-child { grid-column: 2; justify-self: start; }
}

/* Module 7 · Reports */
.report-filter-bar { margin-bottom: 18px; padding: 18px; color: #e5e2e1; border: 1px solid rgba(201,162,77,.18); background: #151f2a; }
.report-filter-heading, .report-filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.report-filter-heading h3, .report-table-card h3 { margin: 4px 0 0; color: #f7f3ea; font-family: "Playfair Display", serif; font-size: 20px; }
.report-filter-heading .badge { flex: 0 0 auto; }
.report-filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; margin-top: 17px; }
.report-filter-grid label { display: grid; gap: 6px; color: #a9a7a5; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.report-filter-grid select, .report-filter-grid input { width: 100%; min-height: 36px; padding: 0 10px; color: #f7f3ea; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; outline: 0; background: #101820; font: inherit; font-size: 11px; text-transform: none; }
.report-filter-grid select:focus, .report-filter-grid input:focus { border-color: rgba(201,162,77,.8); box-shadow: 0 0 0 3px rgba(201,162,77,.12); }
.report-filter-footer { margin-top: 14px; color: #85898d; font-size: 10px; }
.report-filter-footer .btn { flex: 0 0 auto; }
.report-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.report-metric-card { min-width: 0; padding: 15px; border: 1px solid rgba(201,162,77,.16); border-radius: 10px; background: #151f2a; }
.report-metric-card .report-metric-label { color: #a9a7a5; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.report-metric-card strong { display: block; margin-top: 9px; color: #f7f3ea; font-family: "Playfair Display", serif; font-size: 26px; line-height: 1; }
.report-metric-card small { display: block; margin-top: 8px; color: #85898d; font-size: 10px; }
.report-metric-card.success strong { color: #76b98f; }
.report-metric-card.warning strong { color: #ebc168; }
.report-metric-card.danger strong { color: #db8580; }
.report-metric-card.gold strong { color: #e3c878; }
.report-table-card { overflow: hidden; margin-bottom: 18px; padding: 0; }
.report-table-card .table-head { padding: 18px 18px 13px; }
.report-table-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.report-table-card .table-head p { margin: 7px 0 0; color: #85898d; font-size: 10px; }
.report-table-card .table-wrap { margin: 0; border-top: 1px solid rgba(201,162,77,.14); border-radius: 0; }
.report-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-section { min-width: 0; padding: 18px; border: 1px solid rgba(201,162,77,.16); border-radius: 10px; background: #151f2a; }
.report-section h3 { margin: 0; color: #f7f3ea; font-family: "Playfair Display", serif; font-size: 18px; }
.report-section > p { margin: 6px 0 15px; color: #85898d; font-size: 10px; }
.report-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.report-mini-grid .report-metric-card { padding: 12px; background: #101820; }
.report-mini-grid .report-metric-card strong { font-size: 21px; }
.report-bars { display: grid; gap: 10px; margin-top: 16px; }
.report-bar-row { display: grid; grid-template-columns: minmax(85px, 1fr) minmax(90px, 2fr) 40px; align-items: center; gap: 9px; color: #c5c6cb; font-size: 10px; }
.report-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.09); }
.report-bar-track span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, #c9a24d, #e3c878); }
.report-bar-value { color: #e3c878; text-align: right; }
.report-loading-state { display: grid; place-items: center; min-height: 230px; padding: 22px; color: #a9a7a5; text-align: center; }
.report-drawer { position: fixed; inset: 0 0 0 auto; z-index: 55; display: flex; flex-direction: column; width: min(760px, 100vw); overflow: auto; padding: 22px; color: #e5e2e1; border-left: 1px solid rgba(201,162,77,.25); background: #101820; box-shadow: -20px 0 60px rgba(0,0,0,.45); }
.report-drawer > .drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.report-drawer h2 { margin: 4px 0 0; color: #f7f3ea; font-family: "Playfair Display", serif; font-size: 25px; }
.report-drawer-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.report-drawer-metrics .report-metric-card { padding: 11px; }
.report-drawer-metrics .report-metric-card strong { font-size: 19px; }
.report-drawer-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 13px; border-bottom: 1px solid rgba(201,162,77,.18); }
.report-drawer-tabs .btn { flex: 0 0 auto; }
.report-detail-table { margin-top: 15px; }
.report-detail-table table { min-width: 590px; }
.report-drawer .table-wrap { overflow-x: auto; }

@media (max-width: 1080px) {
  .report-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .report-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .report-filter-bar { padding: 14px; }
  .report-filter-heading, .report-filter-footer { align-items: flex-start; flex-direction: column; }
  .report-table-head-actions { justify-content: flex-start; }
  .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-section-grid { grid-template-columns: 1fr; }
  .report-drawer { padding: 16px; }
  .report-drawer-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .report-filter-grid, .report-metric-grid, .report-mini-grid { grid-template-columns: 1fr; }
  .report-metric-grid { gap: 8px; }
  .report-bar-row { grid-template-columns: minmax(70px, .8fr) minmax(80px, 1.6fr) 32px; gap: 6px; }
}

/* Module 8 · Users & Access Management */
.user-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.user-metric { min-width: 0; padding: 15px; border: 1px solid rgba(201,162,77,.16); border-radius: 10px; background: #151f2a; }
.user-metric span, .user-metric small { display: block; color: #a9a7a5; font-size: 10px; }
.user-metric span { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.user-metric strong { display: block; margin: 10px 0 6px; color: #f7f3ea; font-family: "Playfair Display",serif; font-size: 25px; }
.user-metric.gold strong { color: #e3c878; }.user-metric.success strong { color: #76b98f; }
.users-table-card { overflow: hidden; padding: 0; }.user-filter-bar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(120px, 1fr)) auto; gap: 9px; padding: 15px; border-bottom: 1px solid rgba(201,162,77,.15); background: #151f2a; }
.user-filter-bar select { min-height: 35px; padding: 0 8px; color: #f7f3ea; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; background: #101820; font: inherit; font-size: 11px; }
.users-table-wrap { border: 0; border-radius: 0; }.users-table-wrap table { min-width: 930px; }.users-table-wrap td small, .user-activity + small { display: block; margin-top: 4px; color: #85898d; font-size: 9px; }
.user-activity { display: inline-flex; align-items: center; gap: 6px; color: #c5c6cb; }.user-activity .presence-dot { width: 6px; height: 6px; }.presence-dot.online { background: #76b98f; }.presence-dot.away { background: #ebc168; }.presence-dot.offline { background: #676b70; }
.user-empty-state { display: grid; place-items: center; min-height: 220px; padding: 22px; color: #a9a7a5; text-align: center; }.user-empty-state strong { color: #f7f3ea; }.user-empty-state p { margin: 8px 0 14px; }
.user-drawer { width: min(560px, 100vw); }.user-drawer-identity { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }.user-drawer-identity h2 { margin: 4px 0; }.user-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }.user-detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; padding-bottom: 16px; border-bottom: 1px solid rgba(201,162,77,.16); }.user-detail-section { margin-top: 19px; padding-top: 16px; border-top: 1px solid rgba(201,162,77,.13); }.user-detail-section h3 { margin: 0 0 13px; color: #f7f3ea; font-family: "Playfair Display",serif; }.user-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.user-detail-grid small, .user-detail-grid b { display: block; }.user-detail-grid small { margin-bottom: 4px; color: #85898d; font-size: 9px; text-transform: uppercase; }.user-detail-grid b { overflow-wrap: anywhere; color: #e5e2e1; font-size: 11px; }.user-audit-list { display: grid; gap: 9px; }.user-audit-row { display: grid; gap: 3px; padding: 9px; border-left: 2px solid #c9a24d; background: #151f2a; }.user-audit-row b { color: #e3c878; font-size: 10px; text-transform: capitalize; }.user-audit-row span { color: #e5e2e1; font-size: 10px; }.user-audit-row small { color: #85898d; font-size: 9px; }.user-check { display: flex; align-items: center; gap: 8px; color: #c5c6cb; font-size: 11px; }.user-form .drawer-actions { margin-top: 18px; }.account-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }.account-card, .account-password-card { padding: 20px; }.account-card h3, .account-password-card h2 { margin: 5px 0 17px; color: #f7f3ea; font-family: "Playfair Display",serif; }.account-card form .btn { margin-top: 17px; }.account-security-list { display: grid; gap: 13px; margin-bottom: 20px; }.account-security-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(201,162,77,.12); }.account-security-list span { color: #85898d; font-size: 10px; }.account-security-list b { color: #e5e2e1; font-size: 11px; text-align: right; }.account-password-card { max-width: 620px; }.account-password-card form { max-width: 470px; }.password-policy { margin: 12px 0; padding: 10px; color: #a9a7a5; border: 1px dashed rgba(201,162,77,.25); border-radius: 7px; font-size: 10px; line-height: 1.5; }
@media (max-width: 1100px) { .user-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.user-filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }.user-filter-bar .search-box { grid-column: 1 / -1; }.account-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .user-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.user-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }.user-filter-bar .search-box { grid-column: 1 / -1; }.user-filter-bar button { grid-column: 1 / -1; }.user-drawer { width: 100%; }.user-detail-actions .btn { flex: 1 1 calc(50% - 7px); }.account-card, .account-password-card { padding: 15px; } }
@media (max-width: 420px) { .user-summary-grid { grid-template-columns: 1fr; }.user-filter-bar { grid-template-columns: 1fr; }.user-filter-bar .search-box, .user-filter-bar button { grid-column: auto; }.user-detail-grid { grid-template-columns: 1fr; }.user-detail-actions .btn { flex-basis: 100%; } }

/* Leads module: dense enough for pipeline work, calm enough for daily use. */
.lead-summary-grid { margin-bottom: 18px; }
.lead-summary-card { min-height: 128px; padding: 18px; }
.lead-summary-detail { margin-top: 8px; color: var(--muted); font-size: 11px; }
.lead-summary-detail.is-hot { color: var(--red); font-weight: 700; }
.lead-summary-detail.is-warm { color: #9b7134; font-weight: 700; }
.lead-summary-detail.is-blue { color: #567b9e; font-weight: 700; }
.lead-registry-card { overflow: visible; }
.lead-registry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 16px; }
.lead-registry-head h2, .lead-form-section h2 { margin: 0 0 5px; font-family: "Playfair Display", serif; font-size: 22px; }
.lead-registry-head p, .lead-form-section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.lead-status-tabs { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 0 22px; border-bottom: 1px solid var(--line); }
.lead-status-tab { flex: 0 0 auto; padding: 12px 9px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.lead-status-tab:hover, .lead-status-tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.lead-more-menu { position: relative; flex: 0 0 auto; }
.lead-more-menu summary { list-style: none; }
.lead-more-menu summary::-webkit-details-marker { display: none; }
.lead-more-options, .lead-action-options { position: absolute; right: 0; z-index: 12; display: grid; min-width: 175px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
.lead-more-options { top: 100%; }
.lead-more-options button, .lead-action-options button { padding: 9px 10px; color: var(--ink); border: 0; border-radius: 7px; background: transparent; text-align: left; font-size: 11px; cursor: pointer; }
.lead-more-options button:hover, .lead-action-options button:hover { background: var(--cream-deep); }
.lead-filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 15px 22px; border-bottom: 1px solid var(--line); background: #fffdf9; }
.lead-search-field { display: flex; align-items: center; gap: 8px; flex: 1 1 230px; min-height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.lead-search-field span { color: var(--gold); font-size: 18px; }
.lead-search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.lead-table-wrap { border-radius: 0 0 12px 12px; }
.lead-data-table { min-width: 1450px; }
.lead-data-table th { white-space: nowrap; }
.lead-data-table tbody tr[data-lead-module-row], .customer-data-table tbody tr[data-customer-module-row] { cursor: pointer; }
.lead-data-table tbody tr[data-lead-module-row]:hover, .customer-data-table tbody tr[data-customer-module-row]:hover { background: #fffaf0; }
.lead-data-table tbody tr[data-lead-module-row]:focus-visible, .customer-data-table tbody tr[data-customer-module-row]:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.lead-name-button { padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.lead-name-button .person-name { color: var(--ink); }
.lead-name-button:hover .person-name { color: var(--gold); }
.lead-tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 150px; }
.lead-tag { display: inline-flex; padding: 4px 6px; color: #72552d; border: 1px solid #ead8b5; border-radius: 5px; background: #fbf4e5; font-size: 9px; font-weight: 700; white-space: nowrap; }
.lead-action-menu { position: relative; }
.lead-action-menu summary { list-style: none; white-space: nowrap; }
.lead-action-menu summary::-webkit-details-marker { display: none; }
.lead-action-options { top: calc(100% + 4px); right: 0; min-width: 185px; }
.lead-action-options small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.lead-empty-inline { display: grid; justify-items: center; gap: 7px; padding: 40px; text-align: center; }
.lead-empty-inline strong { color: var(--ink); font-family: "Playfair Display", serif; font-size: 18px; }
.lead-empty-inline span { color: var(--muted); font-size: 11px; }
.lead-loading-grid { display: grid; gap: 18px; }
.lead-skeleton { min-height: 145px; border-radius: 14px; background: linear-gradient(90deg, var(--cream-deep), #fff, var(--cream-deep)); background-size: 220% 100%; animation: leadShimmer 1.3s infinite; }
.lead-skeleton-tall { min-height: 460px; }
@keyframes leadShimmer { to { background-position: -220% 0; } }
.lead-error-state { display: grid; justify-items: center; gap: 8px; padding: 55px 20px; text-align: center; }
.lead-error-state h2 { font-family: "Playfair Display", serif; }
.lead-error-state p { max-width: 470px; color: var(--muted); font-size: 12px; }
.lead-create-form { display: grid; gap: 18px; }
.lead-form-section { padding: 24px; }
.lead-other-interest-field[hidden] { display: none !important; }
.lead-form-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.lead-form-section-head .eyebrow { display: block; margin-bottom: 8px; }
.lead-checkbox { margin-top: 28px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; }
.lead-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 4px 2px 14px; color: var(--muted); font-size: 11px; }
.lead-form-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.lead-detail-drawer { width: min(560px, 100%); }
.lead-drawer-tabs { display: flex; gap: 15px; padding: 17px 0 0; border-bottom: 1px solid var(--line); }
.lead-drawer-tabs button { padding: 0 1px 12px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.lead-drawer-tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }
.lead-drawer-tabs span { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; margin-left: 3px; padding: 0 4px; border-radius: 9px; background: var(--cream-deep); font-size: 9px; }
.lead-drawer-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 17px; }
.drawer-inline-form { display: grid; gap: 7px; margin-top: 15px; }
.drawer-inline-form label, #lead-module-note-form label { color: var(--muted); font-size: 10px; font-weight: 700; }
.drawer-form-row { display: flex; align-items: center; gap: 8px; }
.drawer-form-row select, #lead-module-note-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 11px; }
.drawer-action-row { display: flex; flex-wrap: wrap; gap: 7px; }
.lead-notes-list { display: grid; gap: 10px; padding-top: 18px; }
.lead-note { padding: 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.lead-note strong { color: var(--gold); font-size: 10px; text-transform: uppercase; }
.lead-note p { margin: 6px 0; color: var(--ink); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.lead-note time { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.lead-activity-timeline { padding-top: 18px; }
.lead-drawer .btn small { color: inherit; opacity: .65; }

@media (max-width: 760px) {
  .lead-registry-head, .lead-form-section-head, .lead-form-actions { align-items: flex-start; flex-direction: column; }
  .lead-form-actions { padding-bottom: 0; }
  .lead-form-actions > div { justify-content: flex-start; }
  .lead-filter-bar .select { flex: 1 1 140px; }
}

/* Customers module */
.customer-summary-grid { margin-bottom: 18px; }
.customer-summary-card { min-height: 128px; padding: 18px; }
.customer-summary-detail { margin-top: 8px; color: var(--muted); font-size: 11px; }
.customer-summary-detail.is-hot { color: var(--red); font-weight: 700; }
.customer-summary-detail.is-warm { color: #9b7134; font-weight: 700; }
.customer-summary-detail.is-booking { color: #866244; font-weight: 700; }
.customer-summary-detail.is-green { color: var(--green); font-weight: 700; }
.customer-registry-card { overflow: visible; }
.customer-registry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 16px; }
.customer-registry-head h2 { margin: 0 0 5px; font-family: "Playfair Display", serif; font-size: 22px; }
.customer-registry-head p { margin: 0; color: var(--muted); font-size: 11px; }
.customer-status-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 22px; border-bottom: 1px solid var(--line); }
.customer-status-tab { flex: 0 0 auto; padding: 12px 10px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.customer-status-tab:hover, .customer-status-tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.customer-filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 15px 22px; border-bottom: 1px solid var(--line); background: #fffdf9; }
.customer-search-field { display: flex; align-items: center; gap: 8px; flex: 1 1 230px; min-height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.customer-search-field span { color: var(--gold); font-size: 18px; }
.customer-search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.customer-table-wrap { border-radius: 0 0 12px 12px; }
.customer-data-table { min-width: 1260px; }
.customer-data-table th { white-space: nowrap; }
.customer-name-button { padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.customer-name-button:hover .person-name { color: var(--gold); }
.customer-tags, .customer-drawer-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.customer-tag { display: inline-flex; padding: 3px 6px; color: #72552d; border: 1px solid #ead8b5; border-radius: 5px; background: #fbf4e5; font-size: 9px; font-weight: 700; white-space: nowrap; }
.customer-action-menu { position: relative; }
.customer-action-menu summary { list-style: none; white-space: nowrap; }
.customer-action-menu summary::-webkit-details-marker { display: none; }
.customer-action-options { position: absolute; top: calc(100% + 4px); right: 0; z-index: 12; display: grid; min-width: 165px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
.customer-action-options button { padding: 9px 10px; color: var(--ink); border: 0; border-radius: 7px; background: transparent; text-align: left; font-size: 11px; cursor: pointer; }
.customer-action-options button:hover { background: var(--cream-deep); }
.customer-empty-inline { display: grid; justify-items: center; gap: 7px; padding: 40px; text-align: center; }
.customer-empty-inline strong { color: var(--ink); font-family: "Playfair Display", serif; font-size: 18px; }
.customer-empty-inline span { color: var(--muted); font-size: 11px; }
.customer-loading-grid { display: grid; gap: 18px; }
.customer-skeleton { min-height: 145px; border-radius: 14px; background: linear-gradient(90deg, var(--cream-deep), #fff, var(--cream-deep)); background-size: 220% 100%; animation: customerShimmer 1.3s infinite; }
.customer-skeleton-tall { min-height: 430px; }
@keyframes customerShimmer { to { background-position: -220% 0; } }
.customer-error-state { display: grid; justify-items: center; gap: 8px; padding: 52px 20px; text-align: center; }
.customer-error-state h2 { font-family: "Playfair Display", serif; }
.customer-error-state p { max-width: 450px; color: var(--muted); font-size: 12px; }
.customer-detail-drawer { width: min(540px, 100%); }
.customer-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.customer-drawer-tabs { display: flex; gap: 14px; overflow-x: auto; padding: 0 0 1px; border-bottom: 1px solid var(--line); }
.customer-drawer-tabs button { flex: 0 0 auto; padding: 13px 1px 11px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.customer-drawer-tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }
.customer-drawer-tabs span { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; margin-left: 3px; padding: 0 4px; border-radius: 9px; background: var(--cream-deep); font-size: 9px; }
.drawer-section-label { margin-bottom: 14px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.customer-detail-drawer .detail-grid { row-gap: 17px; }
.customer-note-list, .customer-followup-list { display: grid; gap: 10px; padding-top: 17px; }
.customer-note { padding: 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.customer-note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.customer-note-head strong { color: var(--gold); font-size: 10px; text-transform: uppercase; }
.customer-note-head span, .customer-note time { color: var(--muted); font-size: 11px; line-height: 1.5; }
.customer-note p { margin: 7px 0; color: var(--ink); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.drawer .form-hint { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.customer-detail-drawer #customer-module-note-form { display: grid; gap: 8px; }
.customer-detail-drawer #customer-module-note-form label { color: var(--muted); font-size: 10px; font-weight: 700; }
.customer-detail-drawer #customer-module-note-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; font-size: 11px; resize: vertical; }
.customer-status-editor { display: grid; gap: 7px; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.customer-status-editor label { color: var(--muted); font-size: 10px; font-weight: 700; }
.customer-status-editor > div { display: flex; gap: 8px; }
.customer-status-editor select { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 11px; }
.customer-placeholder { padding: 16px; border: 1px dashed rgba(198,161,91,.55); border-radius: 10px; background: #fffaf0; }
.customer-placeholder strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: "Playfair Display", serif; font-size: 17px; }
.customer-placeholder p { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.customer-followup-preview { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf9; }
.customer-followup-preview > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.customer-followup-preview strong { font-size: 11px; }
.customer-followup-preview span { color: var(--muted); font-size: 10px; }
.customer-followup-preview p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  .customer-registry-head { align-items: flex-start; flex-direction: column; }
  .customer-filter-bar .select { flex: 1 1 140px; }
  .customer-detail-drawer { width: 100%; }
}

/* Follow-ups module */
.followup-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.followup-summary-card { min-height: 132px; padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between; }
.followup-summary-card .kpi-value { margin: 10px 0 0; line-height: 1; }
.followup-summary-detail { margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.followup-summary-detail.is-hot { color: #a84d3d; }
.followup-summary-detail.is-warm { color: #a4772d; }
.followup-summary-detail.is-green { color: #3f795a; }
.followup-performance-card { margin-bottom: 18px; padding: 20px 22px; }
.followup-metrics-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.followup-metric { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf9; }
.followup-metric span { color: var(--muted); font-size: 9px; line-height: 1.3; }
.followup-metric strong { color: var(--ink); font-family: "Playfair Display", serif; font-size: 20px; font-weight: 600; }
.followup-registry-card { overflow: visible; }
.followup-filter-bar { align-items: center; }
.followup-filter-bar select { min-height: 34px; padding: 7px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: var(--white); font: inherit; font-size: 11px; }
.followup-table-wrap { overflow-x: auto; }
.followup-table-wrap table { min-width: 1260px; }
.followup-customer-button { display: grid; gap: 4px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.followup-customer-button b { color: var(--ink); font-size: 11px; }
.followup-customer-button span { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.followup-status-tabs { overflow-x: auto; }
.followup-status-tabs .tab { white-space: nowrap; }
.followup-status-tabs .tab span { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; margin-left: 4px; padding: 0 4px; border-radius: 9px; background: var(--cream-deep); color: var(--muted); font-size: 9px; }
.followup-action-menu { position: relative; min-width: 85px; }
.followup-action-menu summary { list-style: none; cursor: pointer; }
.followup-action-menu summary::-webkit-details-marker { display: none; }
.followup-action-options { position: absolute; right: 0; z-index: 5; display: grid; min-width: 155px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 12px 30px rgba(24,22,19,.12); }
.followup-action-options button { padding: 8px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; font-size: 10px; text-align: left; cursor: pointer; }
.followup-action-options button:hover { background: var(--cream-deep); }
.followup-custom-date-bar { display: flex; align-items: end; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: #fffaf1; }
.followup-custom-date-bar label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.followup-custom-date-bar input { min-height: 32px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); font: inherit; font-size: 11px; text-transform: none; }
.followup-calendar-card { margin-bottom: 18px; padding: 20px 22px; }
.followup-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.followup-calendar-head h3 { margin: 4px 0 0; font-family: "Playfair Display", serif; font-size: 20px; }
.followup-calendar-week, .followup-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.followup-calendar-week { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; text-transform: uppercase; }
.followup-calendar-day, .followup-calendar-empty { min-height: 50px; border: 1px solid transparent; border-radius: 8px; background: #fffdf9; }
.followup-calendar-day { display: grid; align-content: space-between; padding: 7px; color: var(--ink); text-align: left; cursor: pointer; }
.followup-calendar-day:hover, .followup-calendar-day.selected { border-color: var(--gold); background: #fff8e9; }
.followup-calendar-day strong { font-size: 11px; }
.followup-calendar-dots { display: flex; gap: 3px; }
.followup-calendar-dots i, .followup-calendar-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.followup-calendar-dots i.completed, .followup-calendar-legend i.completed { background: #4e936e; }
.followup-calendar-dots i.overdue, .followup-calendar-legend i.overdue { background: #b75a46; }
.followup-calendar-legend { display: flex; gap: 16px; margin-top: 13px; color: var(--muted); font-size: 9px; }
.followup-calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.followup-detail-drawer { width: min(570px, 100%); }
.followup-detail-drawer .drawer-action-row { display: flex; flex-wrap: wrap; gap: 7px; }
.followup-drawer-tabs { display: flex; gap: 15px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.followup-drawer-tabs button { padding: 13px 1px 11px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.followup-drawer-tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }
.followup-drawer-tabs span { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; margin-left: 3px; padding: 0 4px; border-radius: 9px; background: var(--cream-deep); font-size: 9px; }
.followup-detail-note { margin-top: 18px; padding: 13px; border-radius: 8px; background: #fffaf1; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.followup-history-list { display: grid; gap: 9px; }
.followup-history-row { display: grid; gap: 4px; padding: 11px; border-left: 3px solid var(--gold); border-radius: 6px; background: #fffaf1; font-size: 11px; }
.followup-history-row span, .followup-history-row small { color: var(--muted); font-size: 10px; }

@media (max-width: 960px) {
  .followup-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .followup-metrics-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .followup-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .followup-custom-date-bar { align-items: stretch; flex-direction: column; }
  .followup-calendar-head { align-items: flex-start; flex-direction: column; }
  .followup-calendar-day, .followup-calendar-empty { min-height: 42px; }
  .followup-detail-drawer { width: 100%; }
}

/* Mobile workspace polish: keep the CRM usable with one hand on narrow phones. */
@media (max-width: 620px) {
  html, body { min-width: 320px; overflow-x: hidden; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 0 0; width: 100%; height: calc(66px + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom); flex-direction: row; align-items: center; border-top: 1px solid rgba(198,161,91,.28); box-shadow: 0 -8px 24px rgba(24,22,19,.12); }
  .sidebar .brand, .sidebar .sidebar-label, .sidebar .sidebar-footer { display: none; }
  .sidebar .nav-list { display: flex; align-items: stretch; gap: 1px; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sidebar .nav-list::-webkit-scrollbar { display: none; }
  .sidebar .nav-item { flex: 0 0 60px; flex-direction: column; justify-content: center; min-height: 56px; padding: 6px 3px; border-radius: 10px; gap: 3px; }
  .sidebar .nav-item span:last-child { display: none; }
  .sidebar .nav-item svg, .sidebar .nav-item > span:first-child { width: 18px; height: 18px; }
  .sidebar .nav-item::after { display: block; overflow: hidden; max-width: 100%; color: rgba(255,255,255,.66); content: attr(aria-label); font-size: 8px; font-weight: 700; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .nav-item.active::after { color: var(--gold-pale); }
  .main { width: 100%; margin-left: 0; }
  .topbar { min-height: 62px; padding: 0 12px; }
  .topbar-actions { gap: 7px; }
  .top-search { width: min(42vw, 150px); max-width: none; padding: 7px 9px; }
  .top-search input { min-width: 0; font-size: 10px; }
  .top-search svg { width: 14px; }
  .notification-button { width: 34px; height: 34px; }
  .avatar { width: 34px; height: 34px; }
  .page { padding: 20px 11px 28px; }
  .page-header { gap: 14px; margin-bottom: 19px; }
  .page-header h1 { font-size: 29px; line-height: 1.08; }
  .page-header .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 7px; }
  .page-header .header-actions .btn { min-height: 40px; padding: 9px 8px; white-space: normal; }
  .btn, .table-action, .tab, .nav-item, select, input, textarea { min-height: 40px; }
  .card { border-radius: 11px; }
  .card-pad, .chart-card, .kpi-card { padding: 15px; }
  .filter-bar, .lead-filter-bar, .customer-filter-bar, .followup-filter-bar { align-items: stretch; padding: 11px; gap: 7px; }
  .search-box, .customer-search-field { flex: 1 1 100%; width: 100%; min-width: 0; min-height: 40px; }
  .filter-bar .select, .filter-bar select, .lead-filter-bar .select, .customer-filter-bar .select, .followup-filter-bar select { flex: 1 1 calc(50% - 4px); min-width: 0 !important; min-height: 40px; }
  .filter-bar .btn, .lead-filter-bar .btn, .customer-filter-bar .btn, .followup-filter-bar .btn { flex: 1 1 auto; min-height: 40px; }
  .lead-summary-grid, .customer-summary-grid, .followup-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-summary-card, .customer-summary-card, .followup-summary-card { min-height: 104px; padding: 13px; }
  .lead-summary-card .kpi-value, .customer-summary-card .kpi-value, .followup-summary-card .kpi-value { font-size: 24px; }
  .tabs { gap: 0; padding: 0 11px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .followup-status-tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 13px 10px 11px; }
  .table-wrap { margin: 0; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 760px; }
  .empty-state { padding: 30px 18px; }
  .drawer { padding: 18px 15px 28px; }
  .drawer-header { gap: 10px; padding-bottom: 16px; }
  .drawer-header h2 { font-size: 25px; }
  .drawer-action-row, .header-actions { gap: 7px; }
  .drawer-action-row .btn { flex: 1 1 calc(50% - 7px); min-height: 40px; }
  .customer-quick-actions .btn { flex: 1 1 calc(50% - 7px); min-height: 40px; }
  .form-field input, .form-field select, .form-field textarea, .form-grid input, .form-grid select, .form-grid textarea { min-height: 42px; font-size: 13px; }
  .form-field textarea, .form-grid textarea { min-height: 92px; }
  .form-grid { gap: 0; }
  .followup-performance-card, .followup-calendar-card { padding: 15px; }
  .followup-metrics-grid { gap: 7px; }
  .followup-metric { padding: 10px; }
  .followup-metric strong { font-size: 18px; }
  .followup-custom-date-bar { padding: 11px; }
  .followup-calendar-grid { gap: 3px; }
  .followup-calendar-day, .followup-calendar-empty { min-height: 38px; padding: 5px; }
  .followup-calendar-day strong { font-size: 10px; }
  .followup-calendar-legend { flex-wrap: wrap; gap: 8px; }
  .table-wrap table th:first-child, .table-wrap table td:first-child { position: sticky; left: 0; z-index: 2; background: #fffdf9; box-shadow: 5px 0 8px rgba(42,33,24,.04); }
  .table-wrap table thead th:first-child { z-index: 3; background: var(--cream-deep); }
  .toast { right: 11px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 11px; text-align: center; }
  .login-brand { min-height: 360px; padding: 24px 18px; }
  .login-brand-content { min-height: 300px; }
  .login-copy h1 { font-size: 36px; line-height: 1.04; }
  .login-form-wrap { padding: 18px 11px 28px; }
  .login-form { padding: 22px 17px; }
  .dashboard-line-chart { min-height: 250px; }
  .dashboard-line-chart svg { height: 230px; }
  .dashboard-line-hotspots { height: 230px; }
  .dashboard-line-chart .chart-axis-number, .dashboard-line-chart .chart-axis-label { font-size: 9px; }
}

@media (max-width: 390px) {
  .top-search { width: 112px; }
  .top-search input { font-size: 9px; }
  .page-header .header-actions { grid-template-columns: 1fr; }
  .sidebar .nav-item { flex-basis: 56px; }
  .followup-metrics-grid { grid-template-columns: 1fr 1fr; }
  .login-copy h1 { font-size: 31px; }
}

/* Phones keep the Aureum left sidebar; the workspace never changes to bottom navigation. */
@media (max-width: 620px) {
  body { padding-bottom: 0; }
  .sidebar { inset: 0 auto 0 0; width: 72px; height: auto; padding: 18px 8px; flex-direction: column; align-items: stretch; border-top: 0; border-right: 1px solid rgba(198,161,91,.28); box-shadow: 8px 0 24px rgba(24,22,19,.12); }
  .sidebar .nav-list { display: grid; align-content: start; gap: 4px; width: 100%; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
  .sidebar .nav-item { flex: 0 0 auto; flex-direction: row; justify-content: center; min-height: 48px; padding: 10px 4px; gap: 0; }
  .sidebar .nav-item::after { display: none; }
  .main { width: calc(100% - 72px); margin-left: 72px; }
  .topbar { padding: 0 10px; }
  .topbar-actions { gap: 5px; }
  .top-search { width: min(37vw, 145px); }
  .page { padding-right: 10px; padding-left: 10px; }
}

@media (max-width: 390px) {
  .top-search { width: 102px; }
  .sidebar { width: 68px; }
  .main { width: calc(100% - 68px); margin-left: 68px; }
}

.mobile-menu-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 21px; line-height: 1; }
.mobile-sidebar-close { display: none; }
.mobile-sidebar-backdrop { display: none; }
@media (max-width: 620px) {
  .mobile-menu-toggle { display: inline-flex; flex: 0 0 auto; }
  .sidebar { transform: translateX(-110%); transition: transform .2s ease; z-index: 40; }
  .sidebar.mobile-sidebar-open { transform: translateX(0); }
  .mobile-sidebar-close { position: absolute; top: 10px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: rgba(255,255,255,.08); font-size: 22px; line-height: 1; }
  .sidebar .nav-list { padding-top: 48px; }
  .mobile-sidebar-backdrop { position: fixed; inset: 0; z-index: 30; display: block; background: rgba(24,22,19,.42); backdrop-filter: blur(2px); }
  .main, .main { width: 100%; margin-left: 0; }
  .app-shell .sidebar { overflow-y: auto; }
}

/* Stitch visual language: midnight workspace, warm ivory typography, and champagne hierarchy. */
.app-shell {
  --ink: #e5e2e1;
  --muted: #a9a7a5;
  --cream: #0b0b0b;
  --cream-deep: #1c1b1b;
  --paper: #131313;
  --white: #201f1f;
  --sidebar: #101820;
  --sidebar-soft: #151f2a;
  --gold: #c9a24d;
  --gold-soft: #e3c878;
  --gold-pale: #ffdf9f;
  --green: #76b98f;
  --green-pale: rgba(47, 107, 79, .22);
  --red: #ffb4ab;
  --red-pale: rgba(147, 0, 10, .24);
  --amber: #ebc168;
  --amber-pale: rgba(115, 85, 0, .28);
  --line: rgba(201, 162, 77, .2);
  --shadow: 0 18px 42px rgba(0, 0, 0, .38);
  color: var(--ink);
  background: #0b0b0b;
  font-family: "Inter", "DM Sans", sans-serif;
}
.app-shell .main, .app-shell .page { background: #0b0b0b; }
.app-shell .sidebar { overflow-x: hidden; overflow-y: hidden; background: #101820; border-right: 1px solid rgba(201, 162, 77, .16); }
.app-shell .nav-list, .app-shell .nav-item { min-width: 0; }
.app-shell .nav-item .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .sidebar-soft, .app-shell .nav-item:hover, .app-shell .nav-item.active { background: #151f2a; }
.app-shell .nav-item { color: #a9a7a5; }
.app-shell .nav-item.active { color: #f7f3ea; box-shadow: inset 3px 0 0 #c9a24d; }
.app-shell .topbar { background: rgba(11, 11, 11, .92); border-color: rgba(201, 162, 77, .2); }
.app-shell .top-search { color: #c9a24d; border-color: rgba(201, 162, 77, .28); background: #151f2a; }
.app-shell .top-search input { color: #f7f3ea; }
.app-shell .top-search input::placeholder { color: #a9a7a5; opacity: 1; }
.app-shell .crumbs, .app-shell .page-header h1, .app-shell h2, .app-shell h3, .app-shell h4, .app-shell .kpi-value, .app-shell .detail-value, .app-shell .section-title h3 { color: #f7f3ea; }
.app-shell .page-header h1 { font-size: clamp(27px, 2.5vw, 36px); }
.app-shell .page-header .page-subtitle { font-size: 12px; }
.app-shell .page-subtitle, .app-shell .person-meta, .app-shell .kpi-label, .app-shell .detail-label, .app-shell .timeline-copy, .app-shell .timeline-time, .app-shell .section-title p, .app-shell .table-head p { color: #a9a7a5; }
.app-shell .card, .app-shell .table-card, .app-shell .chart-card, .app-shell .kpi-card, .app-shell .dashboard-welcome, .app-shell .dashboard-card, .app-shell .followup-performance-card, .app-shell .followup-calendar-card { border-color: rgba(201, 162, 77, .22); background: #101820; box-shadow: 0 8px 32px -4px rgba(0, 0, 0, .55), 0 0 1px 1px rgba(201, 162, 77, .1); }
.app-shell .card:hover { box-shadow: 0 12px 36px rgba(0, 0, 0, .4), 0 0 1px 1px rgba(201, 162, 77, .24); }
.app-shell .filter-bar, .app-shell .lead-filter-bar, .app-shell .customer-filter-bar, .app-shell .followup-filter-bar, .app-shell .followup-custom-date-bar { background: rgba(16, 24, 32, .82); border-color: rgba(201, 162, 77, .18); }
.app-shell .dashboard-toolbar { color: #e5e2e1; border-color: rgba(201, 162, 77, .2); background: #151f2a; }
.app-shell .dashboard-toolbar-meta, .app-shell .dashboard-date-filter label { color: #a9a7a5; }
.app-shell .dashboard-scope-label { color: #e3c878; }
.app-shell .dashboard-date-filter select, .app-shell .dashboard-date-filter input { color: #e5e2e1; border-color: rgba(255, 255, 255, .12); background: #101820; }
.app-shell .dashboard-agent-filter summary { color: #e5e2e1; border-color: rgba(255, 255, 255, .12); background: #101820; }
.app-shell .dashboard-agent-filter-menu { color: #e5e2e1; border-color: rgba(255, 255, 255, .12); background: #101820; }
.app-shell .dashboard-stat-card { min-height: 96px; gap: 10px; padding: 12px; }
.app-shell .dashboard-stat-icon { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
.app-shell .dashboard-stat-value { margin-top: 5px; font-size: 24px; }
.app-shell .kpi-card { padding: 15px; }
.app-shell .kpi-value { margin: 7px 0 5px; font-size: 25px; }
.app-shell .notification-panel { max-height: min(440px, calc(100vh - 92px)); overflow-y: auto; color: #e5e2e1; border-color: rgba(201, 162, 77, .28); background: #151f2a; box-shadow: 0 18px 42px rgba(0, 0, 0, .5); }
.app-shell .notification-head { border-color: rgba(201, 162, 77, .2); }
.app-shell .notification-head b { color: #f7f3ea; }
.app-shell .notification-head small { color: #a9a7a5; }
.app-shell .notification-filter { color: #a9a7a5; border-color: rgba(201, 162, 77, .2); }
.app-shell .notification-filter select { color: #e5e2e1; border-color: rgba(255, 255, 255, .12); background: #101820; }
.app-shell .notification-item { padding: 11px 14px; border-color: rgba(201, 162, 77, .16); }
.app-shell .notification-item > span:last-child { display: block; min-width: 0; flex: 1; line-height: 1.35; }
.app-shell .notification-item b { display: block; color: #f7f3ea; line-height: 1.25; }
.app-shell .notification-item small { color: #c5c6cb; font-size: 11px; line-height: 1.35; }
.app-shell .notification-item time { color: #85898d; line-height: 1.25; }
.app-shell .notification-item:hover, .app-shell .notification-item.unread { background: #202d3a; }
.app-shell .search-box, .app-shell .customer-search-field, .app-shell .select, .app-shell .filter-bar select, .app-shell .form-field input, .app-shell .form-field select, .app-shell .form-field textarea, .app-shell .form-grid input, .app-shell .form-grid select, .app-shell .form-grid textarea { color: #e5e2e1; border-color: rgba(255, 255, 255, .12); background: #151f2a; }
.app-shell select { color-scheme: dark; }
.app-shell select option { color: #f7f3ea; background: #151f2a; }
.app-shell input::placeholder, .app-shell textarea::placeholder { color: rgba(229, 226, 225, .45); }
.app-shell .search-box svg, .app-shell .top-search svg { color: #c9a24d; }
.app-shell .tabs, .app-shell .followup-drawer-tabs { border-color: rgba(201, 162, 77, .2); }
.app-shell .tab, .app-shell .followup-drawer-tabs button { color: #a9a7a5; }
.app-shell .tab.active, .app-shell .followup-drawer-tabs button.active { color: #f7f3ea; border-bottom-color: #c9a24d; }
.app-shell table th { color: #c5c6cb; background: #151f2a; border-color: rgba(201, 162, 77, .2); }
.app-shell table td { color: #e5e2e1; border-color: rgba(201, 162, 77, .14); }
.app-shell .table-wrap table th:first-child, .app-shell .table-wrap table td:first-child { background: #101820; box-shadow: 5px 0 8px rgba(0, 0, 0, .28); }
.app-shell .table-wrap table thead th:first-child { background: #151f2a; }
.app-shell table tbody tr:hover { background: rgba(201, 162, 77, .06); }
.app-shell .lead-data-table tbody tr[data-lead-module-row]:hover, .app-shell .customer-data-table tbody tr[data-customer-module-row]:hover { background: #202d3a; }
.app-shell .lead-data-table tbody tr[data-lead-module-row]:hover td, .app-shell .customer-data-table tbody tr[data-customer-module-row]:hover td { color: #f7f3ea; }
.app-shell .lead-summary-card, .app-shell .customer-summary-card, .app-shell .followup-summary-card, .app-shell .followup-metric, .app-shell .mini-stat, .app-shell .customer-note, .app-shell .customer-followup-preview, .app-shell .followup-history-row, .app-shell .followup-detail-note { border-color: rgba(201, 162, 77, .2); background: #151f2a; }
.app-shell .lead-summary-detail, .app-shell .customer-summary-detail, .app-shell .followup-summary-detail { color: #a9a7a5; }
.app-shell .badge-neutral { color: #c5c6cb; background: #2a2a2a; }
.app-shell .badge-hot, .app-shell .badge-overdue, .app-shell .badge-lost { color: #ffb4ab; background: rgba(147, 0, 10, .3); }
.app-shell .dashboard-followup-row.is-overdue { background: #2a2025; }
.app-shell .dashboard-followup-row.is-overdue .dashboard-followup-main strong { color: #f7f3ea; }
.app-shell .dashboard-followup-row.is-overdue .dashboard-followup-main span { color: #c9c1bd; }
.app-shell .badge-warm, .app-shell .badge-follow { color: #f6cb72; background: rgba(115, 85, 0, .32); }
.app-shell .badge-completed, .app-shell .badge-closed { color: #a8d7b8; background: rgba(47, 107, 79, .3); }
.app-shell .btn-secondary, .app-shell .table-action { color: #e3c878; border-color: rgba(201, 162, 77, .35); }
.app-shell .btn-secondary { background: transparent; }
.app-shell .btn-secondary:hover, .app-shell .table-action:hover { background: rgba(201, 162, 77, .1); }
.app-shell .btn-gold, .app-shell .btn-primary { color: #0b0b0b; border-color: #c9a24d; background: linear-gradient(135deg, #c9a24d, #e3c878); box-shadow: 0 0 16px rgba(227, 200, 120, .12); }
.app-shell .btn-gold:hover, .app-shell .btn-primary:hover { box-shadow: 0 0 20px rgba(227, 200, 120, .28); }
.app-shell .presence-picker { border-color: rgba(201, 162, 77, .24); background: #201f1f; }
.app-shell .presence-picker label, .app-shell .presence-picker small { color: #a9a7a5; }
.app-shell .drawer { color: #e5e2e1; border-left-color: rgba(201, 162, 77, .25); background: #151f2a; box-shadow: -24px 0 60px rgba(0, 0, 0, .55); }
.app-shell .drawer-header, .app-shell .drawer-section { border-color: rgba(201, 162, 77, .2); }
.app-shell .drawer-close, .app-shell .mobile-menu-toggle { color: #e3c878; border-color: rgba(201, 162, 77, .28); background: #201f1f; }
.app-shell .drawer-backdrop { background: rgba(0, 0, 0, .62); }
.app-shell .empty-state { color: #a9a7a5; }
.app-shell .empty-state strong { color: #f7f3ea; }
.app-shell .chat-layout { border-color: rgba(201, 162, 77, .2); background: #101820; }
.app-shell .chat-sidebar, .app-shell .chat-details { background: #0e0e0e; border-color: rgba(201, 162, 77, .18); }
.app-shell .channel { color: #a9a7a5; }
.app-shell .channel:hover, .app-shell .channel.active { color: #f7f3ea; background: #151f2a; }
.app-shell .chat-main, .app-shell .messages { background: #101820; }
.app-shell .message-bubble, .app-shell .chat-composer { border-color: rgba(201, 162, 77, .2); background: #151f2a; color: #e5e2e1; }
.app-shell .live-pill { color: #a8d7b8; border-color: rgba(47, 107, 79, .35); background: rgba(47, 107, 79, .14); }
.app-shell .followup-calendar-day, .app-shell .followup-calendar-empty { color: #e5e2e1; background: #151f2a; }
.app-shell .followup-calendar-day:hover, .app-shell .followup-calendar-day.selected { border-color: #c9a24d; background: #201f1f; }
.app-shell .followup-calendar-week, .app-shell .followup-calendar-legend { color: #a9a7a5; }
.app-shell .mobile-sidebar-backdrop { background: rgba(0, 0, 0, .68); }
.app-shell .sidebar-signout-footer { display: block; margin-top: auto; padding: 12px 0 0; border-top-color: rgba(201, 162, 77, .18); }
.app-shell .sidebar-signout { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 13px; color: #a9a7a5; border: 0; border-radius: 11px; background: transparent; font-size: 13px; font-weight: 600; text-align: left; }
.app-shell .sidebar-signout:hover { color: #f7f3ea; background: #151f2a; }
.app-shell .sidebar-signout span:first-child { width: 18px; color: #c9a24d; font-size: 17px; text-align: center; }

/* Module 6 chat workspace: focused Slack-like hierarchy without exposing the CRM details panel by default. */
.chat-screen-toolbar { display: flex; align-items: center; justify-content: flex-end; min-height: 34px; margin: 0 0 12px; }
.app-shell .page:has(.chat-workspace) { padding-top: 18px; padding-bottom: 22px; }
.app-shell .page:has(.chat-workspace) .chat-screen-toolbar { margin-bottom: 8px; }
.app-shell .page:has(.chat-workspace) { max-width: none; padding: 0; }
.app-shell .page:has(.chat-workspace) .chat-screen-toolbar { display: none; }
.app-shell .page:has(.chat-workspace) .chat-workspace { width: 100%; height: calc(100vh - 76px); min-height: 0; border-radius: 0; border-right: 0; border-left: 0; border-bottom: 0; }
.chat-workspace { position: relative; grid-template-columns: 238px minmax(0, 1fr); height: clamp(520px, calc(100vh - 370px), 620px); min-height: 0; overflow: hidden; border: 1px solid rgba(201,162,77,.2); border-radius: 14px; background: #101820; box-shadow: 0 8px 32px -4px rgba(0,0,0,.45); }
.chat-workspace.chat-layout-panel-open { grid-template-columns: 238px minmax(0, 1fr) 318px; }
.chat-workspace .chat-sidebar { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; padding: 18px 16px; background: #0e0e0e; border-right-color: rgba(201,162,77,.18); }
.chat-workspace .chat-search { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 12px; padding: 8px 10px; color: #c9a24d; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: #151f2a; }
.chat-workspace .chat-search input { width: 100%; min-width: 0; color: #e5e2e1; border: 0; outline: 0; background: transparent; font-size: 11px; }
.chat-workspace .chat-search input::placeholder { color: #85898d; opacity: 1; }
.chat-workspace .chat-sidebar, .chat-workspace .messages { scrollbar-width: thin; scrollbar-color: #465361 #0e0e0e; }
.chat-workspace .chat-sidebar::-webkit-scrollbar, .chat-workspace .messages::-webkit-scrollbar { width: 8px; height: 8px; }
.chat-workspace .chat-sidebar::-webkit-scrollbar-track, .chat-workspace .messages::-webkit-scrollbar-track { background: #0e0e0e; }
.chat-workspace .chat-sidebar::-webkit-scrollbar-thumb, .chat-workspace .messages::-webkit-scrollbar-thumb { border: 2px solid #0e0e0e; border-radius: 8px; background: #465361; }
.chat-sidebar-section { margin-top: 8px; }
.chat-section-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 5px 7px; color: #c5c6cb; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.chat-section-action { display: grid; place-items: center; width: 24px; height: 24px; color: #e3c878; border: 1px solid rgba(201,162,77,.36); border-radius: 7px; background: transparent; font-size: 17px; line-height: 1; }
.chat-list-item { min-height: 49px; padding: 8px 9px; }
.chat-list-copy { display: grid; min-width: 0; gap: 4px; }
.chat-list-title { overflow: hidden; color: inherit; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-copy small { overflow: hidden; color: #777a7e; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-meta { display: flex; align-items: center; gap: 6px; }
.chat-list-meta time { color: #85898d; font-size: 9px; white-space: nowrap; }
.chat-list-avatar, .chat-mobile-only { display: none; }
.chat-item-symbol { margin-right: 5px; color: #c9a24d; }
.presence-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #76b98f; box-shadow: 0 0 0 3px rgba(118,185,143,.1); }
.presence-dot.away { background: #ebc168; box-shadow: 0 0 0 3px rgba(235,193,104,.1); }
.presence-dot.offline { background: #676b70; box-shadow: none; }
.chat-sidebar-empty { padding: 12px 8px; color: #73777b; font-size: 10px; }
.chat-sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 14px 8px 3px; color: #777a7e; border-top: 1px solid rgba(201,162,77,.12); font-size: 10px; }
.chat-mobile-sidebar-head { display: none; }
.chat-workspace .chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #101820; }
.chat-workspace .chat-header { padding: 16px 20px; }
.chat-header-button { width: 100%; color: inherit; border: 0; border-bottom: 1px solid rgba(201,162,77,.18); background: #101820; text-align: left; cursor: pointer; }
.chat-header-button:hover { background: #151f2a; }
.chat-header-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-info-trigger { color: #e3c878; font-size: 18px; }
.mobile-chat-toggle { display: none; width: 34px; height: 34px; color: #e3c878; border: 1px solid rgba(201,162,77,.28); border-radius: 8px; background: #201f1f; font-size: 18px; }
.chat-workspace .messages { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; background: #101820; }
.chat-date-separator { display: flex; align-items: center; gap: 12px; color: #85898d; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.chat-date-separator::before, .chat-date-separator::after { flex: 1; height: 1px; content: ''; background: rgba(201,162,77,.14); }
.chat-date-separator span { white-space: nowrap; }
.chat-system-message { justify-self: center; padding: 8px 13px; color: #c9a24d; border: 1px solid rgba(201,162,77,.2); border-radius: 99px; background: rgba(201,162,77,.08); font-size: 10px; }
.message-meta time { margin-left: auto; color: #777a7e; font-size: 9px; }
.message-bubble .attachment-preview { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 9px; border: 1px solid rgba(201,162,77,.22); border-radius: 8px; background: rgba(0,0,0,.2); }
.attachment-icon, .asset-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: rgba(201,162,77,.16); }
.attachment-preview b, .attachment-preview small { display: block; }
.attachment-preview small { margin-top: 3px; color: #8e9195; font-size: 9px; }
.chat-file-name { max-width: 130px; overflow: hidden; color: #c9a24d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-workspace .chat-compose { display: flex; box-sizing: border-box; width: 100%; flex: 0 0 auto; min-width: 0; min-height: 67px; padding: 12px 16px; background: #0e0e0e; }
.chat-workspace .chat-compose .icon-btn { flex: 0 0 36px; }
.chat-workspace .chat-compose textarea { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 40px; resize: none; color: #e5e2e1; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; outline: 0; background: #151f2a; font: inherit; font-size: 11px; line-height: 1.4; }
.chat-workspace .chat-compose .btn { flex: 0 0 auto; white-space: nowrap; }
.chat-info-panel { min-width: 0; padding: 19px 17px; overflow: auto; background: #0e0e0e; border-left: 1px solid rgba(201,162,77,.18); }
.chat-info-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chat-info-header h2 { margin: 4px 0 0; font-family: "Playfair Display",serif; font-size: 20px; }
.chat-info-section { margin-top: 22px; padding-top: 15px; border-top: 1px solid rgba(201,162,77,.13); }
.chat-info-member { padding: 7px 0; }
.chat-info-member > div:nth-child(2) { min-width: 0; }
.chat-info-member b, .chat-info-member small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-info-member small { margin-top: 3px; color: #85898d; font-size: 9px; }
.chat-info-member .table-action { width: 22px; min-width: 22px; padding: 0; }
.shared-asset, .shared-link { display: flex; align-items: center; gap: 9px; padding: 8px 0; color: #e5e2e1; text-decoration: none; }
.shared-asset > div, .shared-link { min-width: 0; }
.shared-asset b, .shared-asset small, .shared-link b, .shared-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-asset small, .shared-link small { margin-top: 3px; color: #85898d; font-size: 9px; }
.shared-link { display: grid; gap: 3px; padding: 9px; border: 1px solid rgba(201,162,77,.14); border-radius: 8px; }
.shared-link:hover { background: rgba(201,162,77,.08); }
.chat-placeholder { padding: 10px; color: #85898d; border: 1px dashed rgba(201,162,77,.22); border-radius: 8px; font-size: 10px; line-height: 1.5; }
.chat-info-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chat-group-management { margin-top: 18px; padding: 13px; border: 1px solid rgba(201,162,77,.2); border-radius: 9px; background: rgba(21,31,42,.72); }
.chat-group-management > p { margin: 5px 0 0; color: #85898d; font-size: 10px; line-height: 1.45; }
.chat-member-manager { display: grid; gap: 7px; margin-top: 15px; padding: 10px; border: 1px solid rgba(201,162,77,.15); border-radius: 8px; background: #151f2a; }
.chat-member-manager label { display: flex; align-items: center; gap: 6px; color: #c5c6cb; font-size: 10px; }
.chat-member-manager label small { color: #85898d; }
.chat-modal-backdrop, .chat-sidebar-backdrop { position: fixed; inset: 0; z-index: 48; background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.chat-modal { position: fixed; z-index: 49; top: 50%; left: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); overflow: auto; transform: translate(-50%, -50%); padding: 22px; color: #e5e2e1; border: 1px solid rgba(201,162,77,.28); border-radius: 14px; background: #101820; box-shadow: 0 28px 80px rgba(0,0,0,.65); }
.chat-modal-header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.chat-modal-header h2 { margin: 5px 0; font-family: "Playfair Display",serif; }
.chat-member-selector { display: grid; gap: 6px; margin-top: 16px; }
.chat-member-option { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid transparent; border-radius: 8px; background: #151f2a; cursor: pointer; }
.chat-member-option:has(input:checked) { border-color: rgba(201,162,77,.4); background: rgba(201,162,77,.1); }
.chat-member-option > span:nth-of-type(2) { flex: 1; min-width: 0; }
.chat-member-option b, .chat-member-option small { display: block; }
.chat-member-option small { margin-top: 3px; color: #85898d; font-size: 9px; }
.chat-modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 980px) {
  .chat-workspace.chat-layout-panel-open { grid-template-columns: 210px minmax(0, 1fr); }
  .chat-workspace.chat-layout-panel-open .chat-info-panel { position: absolute; inset: 0 0 0 auto; z-index: 5; width: min(340px, 78vw); box-shadow: -22px 0 50px rgba(0,0,0,.45); }
}
@media (max-width: 850px) and (min-width: 621px) {
  .app-shell .sidebar-signout-footer { display: block; }
  .app-shell .sidebar-signout { justify-content: center; padding-inline: 0; }
  .app-shell .sidebar-signout span:last-child { display: none; }
}
@media (max-width: 620px) {
  .app-shell .sidebar-signout-footer { display: block; }
  .app-shell .sidebar:not(.mobile-sidebar-open) .sidebar-signout-footer { display: none; }
  .app-shell .sidebar-signout { justify-content: flex-start; }
  .app-shell .page:has(.chat-workspace) { padding: 0; }
  .app-shell .page:has(.chat-workspace) .chat-workspace { height: calc(100vh - 66px); min-height: calc(100vh - 66px); border-radius: 0; }
  .chat-workspace, .chat-workspace.chat-layout-panel-open { grid-template-columns: 1fr; height: calc(100vh - 210px); min-height: 430px; max-height: none; overflow: hidden; }
  .chat-workspace .chat-sidebar { position: absolute; inset: 0; z-index: 50; display: none; width: 100%; max-width: none; min-height: 100%; padding: 15px 14px calc(14px + env(safe-area-inset-bottom)); box-shadow: none; background: #101820; }
  .chat-workspace .chat-sidebar-backdrop { display: none; }
  .chat-workspace.chat-sidebar-mobile-open .chat-sidebar { display: flex; }
  .chat-mobile-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; color: #f7f3ea; }
  .chat-mobile-sidebar-head > div { display: grid; gap: 3px; }
  .chat-mobile-sidebar-head b { font-size: 23px; letter-spacing: -.02em; }
  .chat-mobile-sidebar-head small { color: #85898d; font-size: 10px; }
  .chat-mobile-sidebar-head .drawer-close { width: 36px; height: 36px; }
  .chat-mobile-only { display: flex; min-height: 0; flex: 1 1 auto; }
  .chat-desktop-only { display: none; }
  .chat-mobile-inbox { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
  .chat-mobile-inbox-title { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 3px 10px; }
  .chat-mobile-inbox-title > div { display: none; }
  .chat-mobile-inbox-title .chat-section-action { display: grid; margin-left: auto; width: 33px; height: 33px; border-radius: 50%; background: rgba(201,162,77,.14); color: #e3c878; border-color: rgba(201,162,77,.32); }
  .chat-mobile-filters { display: flex; flex: 0 0 auto; min-height: 45px; gap: 8px; overflow-x: auto; padding: 1px 2px 10px; scrollbar-width: none; }
  .chat-mobile-filters::-webkit-scrollbar { display: none; }
  .chat-mobile-filter { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; min-height: 34px; padding: 0 14px; color: #aeb4b9; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: transparent; font-size: 11px; font-weight: 700; }
  .chat-mobile-filter.active { color: #f7f3ea; border-color: rgba(201,162,77,.48); background: rgba(201,162,77,.18); }
  .chat-mobile-filter span { color: #101820; border-radius: 10px; background: #c9a24d; padding: 1px 5px; font-size: 9px; }
  .chat-mobile-archive { display: flex; align-items: center; gap: 12px; min-height: 49px; padding: 7px 6px; color: #c3c8cb; border-bottom: 1px solid rgba(255,255,255,.08); }
  .chat-mobile-archive-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #e3c878; border-radius: 50%; background: rgba(201,162,77,.15); font-size: 18px; }
  .chat-mobile-archive b { font-size: 13px; }
  .chat-mobile-archive small { margin-left: auto; color: #777f85; font-size: 20px; }
  .chat-mobile-inbox-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-top: 4px; scrollbar-width: thin; scrollbar-color: #465361 transparent; }
  .chat-mobile-inbox-list .chat-list-item { display: flex; align-items: center; gap: 11px; min-height: 70px; padding: 9px 5px; color: #d7dbdd; border-bottom: 1px solid rgba(255,255,255,.08); border-radius: 0; background: transparent; }
  .chat-mobile-inbox-list .chat-list-item:hover, .chat-mobile-inbox-list .chat-list-item.active { color: #f7f3ea; background: rgba(21,31,42,.85); }
  .chat-mobile-inbox-list .chat-list-avatar { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; color: #07140d; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: #e8d7ad; font-size: 14px; font-weight: 800; }
  .chat-mobile-inbox-list .chat-list-avatar.channel { color: #e3c878; background: #1b2d31; }
  .chat-mobile-inbox-list .chat-list-avatar.group { color: #e9d39e; background: #3a3020; }
  .chat-mobile-inbox-list .chat-list-copy { flex: 1 1 auto; gap: 5px; text-align: left; }
  .chat-mobile-inbox-list .chat-list-title { font-size: 13px; }
  .chat-mobile-inbox-list .chat-item-symbol { display: none; }
  .chat-mobile-inbox-list .chat-list-copy small { color: #929a9f; font-size: 10px; }
  .chat-mobile-inbox-list .chat-list-meta { align-self: stretch; flex: 0 0 auto; flex-direction: column; justify-content: space-between; gap: 4px; }
  .chat-mobile-inbox-list .chat-list-meta time { color: #858e94; font-size: 9px; }
  .chat-mobile-inbox-list .chat-list-meta .unread { min-width: 20px; height: 20px; color: #101820; border-radius: 10px; background: #c9a24d; font-size: 9px; font-weight: 800; }
  .chat-mobile-inbox-list .chat-list-meta .presence-dot { display: none; }
  .chat-mobile-inbox + .chat-sidebar-footer { margin-top: 8px; }
  .chat-workspace .chat-details { position: fixed; inset: 0; z-index: 46; display: block; width: 100%; border: 0; }
  .mobile-chat-toggle { display: inline-flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
  .chat-header-leading { gap: 9px; }
  .chat-channel-copy { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-workspace .messages { min-height: 0; padding: 17px 12px; }
  .chat-workspace .chat-compose { position: relative; bottom: auto; z-index: 4; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; flex-wrap: nowrap; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); }
  .chat-workspace .chat-compose textarea { order: initial; grid-column: 2; min-height: 42px; }
  .chat-workspace .chat-compose .btn { order: initial; grid-column: 3; min-height: 42px; }
  .chat-file-name { order: initial; grid-column: 1 / -1; max-width: 100%; }
  .chat-file-name:empty { display: none; }
  .chat-modal { width: 100%; max-height: 100%; min-height: 100%; border: 0; border-radius: 0; }
}

/* MODULE 9 — settings and account surfaces */
.settings-tab { display: grid; gap: 3px; width: 100%; padding: 12px 13px; color: var(--muted); border: 0; border-left: 3px solid transparent; background: transparent; text-align: left; cursor: pointer; }
.settings-tab span { color: inherit; font-size: 11px; font-weight: 800; }
.settings-tab small { color: inherit; font-size: 9px; }
.settings-tab:hover, .settings-tab.active { color: var(--ink); border-left-color: var(--gold); background: rgba(201,162,77,.1); }
.settings-content { min-width: 0; display: grid; gap: 18px; }
.module9-form { display: grid; gap: 18px; }
.settings-channel-table th, .settings-channel-table td { text-align: center; }
.settings-channel-table th:first-child, .settings-channel-table td:first-child { text-align: left; }
.settings-channel-table input, .settings-toggle-row input { accent-color: var(--gold); }
.settings-save-actions { display: flex; gap: 8px; }
.user-menu-link { display: block; width: 100%; padding: 8px 0; color: var(--ink); border: 0; background: transparent; text-align: left; font-size: 11px; cursor: pointer; }
.user-menu-link:hover { color: var(--gold); }
.account-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.account-settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.account-settings-sidebar { position: sticky; top: 92px; display: grid; gap: 4px; padding: 12px; }
.account-settings-sidebar-title { padding: 7px 11px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.account-settings-tab { display: grid; gap: 3px; padding: 11px; color: var(--muted); border: 0; border-left: 3px solid transparent; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.account-settings-tab span { color: inherit; font-size: 11px; font-weight: 800; }
.account-settings-tab small { color: inherit; font-size: 9px; }
.account-settings-tab:hover, .account-settings-tab:focus-visible { color: var(--ink); border-left-color: var(--gold); background: rgba(201,162,77,.1); outline: 0; }
.account-module-grid > :first-child, .account-activity-card { grid-column: 1 / -1; }
.account-readonly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; grid-column: 1 / -1; }
.account-readonly-grid > div { padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.account-readonly-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.account-readonly-grid b { font-size: 11px; }
.account-preference-card { min-width: 0; }
.account-preference-card .settings-save-bar { margin-top: 18px; }
@media (max-width: 900px) { .account-settings-layout { grid-template-columns: 1fr; } .account-settings-sidebar { position: static; display: flex; overflow-x: auto; padding: 8px; } .account-settings-sidebar-title { display: none; } .account-settings-tab { flex: 0 0 145px; border-left: 0; border-bottom: 3px solid transparent; } .account-settings-tab:hover, .account-settings-tab:focus-visible { border-bottom-color: var(--gold); } .account-module-grid { grid-template-columns: 1fr; } .account-module-grid > :first-child, .account-activity-card { grid-column: auto; } }
@media (max-width: 760px) { .settings-sidebar { display: flex; gap: 5px; overflow-x: auto; padding: 8px; } .settings-sidebar-title { display: none; } .settings-tab { min-width: 150px; border-left: 0; border-bottom: 3px solid transparent; } .settings-tab:hover, .settings-tab.active { border-bottom-color: var(--gold); } .settings-channel-table { min-width: 610px; } .settings-content { overflow: hidden; } .settings-save-bar { align-items: flex-start; flex-direction: column; gap: 10px; } .settings-save-actions { width: 100%; justify-content: flex-end; } }
@media (max-width: 480px) { .account-readonly-grid { grid-template-columns: 1fr; } .settings-tab { min-width: 132px; } }

/* Final mobile pass: one predictable slide-out navigation and contained workspaces. */
@media (max-width: 620px) {
  html, body { width: 100%; min-width: 320px; max-width: 100%; overflow-x: hidden; }
  body { min-height: 100dvh; }
  .app-shell { display: block; width: 100%; min-height: 100dvh; overflow-x: hidden; }
  .app-shell .sidebar {
    inset: 0 auto 0 0;
    width: min(292px, 88vw);
    height: 100dvh;
    min-height: 100dvh;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-105%);
    box-shadow: 14px 0 42px rgba(0,0,0,.55);
  }
  .app-shell .sidebar.mobile-sidebar-open { transform: translateX(0); }
  .app-shell .sidebar .brand { display: flex; justify-content: flex-start; padding: 0 10px 25px; }
  .app-shell .sidebar .brand-copy,
  .app-shell .sidebar .sidebar-label,
  .app-shell .sidebar .sidebar-footer { display: block; }
  .app-shell .sidebar .sidebar-label { padding-inline: 13px; }
  .app-shell .sidebar .nav-list {
    display: grid;
    align-content: start;
    width: 100%;
    padding-top: 0;
    overflow: visible;
  }
  .app-shell .sidebar .nav-item {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 46px;
    padding: 10px 13px;
    gap: 12px;
  }
  .app-shell .sidebar .nav-item .nav-label { display: inline; }
  .app-shell .sidebar .nav-item .nav-badge { position: static; margin-left: auto; }
  .app-shell .sidebar .nav-item::after { display: none; }
  .app-shell .sidebar .sidebar-footer { margin-top: auto; }
  .app-shell .sidebar .sidebar-signout-footer { display: block; }
  .app-shell .sidebar .sidebar-signout { justify-content: flex-start; }
  .app-shell .mobile-sidebar-close { display: inline-flex; }
  .app-shell .main { width: 100%; min-width: 0; margin-left: 0; }
  .app-shell .topbar { width: 100%; min-height: 62px; padding: 0 10px; gap: 7px; }
  .app-shell .topbar-actions { min-width: 0; flex: 1 1 auto; gap: 6px; }
  .app-shell .top-search { width: auto; min-width: 0; flex: 1 1 auto; max-width: none; padding: 7px 9px; }
  .app-shell .top-search input { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
  .app-shell .top-search svg { flex: 0 0 auto; width: 14px; }
  .app-shell .notification-button, .app-shell .avatar { flex: 0 0 34px; width: 34px; height: 34px; }
  .app-shell .page { width: 100%; min-width: 0; padding: 20px 11px calc(28px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .app-shell .page-header { width: 100%; align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .app-shell .page-header > div:first-child { min-width: 0; }
  .app-shell .page-header h1 { font-size: clamp(26px, 8vw, 32px); line-height: 1.08; overflow-wrap: anywhere; }
  .app-shell .page-header .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 7px; }
  .app-shell .page-header .header-actions .btn { width: 100%; min-width: 0; min-height: 40px; padding: 8px; white-space: normal; }
  .app-shell .grid-4, .app-shell .grid-3, .app-shell .grid-2, .app-shell .two-col, .app-shell .metric-strip,
  .app-shell .dashboard-chart-grid, .app-shell .dashboard-content-grid { grid-template-columns: minmax(0, 1fr); }
  .app-shell .card, .app-shell .table-card, .app-shell .chart-card { min-width: 0; max-width: 100%; }
  .app-shell .section-title, .app-shell .table-head, .app-shell .lead-registry-head, .app-shell .customer-registry-head { min-width: 0; }
  .app-shell .section-title > *, .app-shell .table-head > *, .app-shell .lead-registry-head > *, .app-shell .customer-registry-head > * { min-width: 0; }
  .app-shell .section-title h3, .app-shell .table-head h3 { overflow-wrap: anywhere; }
  .app-shell .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  .app-shell .filter-bar, .app-shell .lead-filter-bar, .app-shell .customer-filter-bar, .app-shell .followup-filter-bar { width: 100%; }
  .app-shell .filter-bar > *, .app-shell .lead-filter-bar > *, .app-shell .customer-filter-bar > *, .app-shell .followup-filter-bar > * { min-width: 0; }
  .app-shell .dashboard-welcome { align-items: flex-start; flex-direction: column; gap: 16px; padding: 18px; }
  .app-shell .dashboard-welcome-side, .app-shell .dashboard-welcome-actions { width: 100%; align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; }
  .app-shell .dashboard-welcome-side .dashboard-date-filter { width: 100%; justify-content: flex-start; }
  .app-shell .dashboard-date-filter { width: 100%; justify-content: flex-start; }
  .app-shell .dashboard-date-filter label, .app-shell .dashboard-date-filter select, .app-shell .dashboard-date-filter input { min-width: 0; }
  .app-shell .dashboard-date-filter select, .app-shell .dashboard-date-filter input { flex: 1 1 130px; }
  .app-shell .dashboard-welcome-mark { display: none; }
  .app-shell .dashboard-stat-card { min-height: 96px; }
  .app-shell .report-filter-grid, .app-shell .report-metric-grid, .app-shell .report-section-grid, .app-shell .report-mini-grid { grid-template-columns: minmax(0, 1fr); }
  .app-shell .report-filter-heading, .app-shell .report-filter-footer { align-items: flex-start; flex-direction: column; }
  .app-shell .report-filter-grid { gap: 8px; }
  .app-shell .report-table-head-actions { width: 100%; justify-content: flex-start; }
  .app-shell .report-table-head-actions .btn { flex: 1 1 120px; }
  .app-shell .drawer, .app-shell .report-drawer, .app-shell .user-drawer, .app-shell .lead-detail-drawer, .app-shell .customer-detail-drawer, .app-shell .followup-detail-drawer { width: 100%; max-width: 100%; padding: 18px 15px calc(28px + env(safe-area-inset-bottom)); }
  .app-shell .drawer-header h2, .app-shell .report-drawer h2 { font-size: 24px; overflow-wrap: anywhere; }
  .app-shell .chat-workspace, .app-shell .chat-workspace.chat-layout-panel-open { grid-template-columns: minmax(0, 1fr); width: 100%; height: calc(100dvh - 62px); min-height: 430px; max-height: none; border-radius: 0; overflow: hidden; }
  .app-shell .page:has(.chat-workspace) { width: 100%; padding: 0; }
  .app-shell .page:has(.chat-workspace) .chat-workspace { height: calc(100dvh - 62px); min-height: 430px; }
  .app-shell .chat-workspace .chat-main { width: 100%; min-width: 0; min-height: 0; }
  .app-shell .chat-workspace .chat-header { min-height: 66px; padding: 12px 13px; }
  .app-shell .chat-workspace .chat-channel-title { font-size: 18px; }
  .app-shell .chat-workspace .chat-channel-copy { max-width: min(66vw, 240px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell .chat-workspace .messages { min-height: 0; padding: 16px 11px; }
  .app-shell .chat-workspace .message-body { max-width: 86%; min-width: 0; }
  .app-shell .chat-workspace .message-bubble { overflow-wrap: anywhere; }
  .app-shell .chat-workspace .chat-compose { grid-template-columns: 36px minmax(0, 1fr) auto; width: 100%; min-height: 64px; gap: 7px; padding: 8px 9px calc(8px + env(safe-area-inset-bottom)); }
  .app-shell .chat-workspace .chat-compose textarea { grid-column: 2; width: 100%; min-width: 0; min-height: 42px; }
  .app-shell .chat-workspace .chat-compose .btn { grid-column: 3; min-height: 42px; padding-inline: 11px; }
  .app-shell .chat-workspace .chat-sidebar { width: 100%; max-width: none; }
  .app-shell .chat-workspace .chat-details { position: absolute; inset: 0; z-index: 46; width: 100%; max-width: 100%; }
  .app-shell .chat-modal { width: 100%; max-width: 100%; min-height: 100%; max-height: 100%; border: 0; border-radius: 0; }
}

@media (max-width: 390px) {
  .app-shell .topbar { padding-inline: 8px; }
  .app-shell .top-search { padding-inline: 7px; }
  .app-shell .top-search input { font-size: 9px; }
  .app-shell .page { padding-inline: 9px; }
  .app-shell .page-header .header-actions { grid-template-columns: minmax(0, 1fr); }
  .app-shell .dashboard-welcome { padding: 15px; }
  .app-shell .chat-workspace .chat-compose { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 5px; padding-inline: 7px; }
  .app-shell .chat-workspace .chat-compose .btn { padding-inline: 9px; }
}

/* Notification panel mobile readability: keep the header visible and give each alert room to wrap. */
.app-shell .notification-panel { overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #465361 #151f2a; }
.app-shell .notification-head { position: sticky; top: 0; z-index: 1; background: #151f2a; }
.app-shell .notification-item { align-items: flex-start; min-height: 68px; }
.app-shell .notification-item > span:last-child { display: grid; gap: 3px; min-width: 0; line-height: 1.35; }
.app-shell .notification-item b, .app-shell .notification-item small, .app-shell .notification-item time { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .app-shell .notification-panel {
    position: fixed;
    top: calc(62px + env(safe-area-inset-top) + 8px);
    right: 9px;
    width: min(360px, calc(100vw - 18px));
    max-height: calc(100dvh - 82px);
    border-radius: 12px;
  }
  .app-shell .notification-head { padding: 13px 14px; }
  .app-shell .notification-item { min-height: 72px; padding: 12px 13px; }
  .app-shell .notification-item small { font-size: 10px; line-height: 1.4; }
}

/* Light workspace surfaces. The stitched shell below intentionally uses a dark
   palette for dark mode, so keep a higher-specificity light palette here to avoid
   legacy dark backgrounds leaking into cards, reports, and drawers. */
html[data-theme="light"] .app-shell {
  --ink: #181613;
  --muted: #81796f;
  --cream: #f7f1e7;
  --cream-deep: #eee3d3;
  --paper: #fffdfa;
  --white: #ffffff;
  --sidebar: #151514;
  --sidebar-soft: #23221f;
  --gold: #c6a15b;
  --gold-soft: #ead8ac;
  --gold-pale: #f8efd9;
  --green: #2f6b4f;
  --green-pale: #e7f1e9;
  --red: #a84c45;
  --red-pale: #f6e6e4;
  --amber: #b97824;
  --amber-pale: #fbefdc;
  --line: rgba(51, 40, 27, .11);
  --shadow: 0 16px 40px rgba(69, 47, 20, .08);
  color: var(--ink);
  background: var(--cream);
}
html[data-theme="light"] .app-shell .main,
html[data-theme="light"] .app-shell .page { background: var(--cream); color: var(--ink); }
html[data-theme="light"] .app-shell .topbar { background: rgba(247, 241, 231, .94); border-color: var(--line); }
html[data-theme="light"] .app-shell .top-search,
html[data-theme="light"] .app-shell .search-box,
html[data-theme="light"] .app-shell .select,
html[data-theme="light"] .app-shell .filter-bar,
html[data-theme="light"] .app-shell .lead-filter-bar,
html[data-theme="light"] .app-shell .customer-filter-bar,
html[data-theme="light"] .app-shell .followup-filter-bar,
html[data-theme="light"] .app-shell .followup-custom-date-bar { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .top-search input,
html[data-theme="light"] .app-shell .form-field input,
html[data-theme="light"] .app-shell .form-field select,
html[data-theme="light"] .app-shell .form-field textarea,
html[data-theme="light"] .app-shell .form-grid input,
html[data-theme="light"] .app-shell .form-grid select,
html[data-theme="light"] .app-shell .form-grid textarea,
html[data-theme="light"] .app-shell .select,
html[data-theme="light"] .app-shell select { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell select { color-scheme: light; }
html[data-theme="light"] .app-shell select option { color: var(--ink); background: var(--paper); }
html[data-theme="light"] .app-shell .card,
html[data-theme="light"] .app-shell .table-card,
html[data-theme="light"] .app-shell .chart-card,
html[data-theme="light"] .app-shell .kpi-card,
html[data-theme="light"] .app-shell .dashboard-welcome,
html[data-theme="light"] .app-shell .dashboard-card,
html[data-theme="light"] .app-shell .followup-performance-card,
html[data-theme="light"] .app-shell .followup-calendar-card,
html[data-theme="light"] .app-shell .report-filter-bar,
html[data-theme="light"] .app-shell .report-metric-card,
html[data-theme="light"] .app-shell .report-section { color: var(--ink); border-color: var(--line); background: var(--paper); box-shadow: var(--shadow); }
html[data-theme="light"] .app-shell .crumbs,
html[data-theme="light"] .app-shell .page-header h1,
html[data-theme="light"] .app-shell h2,
html[data-theme="light"] .app-shell h3,
html[data-theme="light"] .app-shell h4,
html[data-theme="light"] .app-shell .kpi-value,
html[data-theme="light"] .app-shell .detail-value,
html[data-theme="light"] .app-shell .section-title h3,
html[data-theme="light"] .app-shell .report-section h3,
html[data-theme="light"] .app-shell .report-metric-card strong { color: var(--ink); }
html[data-theme="light"] .app-shell .page-subtitle,
html[data-theme="light"] .app-shell .person-meta,
html[data-theme="light"] .app-shell .kpi-label,
html[data-theme="light"] .app-shell .detail-label,
html[data-theme="light"] .app-shell .timeline-copy,
html[data-theme="light"] .app-shell .timeline-time,
html[data-theme="light"] .app-shell .section-title p,
html[data-theme="light"] .app-shell .table-head p,
html[data-theme="light"] .app-shell .report-filter-grid label,
html[data-theme="light"] .app-shell .report-filter-footer,
html[data-theme="light"] .app-shell .report-section > p { color: var(--muted); }
html[data-theme="light"] .app-shell table th { color: var(--ink); background: var(--cream-deep); border-color: var(--line); }
html[data-theme="light"] .app-shell table td { color: var(--ink); border-color: var(--line); }
html[data-theme="light"] .app-shell .table-wrap table th:first-child,
html[data-theme="light"] .app-shell .table-wrap table td:first-child { background: var(--paper); box-shadow: 5px 0 8px rgba(69, 47, 20, .06); }
html[data-theme="light"] .app-shell .table-wrap table thead th:first-child { background: var(--cream-deep); }
html[data-theme="light"] .app-shell table tbody tr:hover { background: var(--gold-pale); }
html[data-theme="light"] .app-shell .lead-summary-card,
html[data-theme="light"] .app-shell .customer-summary-card,
html[data-theme="light"] .app-shell .followup-summary-card,
html[data-theme="light"] .app-shell .followup-metric,
html[data-theme="light"] .app-shell .mini-stat,
html[data-theme="light"] .app-shell .customer-note,
html[data-theme="light"] .app-shell .customer-followup-preview,
html[data-theme="light"] .app-shell .followup-history-row,
html[data-theme="light"] .app-shell .followup-detail-note,
html[data-theme="light"] .app-shell .presence-picker { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .drawer,
html[data-theme="light"] .app-shell .report-drawer,
html[data-theme="light"] .app-shell .notification-panel,
html[data-theme="light"] .app-shell .global-search-popover { color: var(--ink); border-color: var(--line); background: var(--paper); box-shadow: -20px 0 60px rgba(69, 47, 20, .16); }
html[data-theme="light"] .app-shell .drawer-header,
html[data-theme="light"] .app-shell .drawer-section,
html[data-theme="light"] .app-shell .tabs { border-color: var(--line); }
html[data-theme="light"] .app-shell .drawer-close,
html[data-theme="light"] .app-shell .mobile-menu-toggle { color: var(--ink); border-color: var(--line); background: var(--cream-deep); }
html[data-theme="light"] .app-shell .chat-layout,
html[data-theme="light"] .app-shell .chat-main,
html[data-theme="light"] .app-shell .messages,
html[data-theme="light"] .app-shell .chat-workspace { background: var(--paper); border-color: var(--line); }
html[data-theme="light"] .app-shell .chat-sidebar,
html[data-theme="light"] .app-shell .chat-details { color: var(--ink); background: var(--cream-deep); border-color: var(--line); }
html[data-theme="light"] .app-shell .channel { color: var(--muted); }
html[data-theme="light"] .app-shell .channel:hover,
html[data-theme="light"] .app-shell .channel.active { color: var(--ink); background: var(--gold-pale); }
html[data-theme="light"] .app-shell .message-bubble,
html[data-theme="light"] .app-shell .chat-composer { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .message-bubble.mine { background: var(--gold-pale); }
html[data-theme="light"] .app-shell .dashboard-toolbar,
html[data-theme="light"] .app-shell .dashboard-date-filter select,
html[data-theme="light"] .app-shell .dashboard-date-filter input,
html[data-theme="light"] .app-shell .dashboard-agent-filter summary,
html[data-theme="light"] .app-shell .dashboard-agent-filter-menu { color: var(--ink); border-color: var(--line); background: var(--paper); }

/* Feature-specific light surfaces. These selectors sit after the stitched
   dark workspace rules so module controls cannot fall back to navy panels when
   the workspace is switched to Light or System-light mode. */
html[data-theme="light"] .app-shell .user-metric,
html[data-theme="light"] .app-shell .user-filter-bar,
html[data-theme="light"] .app-shell .user-empty-state,
html[data-theme="light"] .app-shell .user-audit-row,
html[data-theme="light"] .app-shell .account-card,
html[data-theme="light"] .app-shell .account-password-card,
html[data-theme="light"] .app-shell .account-settings-sidebar,
html[data-theme="light"] .app-shell .account-readonly-grid > div,
html[data-theme="light"] .app-shell .password-policy { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .user-filter-bar select,
html[data-theme="light"] .app-shell .user-filter-bar .search-box,
html[data-theme="light"] .app-shell .account-card input,
html[data-theme="light"] .app-shell .account-card select,
html[data-theme="light"] .app-shell .account-card textarea,
html[data-theme="light"] .app-shell .account-password-card input,
html[data-theme="light"] .app-shell .account-password-card select,
html[data-theme="light"] .app-shell .account-password-card textarea { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .user-metric span,
html[data-theme="light"] .app-shell .user-metric small,
html[data-theme="light"] .app-shell .user-empty-state,
html[data-theme="light"] .app-shell .user-detail-grid small,
html[data-theme="light"] .app-shell .user-audit-row small,
html[data-theme="light"] .app-shell .account-security-list span,
html[data-theme="light"] .app-shell .account-readonly-grid span,
html[data-theme="light"] .app-shell .password-policy { color: var(--muted); }
html[data-theme="light"] .app-shell .user-metric strong,
html[data-theme="light"] .app-shell .user-empty-state strong,
html[data-theme="light"] .app-shell .user-detail-grid b,
html[data-theme="light"] .app-shell .user-audit-row span,
html[data-theme="light"] .app-shell .account-security-list b,
html[data-theme="light"] .app-shell .account-card h3,
html[data-theme="light"] .app-shell .account-password-card h2 { color: var(--ink); }
html[data-theme="light"] .app-shell .user-detail-actions,
html[data-theme="light"] .app-shell .user-detail-section,
html[data-theme="light"] .app-shell .account-security-list > div { border-color: var(--line); }

html[data-theme="light"] .app-shell .customer-search-field,
html[data-theme="light"] .app-shell .customer-search-field input,
html[data-theme="light"] .app-shell .customer-filter-bar,
html[data-theme="light"] .app-shell .customer-action-options,
html[data-theme="light"] .app-shell .customer-note,
html[data-theme="light"] .app-shell .customer-followup-preview,
html[data-theme="light"] .app-shell .customer-placeholder { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .customer-search-field input::placeholder { color: var(--muted); opacity: 1; }
html[data-theme="light"] .app-shell .customer-note p,
html[data-theme="light"] .app-shell .customer-placeholder p,
html[data-theme="light"] .app-shell .customer-followup-preview p { color: var(--ink); }
html[data-theme="light"] .app-shell .customer-note-head span,
html[data-theme="light"] .app-shell .customer-note time,
html[data-theme="light"] .app-shell .customer-placeholder p,
html[data-theme="light"] .app-shell .customer-followup-preview span { color: var(--muted); }

html[data-theme="light"] .app-shell .chat-workspace,
html[data-theme="light"] .app-shell .chat-workspace .chat-sidebar,
html[data-theme="light"] .app-shell .chat-workspace .chat-main,
html[data-theme="light"] .app-shell .chat-workspace .messages,
html[data-theme="light"] .app-shell .chat-workspace .chat-details,
html[data-theme="light"] .app-shell .chat-workspace .chat-info-panel,
html[data-theme="light"] .app-shell .chat-workspace .chat-compose,
html[data-theme="light"] .app-shell .chat-workspace .chat-header-button,
html[data-theme="light"] .app-shell .chat-workspace .chat-search,
html[data-theme="light"] .app-shell .chat-workspace .chat-compose textarea,
html[data-theme="light"] .app-shell .chat-group-management,
html[data-theme="light"] .app-shell .chat-member-manager,
html[data-theme="light"] .app-shell .chat-modal,
html[data-theme="light"] .app-shell .chat-member-option { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .chat-workspace .chat-sidebar,
html[data-theme="light"] .app-shell .chat-workspace .chat-details,
html[data-theme="light"] .app-shell .chat-workspace .chat-info-panel { background: var(--cream-deep); }
html[data-theme="light"] .app-shell .chat-workspace .chat-header-button:hover,
html[data-theme="light"] .app-shell .chat-list-item:hover,
html[data-theme="light"] .app-shell .chat-list-item.active,
html[data-theme="light"] .app-shell .chat-group-management,
html[data-theme="light"] .app-shell .chat-member-option:has(input:checked) { background: var(--gold-pale); }
html[data-theme="light"] .app-shell .chat-section-heading,
html[data-theme="light"] .app-shell .chat-list-copy small,
html[data-theme="light"] .app-shell .chat-list-meta time,
html[data-theme="light"] .app-shell .chat-sidebar-empty,
html[data-theme="light"] .app-shell .chat-sidebar-footer,
html[data-theme="light"] .app-shell .chat-info-member small,
html[data-theme="light"] .app-shell .shared-asset small,
html[data-theme="light"] .app-shell .shared-link small,
html[data-theme="light"] .app-shell .chat-group-management > p,
html[data-theme="light"] .app-shell .chat-member-manager label,
html[data-theme="light"] .app-shell .chat-member-manager label small { color: var(--muted); }
html[data-theme="light"] .app-shell .chat-list-title,
html[data-theme="light"] .app-shell .chat-info-panel h2,
html[data-theme="light"] .app-shell .shared-asset,
html[data-theme="light"] .app-shell .shared-link,
html[data-theme="light"] .app-shell .chat-modal { color: var(--ink); }
html[data-theme="light"] .app-shell .chat-date-separator,
html[data-theme="light"] .app-shell .message-meta time { color: var(--muted); }
html[data-theme="light"] .app-shell .chat-date-separator::before,
html[data-theme="light"] .app-shell .chat-date-separator::after,
html[data-theme="light"] .app-shell .chat-header-button,
html[data-theme="light"] .app-shell .chat-info-section,
html[data-theme="light"] .app-shell .chat-sidebar-footer { border-color: var(--line); }
html[data-theme="light"] .app-shell .message-bubble .attachment-preview,
html[data-theme="light"] .app-shell .shared-link,
html[data-theme="light"] .app-shell .chat-placeholder { border-color: var(--line); background: var(--cream-deep); }

/* Shared contrast corrections for the light workspace. The stitched workspace
   rules above intentionally use a dark palette and are more specific than the
   base controls, so reset every text-bearing control that would otherwise keep
   ivory text or a dark-mode placeholder on a light surface. */
html[data-theme="light"] .app-shell .btn-secondary,
html[data-theme="light"] .app-shell .table-action { color: var(--ink); border-color: var(--line); background: var(--paper); }
html[data-theme="light"] .app-shell .btn-secondary:hover,
html[data-theme="light"] .app-shell .table-action:hover { color: var(--ink); background: var(--gold-pale); }
html[data-theme="light"] .app-shell input::placeholder,
html[data-theme="light"] .app-shell textarea::placeholder,
html[data-theme="light"] .app-shell .chat-workspace .chat-search input::placeholder { color: var(--muted); opacity: 1; }
html[data-theme="light"] .app-shell .notification-panel { color: var(--ink); background: var(--paper); }
html[data-theme="light"] .app-shell .notification-head { background: var(--paper); border-color: var(--line); }
html[data-theme="light"] .app-shell .notification-head b,
html[data-theme="light"] .app-shell .notification-item b { color: var(--ink); }
html[data-theme="light"] .app-shell .notification-head small,
html[data-theme="light"] .app-shell .notification-filter,
html[data-theme="light"] .app-shell .notification-item small,
html[data-theme="light"] .app-shell .notification-item time { color: var(--muted); }
html[data-theme="light"] .app-shell .notification-filter select { color: var(--ink); border-color: var(--line); background: var(--white); }
html[data-theme="light"] .app-shell .notification-item:hover,
html[data-theme="light"] .app-shell .notification-item.unread { background: var(--gold-pale); }

html[data-theme="light"] .app-shell .badge-neutral { color: #716b63; background: #eeeae4; }
html[data-theme="light"] .app-shell .badge-hot,
html[data-theme="light"] .app-shell .badge-booking { color: #7a4b0b; background: var(--gold-pale); }
html[data-theme="light"] .app-shell .badge-warm,
html[data-theme="light"] .app-shell .badge-follow { color: #805a24; background: var(--amber-pale); }
html[data-theme="light"] .app-shell .badge-overdue,
html[data-theme="light"] .app-shell .badge-lost { color: var(--red); background: var(--red-pale); }
html[data-theme="light"] .app-shell .badge-completed,
html[data-theme="light"] .app-shell .badge-closed { color: var(--green); background: var(--green-pale); }
html[data-theme="light"] .app-shell .dashboard-followup-row.is-overdue { background: #fcf0ee; }
html[data-theme="light"] .app-shell .dashboard-followup-row.is-overdue .dashboard-followup-main strong { color: var(--ink); }
html[data-theme="light"] .app-shell .dashboard-followup-row.is-overdue .dashboard-followup-main span { color: var(--muted); }
html[data-theme="light"] .app-shell .empty-state { color: var(--muted); }
html[data-theme="light"] .app-shell .empty-state strong { color: var(--ink); }
html[data-theme="light"] .app-shell .followup-calendar-day,
html[data-theme="light"] .app-shell .followup-calendar-empty { color: var(--ink); border-color: transparent; background: var(--paper); }
html[data-theme="light"] .app-shell .followup-calendar-day:hover,
html[data-theme="light"] .app-shell .followup-calendar-day.selected { border-color: var(--gold); background: var(--gold-pale); }
html[data-theme="light"] .app-shell .followup-calendar-week,
html[data-theme="light"] .app-shell .followup-calendar-legend { color: var(--muted); }

/* Team Chat has a mobile inbox-specific palette that also needs an explicit
   light reset; otherwise its white labels disappear against cream surfaces. */
html[data-theme="light"] .app-shell .chat-workspace .chat-search input { color: var(--ink); }
html[data-theme="light"] .app-shell .chat-section-action,
html[data-theme="light"] .app-shell .chat-info-trigger,
html[data-theme="light"] .app-shell .mobile-chat-toggle { color: var(--gold); border-color: var(--line); background: var(--gold-pale); }
html[data-theme="light"] .app-shell .chat-system-message,
html[data-theme="light"] .app-shell .chat-file-name { color: var(--gold); }
html[data-theme="light"] .app-shell .message-bubble .attachment-preview { background: var(--cream-deep); }
html[data-theme="light"] .app-shell .chat-mobile-sidebar-head { color: var(--ink); }
html[data-theme="light"] .app-shell .chat-mobile-sidebar-head small,
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-copy small,
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-meta time { color: var(--muted); }
html[data-theme="light"] .app-shell .chat-mobile-filter { color: var(--muted); border-color: var(--line); }
html[data-theme="light"] .app-shell .chat-mobile-filter.active { color: var(--ink); border-color: var(--gold); background: var(--gold-pale); }
html[data-theme="light"] .app-shell .chat-mobile-filter span,
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-meta .unread { color: #2d2419; background: var(--gold); }
html[data-theme="light"] .app-shell .chat-mobile-archive { color: var(--ink); border-color: var(--line); }
html[data-theme="light"] .app-shell .chat-mobile-archive-icon { color: var(--gold); background: var(--gold-pale); }
html[data-theme="light"] .app-shell .chat-mobile-archive small { color: var(--muted); }
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-item { color: var(--ink); border-color: var(--line); }
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-item:hover,
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-item.active { color: var(--ink); background: var(--gold-pale); }
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-avatar.channel,
html[data-theme="light"] .app-shell .chat-mobile-inbox-list .chat-list-avatar.group { color: var(--ink); background: var(--gold-pale); }

/* Give the desktop login panel enough visual weight at normal and browser-scaled
   zoom levels; the compact mobile rules above remain unchanged. */
@media (min-width: 851px) {
  .login-form-wrap { padding: clamp(36px, 4.5vw, 72px); }
  .login-form { width: min(100%, 520px); padding: clamp(42px, 4vw, 56px); border-radius: 24px; }
  .login-form-brand { gap: 15px; padding-bottom: 38px; }
  .login-form-brand .brand-logo { width: 58px; height: 58px; flex-basis: 58px; }
  .login-form .brand-title { font-size: 21px; }
  .login-form .brand-subtitle { font-size: 10px; letter-spacing: .14em; }
  .login-form .eyebrow { font-size: 11px; letter-spacing: .16em; }
  .login-form h1 { font-size: 32px; line-height: 1.1; }
  .login-form .page-subtitle { max-width: 390px; font-size: 13px; line-height: 1.55; }
  .login-form .form-field { gap: 7px; margin-bottom: 17px; }
  .login-form .form-field label { font-size: 12px; }
  .login-form .form-field input { min-height: 52px; padding: 13px 15px; font-size: 14px; }
  .login-form .form-help { font-size: 12px; }
  .login-form .btn { min-height: 52px; font-size: 14px; }
  .login-form .login-note { margin-top: 18px; font-size: 12px; line-height: 1.5; }
}
