:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-muted: #eef1ef;
  --surface-strong: #e4e9e6;
  --text: #18201e;
  --muted: #68736f;
  --line: #dce2df;
  --brand: #173b3f;
  --brand-strong: #0e2c2f;
  --brand-soft: #dcebea;
  --copper: #a95f35;
  --copper-soft: #f2e6df;
  --green: #277453;
  --green-soft: #e2f1e9;
  --amber: #9a681c;
  --amber-soft: #f7ecd7;
  --red: #a03e3e;
  --red-soft: #f6e2e2;
  --blue: #3567a2;
  --blue-soft: #e4edf7;
  --shadow: 0 12px 36px rgba(31, 48, 42, 0.12);
  --sidebar: 232px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); overflow: hidden; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
svg { width: 19px; height: 19px; stroke-width: 1.8; flex: 0 0 auto; }

.auth-gate { position: fixed; z-index: 100; inset: 0; display: grid; grid-template-columns: minmax(220px, 360px) minmax(320px, 440px); justify-content: center; align-content: center; gap: 72px; padding: 32px; background: #eef1ef; }
.auth-gate[hidden] { display: none; }
.auth-brand { align-self: start; display: flex; align-items: center; gap: 13px; padding-top: 8px; }
.auth-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; }
.auth-brand div:last-child { display: grid; gap: 3px; }
.auth-brand strong { font-size: 20px; }
.auth-brand span { color: var(--muted); font-size: 13px; }
.auth-form { display: grid; gap: 15px; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.auth-form h1 { margin: -7px 0 0; font-size: 26px; letter-spacing: 0; }
.auth-copy { margin: -5px 0 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-form label { display: grid; gap: 7px; color: #48534f; font-size: 12px; font-weight: 700; }
.auth-form input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #cbd4d0; border-radius: 6px; background: white; color: var(--text); }
.auth-error { min-height: 18px; margin: -4px 0; color: var(--red); font-size: 12px; }
.auth-submit { width: 100%; height: 44px; }
.app-shell.is-locked { visibility: hidden; }
.status-dot.is-online { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: relative; z-index: 20; height: 100vh; padding: 18px 12px 14px; display: flex; flex-direction: column; background: #f9faf9; border-right: 1px solid var(--line); }
.brand { height: 54px; display: flex; align-items: center; gap: 11px; padding: 0 9px 14px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--brand); color: white; border-radius: 6px; font-weight: 800; font-size: 18px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 15px; }
.brand-copy span { font-size: 11px; color: var(--muted); }
.main-nav { display: grid; gap: 3px; padding-top: 14px; }
.nav-item { min-height: 42px; width: 100%; padding: 0 11px; border: 0; background: transparent; border-radius: 6px; display: grid; grid-template-columns: 21px minmax(0, 1fr) auto; align-items: center; gap: 10px; color: #46514d; text-align: left; cursor: pointer; }
.nav-item:hover { background: var(--surface-muted); }
.nav-item.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: white; font-size: 11px; }
.nav-count.muted { background: #d7ddda; color: #56615d; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.server-state { padding: 11px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.server-state div { display: grid; min-width: 0; }
.server-state strong { font-size: 11px; }
.server-state span { font-size: 10px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.nav-item.compact { border-top: 1px solid var(--line); border-radius: 0; padding-top: 7px; }

.workspace { min-width: 0; height: 100vh; overflow: auto; padding: 76px 28px 40px; }
.topbar { position: fixed; z-index: 15; top: 0; left: var(--sidebar); right: 0; height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 18px; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line); }
.search-box, .compact-search { display: flex; align-items: center; gap: 9px; color: var(--muted); background: var(--surface-muted); border: 1px solid transparent; border-radius: 6px; }
.search-box { width: min(440px, 42vw); height: 38px; padding: 0 11px; }
.search-box:focus-within, .compact-search:focus-within { background: white; border-color: #a9b7b1; }
.search-box input, .compact-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box kbd { border: 1px solid #cbd3cf; padding: 2px 5px; border-radius: 4px; background: white; font-size: 10px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button, .command-button, .primary-button, .secondary-button, .text-button, .send-button { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; padding: 0; background: transparent; border-radius: 6px; color: #4d5a55; }
.icon-button:hover { background: var(--surface-muted); }
.icon-button.small { width: 32px; height: 32px; }
.command-button, .primary-button { min-height: 38px; padding: 0 14px; border-radius: 6px; background: var(--brand); color: white; font-weight: 700; }
.command-button:hover, .primary-button:hover { background: var(--brand-strong); }
.secondary-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-weight: 700; }
.secondary-button:hover { background: var(--surface-muted); }
.secondary-button.danger { color: var(--red); }
.text-button { padding: 6px 0; background: transparent; color: var(--brand); font-weight: 700; }
.notification-dot { position: absolute; width: 7px; height: 7px; background: #c95147; border: 2px solid white; border-radius: 50%; transform: translate(8px, -9px); }
.profile-button { height: 44px; padding: 4px 7px 4px 4px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.profile-button:hover { background: var(--surface-muted); }
.profile-copy { display: grid; text-align: left; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { font-size: 10px; color: var(--muted); }
.avatar { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #dfe5e2; color: #31403a; font-size: 11px; font-weight: 800; }
.avatar-owner { background: var(--copper-soft); color: #774223; }
.avatar.teal { background: #dcebea; color: #1c5d61; }
.avatar.blue { background: var(--blue-soft); color: var(--blue); }
.avatar.plum { background: #eee4ef; color: #734a77; }
.mobile-menu { display: none; }

.view { display: none; max-width: 1500px; margin: 0 auto; }
.view.is-visible { display: block; }
.page-header { min-height: 58px; margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.page-header h1, .channel-header h1 { margin: 2px 0 0; font-size: 34px; line-height: 1.1; letter-spacing: 0; }
.eyebrow { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0; font-weight: 800; color: var(--muted); }

.attention-band { min-height: 52px; display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: stretch; background: #fff9ef; border: 1px solid #ead8b6; border-radius: 6px; overflow: hidden; }
.attention-label { padding: 0 16px; display: flex; align-items: center; gap: 9px; background: var(--amber-soft); color: #704710; font-weight: 800; }
.attention-items { display: flex; min-width: 0; }
.attention-items button { min-width: 230px; flex: 1; padding: 8px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 0; border-left: 1px solid #ead8b6; background: transparent; text-align: left; cursor: pointer; }
.attention-items button:hover { background: white; }
.attention-items span { color: #7a6b58; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.metric-strip { margin: 16px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.metric-strip > div { min-height: 104px; padding: 17px 19px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: end; gap: 7px 12px; border-right: 1px solid var(--line); }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip span { color: var(--muted); font-size: 12px; }
.metric-strip strong { grid-row: 1 / 3; grid-column: 2; font-size: 32px; line-height: 1; }
.metric-strip small { font-size: 11px; color: #86918d; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.panel-header { min-height: 66px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0 0 3px; font-size: 15px; }
.panel-header p { margin: 0; color: var(--muted); font-size: 11px; }
.work-panel, .today-panel { min-height: 320px; }
.activity-panel, .team-panel { min-height: 240px; }
.work-list, .task-list, .activity-list { display: grid; }
.work-item { min-height: 61px; padding: 10px 15px; display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(130px, 1fr) 112px 26px; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.work-item:last-child { border-bottom: 0; }
.work-item:hover { background: #fafbfa; }
.work-item strong, .work-item p { margin: 0; }
.work-item p { font-size: 11px; color: var(--muted); }
.work-item > div { display: grid; gap: 3px; }
.status-chip { width: fit-content; max-width: 100%; min-height: 24px; padding: 4px 8px; display: inline-flex; align-items: center; border-radius: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-chip.paid { background: var(--amber-soft); color: var(--amber); }
.status-chip.waiting { background: var(--blue-soft); color: var(--blue); }
.status-chip.closed { background: var(--green-soft); color: var(--green); }
.status-chip.attention { background: var(--red-soft); color: var(--red); }

.task-item { min-height: 61px; padding: 10px 15px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.task-item:last-child { border-bottom: 0; }
.task-check { width: 19px; height: 19px; border: 1px solid #aeb8b4; border-radius: 4px; background: white; cursor: pointer; }
.task-check.is-done { background: var(--green); border-color: var(--green); color: white; }
.task-item > div { display: grid; gap: 3px; }
.task-item strong { font-size: 12px; }
.task-item small, .task-item time { color: var(--muted); font-size: 10px; }
.task-item.is-done strong { text-decoration: line-through; color: var(--muted); }
.activity-list article { min-height: 66px; padding: 11px 15px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; border-bottom: 1px solid var(--line); }
.activity-list article:last-child { border-bottom: 0; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; }
.activity-icon.success { color: var(--green); background: var(--green-soft); }
.activity-icon.paid { color: var(--amber); background: var(--amber-soft); }
.activity-icon.info { color: var(--blue); background: var(--blue-soft); }
.activity-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.activity-list strong { font-size: 12px; }
.activity-list p { grid-column: 1; margin: 0; font-size: 11px; color: var(--muted); }
.activity-list time { grid-column: 2; grid-row: 1; font-size: 10px; color: #8a9490; }
.people-list { display: grid; }
.people-list > div { min-height: 58px; padding: 8px 15px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 10px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.people-list > div:last-child { border-bottom: 0; }
.people-list p { margin: 0; display: grid; }
.people-list strong { font-size: 12px; }
.people-list small { font-size: 10px; color: var(--muted); }
.presence { width: 8px; height: 8px; border-radius: 50%; }
.presence.online { background: #32a36d; }
.presence.away { background: #d69b34; }

.chat-view.is-visible { max-width: none; height: calc(100vh - 116px); margin: -12px -28px -40px; }
.chat-layout { height: 100%; display: grid; grid-template-columns: 300px minmax(0, 1fr); border-top: 1px solid var(--line); }
.channel-list { min-width: 0; overflow: auto; background: #fafbfa; border-right: 1px solid var(--line); }
.channel-header { height: 79px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.channel-header h1 { font-size: 23px; }
.compact-search { height: 36px; margin: 0 12px 14px; padding: 0 10px; }
.compact-search.wide { width: min(360px, 100%); margin: 0; }
.section-label { margin: 14px 15px 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0; font-weight: 800; }
.channel-item { width: calc(100% - 12px); min-height: 54px; margin: 2px 6px; padding: 7px 9px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.channel-item:hover, .channel-item.is-active { background: var(--brand-soft); }
.channel-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--brand); background: #e8efed; }
.channel-item > span:nth-child(2) { min-width: 0; display: grid; }
.channel-item strong, .channel-item small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.channel-item strong { font-size: 12px; }
.channel-item small, .channel-item time { font-size: 10px; color: var(--muted); }
.conversation { min-width: 0; display: grid; grid-template-rows: 63px minmax(0, 1fr) auto; background: white; }
.conversation-header { padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.conversation-header > div:first-child { display: grid; }
.conversation-header strong { font-size: 14px; }
.conversation-header span { font-size: 10px; color: var(--muted); }
.conversation-header > div:last-child { display: flex; gap: 3px; }
.message-stream { min-height: 0; overflow: auto; padding: 22px max(18px, calc((100% - 820px) / 2)); display: flex; flex-direction: column; gap: 17px; background: #fbfcfb; }
.message-day { align-self: center; padding: 4px 8px; border-radius: 4px; background: var(--surface-muted); font-size: 10px; color: var(--muted); }
.message { max-width: min(650px, 85%); display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; }
.message.mine { align-self: flex-end; grid-template-columns: minmax(0, 1fr); }
.message.mine .message-bubble { background: var(--brand-soft); }
.message-bubble { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: 0 2px 7px rgba(31, 48, 42, .04); }
.message-meta { margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.message-meta strong { font-size: 11px; }
.message-meta time { font-size: 9px; color: var(--muted); }
.message-bubble p { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.message-composer { min-height: 64px; padding: 10px max(14px, calc((100% - 850px) / 2)); display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px 38px; align-items: end; gap: 6px; border-top: 1px solid var(--line); background: white; }
.message-composer textarea { max-height: 120px; resize: none; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; line-height: 1.35; }
.message-composer textarea:focus { border-color: #8ba29a; }
.send-button { width: 38px; height: 38px; border-radius: 6px; background: var(--brand); color: white; }

.toolbar { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 16px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 6px; background: var(--surface-strong); }
.segmented button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; color: var(--muted); }
.segmented button.is-active { background: white; color: var(--text); box-shadow: 0 1px 4px rgba(31, 48, 42, .1); font-weight: 700; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: white; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { height: 42px; padding: 0 14px; text-align: left; color: var(--muted); background: #f8faf9; border-bottom: 1px solid var(--line); font-size: 10px; text-transform: uppercase; letter-spacing: 0; }
.data-table td { height: 60px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfa; }
.data-table td p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.data-table .icon-button { width: 31px; height: 31px; }

.directory-toolbar { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.directory-search { width: min(320px, 100%); }
.directory-summary { margin-bottom: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.directory-summary button { min-height: 64px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-right: 1px solid var(--line); background: white; color: var(--muted); cursor: pointer; text-align: left; }
.directory-summary button:last-child { border-right: 0; }
.directory-summary button:hover, .directory-summary button.is-active { background: var(--brand-soft); color: var(--brand); }
.directory-summary span { font-size: 11px; font-weight: 700; }
.directory-summary strong { font-size: 22px; }
.directory-table { min-width: 920px; }
.directory-empty { height: 150px !important; text-align: center; color: var(--muted); }

.task-board { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.task-column { min-height: 300px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #ecefed; }
.task-column-header { height: 38px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; }
.task-column-header strong { font-size: 12px; }
.task-column-header span { width: 22px; height: 22px; display: grid; place-items: center; background: #d8dfdb; border-radius: 4px; font-size: 10px; }
.task-card { padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.task-card > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.task-card strong { font-size: 12px; }
.task-card p { margin: 7px 0 11px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.task-card footer { display: flex; align-items: center; justify-content: space-between; }
.task-card footer span { font-size: 10px; color: var(--muted); }
.task-card footer button { width: 28px; height: 28px; }

.client-grid { display: grid; gap: 8px; }
.client-row { min-height: 76px; padding: 12px 15px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 38px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.company-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-muted); color: var(--brand); }
.client-row strong { font-size: 13px; }
.client-row p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.files-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; }
.folder-list { display: grid; gap: 3px; align-content: start; }
.folder-list button { min-height: 40px; padding: 0 10px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.folder-list button:hover, .folder-list button.is-active { background: var(--brand-soft); color: var(--brand); }
.folder-list span { font-size: 10px; color: var(--muted); }
.document-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(300px, 1fr); gap: 10px; align-content: start; }
.document-card { grid-row: span 2; min-height: 330px; padding: 12px; display: grid; grid-template-rows: minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 6px; background: white; position: relative; overflow: hidden; }
.document-card img { width: 100%; height: 245px; object-fit: cover; object-position: top; border: 1px solid var(--line); background: #eee; }
.document-card > div { display: grid; gap: 3px; padding-top: 10px; }
.document-card strong { font-size: 12px; }
.document-card p { margin: 0; font-size: 10px; color: var(--muted); }
.document-card .icon-button { position: absolute; right: 10px; bottom: 10px; }
.file-type { color: var(--red); font-size: 9px; font-weight: 800; }
.document-row { min-height: 78px; padding: 12px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 36px; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.file-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; }
.file-icon.pdf { color: var(--red); background: var(--red-soft); }
.file-icon.sheet { color: var(--green); background: var(--green-soft); }
.document-row strong { font-size: 12px; }
.document-row p { margin: 3px 0 0; font-size: 10px; color: var(--muted); }
.document-row time { font-size: 10px; color: var(--muted); }

.settings-list { display: grid; gap: 8px; max-width: 900px; }
.settings-list > div { min-height: 74px; padding: 12px 15px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.settings-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-muted); color: var(--brand); }
.settings-list strong { font-size: 12px; }
.settings-list p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.scrim { position: fixed; z-index: 29; inset: 0; background: rgba(12, 22, 19, .28); opacity: 0; visibility: hidden; transition: opacity .16s; }
.scrim.is-visible { opacity: 1; visibility: visible; }
.notification-panel { position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); padding: 18px; background: white; box-shadow: var(--shadow); transform: translateX(102%); transition: transform .18s ease; }
.notification-panel.is-open { transform: translateX(0); }
.notification-panel header { height: 54px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.notification-panel h2 { margin: 3px 0 0; font-size: 19px; }
.notification-list article { min-height: 88px; padding: 14px 2px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); }
.notification-list article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-muted); color: var(--brand); }
.notification-list article.unread > span { background: var(--copper-soft); color: var(--copper); }
.notification-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.notification-list strong { font-size: 12px; }
.notification-list p { grid-column: 1 / 3; margin: 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.notification-list time { font-size: 9px; color: var(--muted); }

.app-dialog { width: min(500px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 6px; box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(12, 22, 19, .44); }
.app-dialog form { padding: 18px; }
.app-dialog header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.app-dialog h2 { margin: 3px 0 0; font-size: 20px; }
.app-dialog label { display: grid; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
.app-dialog input, .app-dialog select, .app-dialog textarea { padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text); }
.app-dialog input, .app-dialog select { height: 40px; }
.app-dialog textarea { min-height: 84px; padding-top: 9px; resize: vertical; font: inherit; }
.app-dialog input:focus, .app-dialog select:focus, .app-dialog textarea:focus { outline: 2px solid var(--brand-soft); border-color: #8ba29a; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.directory-dialog { width: min(720px, calc(100vw - 24px)); }
.directory-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; max-height: min(62vh, 580px); padding-right: 3px; overflow: auto; }
.directory-fields .field-span-2 { grid-column: 1 / -1; }
.form-error { min-height: 16px; margin: 0; color: var(--red); font-size: 11px; }
.app-dialog menu { margin: 6px 0 0; padding: 14px 0 0; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.meeting-dialog { width: min(880px, calc(100vw - 24px)); display: none; grid-template-columns: 1.4fr 1fr; overflow: hidden; }
.meeting-dialog[open] { display: grid; }
.meeting-preview { min-height: 470px; display: grid; place-items: center; position: relative; background: #17211e; color: white; }
.meeting-preview video { width: 100%; height: 100%; object-fit: cover; }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; }
.camera-placeholder svg { width: 42px; height: 42px; }
.camera-placeholder span { max-width: 250px; color: #b9c3bf; font-size: 11px; }
.meeting-content { padding: 24px; display: flex; flex-direction: column; }
.meeting-content h2 { margin: 4px 0 9px; }
.meeting-content > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.meeting-controls { margin-top: auto; display: flex; gap: 8px; }
.meeting-controls .icon-button { width: 44px; height: 44px; background: var(--surface-muted); }
.meeting-controls .icon-button.is-on { background: var(--brand); color: white; }
.meeting-controls #closeMeeting { margin-left: auto; background: var(--red); color: white; }
.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; padding: 11px 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #bfcac5; border-radius: 6px; background: white; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease; }
.toast svg { color: var(--green); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.mobile-nav { display: none; }

@media (max-width: 1080px) {
  :root { --sidebar: 76px; }
  .brand-copy, .nav-item span, .nav-count, .server-state div, .sidebar-footer .nav-item span { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { grid-template-columns: 1fr; place-items: center; padding: 0; }
  .server-state { justify-content: center; padding: 12px 0; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(250px, .8fr); }
  .work-item { grid-template-columns: minmax(120px, 1fr) 110px 26px; }
  .work-item > div:nth-child(2) { display: none; }
  .profile-copy, .profile-button > svg { display: none; }
}

@media (max-width: 820px) {
  .auth-gate { grid-template-columns: minmax(0, 440px); gap: 24px; align-content: start; overflow-y: auto; padding: 28px 16px; }
  .auth-brand { padding: 0 8px; }
  .auth-form { padding: 22px; }
  body { overflow: auto; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-102%); transition: transform .18s; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .brand-copy, .nav-item span, .nav-count, .server-state div, .sidebar-footer .nav-item span { display: initial; }
  .nav-item { grid-template-columns: 21px minmax(0, 1fr) auto; place-items: initial; padding: 0 11px; }
  .server-state { justify-content: flex-start; padding: 11px; }
  .workspace { height: auto; min-height: 100vh; padding: 68px 14px 86px; overflow: visible; }
  .topbar { left: 0; height: 58px; padding: 0 12px; gap: 8px; }
  .mobile-menu { display: inline-flex; }
  .search-box { width: min(360px, 100%); flex: 1; }
  .search-box kbd, .command-button span, .profile-button, .topbar-actions .icon-button { display: none; }
  .topbar-actions { margin-left: 0; }
  .command-button { width: 38px; padding: 0; }
  .mobile-nav { position: fixed; z-index: 18; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 4px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line); }
  .mobile-nav button { border: 0; background: transparent; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 9px; }
  .mobile-nav button.is-active { color: var(--brand); font-weight: 800; }
  .mobile-nav svg { width: 20px; height: 20px; }
  .page-header h1 { font-size: 27px; }
  .attention-band { grid-template-columns: 1fr; }
  .attention-label { min-height: 38px; }
  .attention-items { display: grid; }
  .attention-items button { min-width: 0; min-height: 48px; border-left: 0; border-top: 1px solid #ead8b6; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip > div:nth-child(2) { border-right: 0; }
  .metric-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chat-view.is-visible { height: calc(100vh - 122px); margin: -10px -14px -86px; }
  .chat-layout { grid-template-columns: 1fr; }
  .channel-list { display: none; }
  .conversation-header { padding: 0 10px; }
  .message-stream { padding: 15px 12px; }
  .message-composer { padding: 8px; grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .message-composer > button:nth-of-type(2) { display: none; }
  .message-composer .icon-button, .send-button { width: 34px; height: 34px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .directory-toolbar { align-items: stretch; flex-direction: column; }
  .task-board { grid-template-columns: 1fr; }
  .client-row { grid-template-columns: 42px minmax(0, 1fr) 34px; }
  .client-row .status-chip { grid-column: 2; }
  .client-row .icon-button { grid-column: 3; grid-row: 1; }
  .files-layout { grid-template-columns: 1fr; }
  .folder-list { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .folder-list button { min-width: 145px; }
  .document-grid { grid-template-columns: 1fr; }
  .document-card { grid-row: auto; }
  .meeting-dialog[open] { grid-template-columns: 1fr; }
  .meeting-preview { min-height: 280px; }
  .meeting-content { min-height: 240px; }
}

@media (max-width: 520px) {
  .page-header { align-items: center; }
  .page-header .primary-button, .page-header .secondary-button { width: 38px; padding: 0; font-size: 0; }
  .page-header .primary-button svg, .page-header .secondary-button svg { width: 19px; height: 19px; }
  .metric-strip > div { min-height: 88px; padding: 13px; }
  .metric-strip strong { font-size: 26px; }
  .work-item { grid-template-columns: minmax(0, 1fr) auto 22px; gap: 8px; padding: 9px 11px; }
  .panel-header { padding: 12px; }
  .activity-list article { padding: 10px 12px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .directory-summary { grid-template-columns: 1fr; }
  .directory-summary button { min-height: 46px; border-right: 0; border-bottom: 1px solid var(--line); }
  .directory-summary button:last-child { border-bottom: 0; }
  .directory-fields { grid-template-columns: 1fr; }
  .directory-fields .field-span-2 { grid-column: auto; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .settings-list > div { grid-template-columns: 40px minmax(0, 1fr); }
  .settings-list .status-chip, .settings-list .secondary-button { grid-column: 2; }
}
