:root {
  color-scheme: light;
  --ink: #141414;
  --ink-soft: #333333;
  --muted: #737373;
  --line: #e8e8e8;
  --line-strong: #d4d4d4;
  --surface: #ffffff;
  --surface-2: #f7f7f6;
  --surface-3: #f1f1ef;
  --sidebar: #fbfbfa;
  --success: #347458;
  --warning: #8a611b;
  --danger: #a34444;
  --shadow: 0 18px 54px rgba(0,0,0,.13);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--surface); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #777; outline-offset: 2px; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; }
.hidden { display: none !important; }
.icon { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; }

/* Sign in and first-run setup */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) 1.1fr; background: #fff; }
.auth-aside { background: #111; color: white; padding: clamp(28px, 5vw, 68px); display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; font: 800 17px/1 'Manrope', sans-serif; letter-spacing: -.04em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; font-size: 18px; font-weight: 500; }
.auth-aside .brand-mark { border-color: rgba(255,255,255,.6); }
.auth-pitch { max-width: 460px; margin: 10vh 0; }
.auth-pitch h1 { margin: 0 0 20px; font: 600 clamp(34px, 4.5vw, 58px)/1.08 'Manrope', sans-serif; letter-spacing: -.055em; }
.auth-pitch p { max-width: 370px; color: #c3c3c3; line-height: 1.75; font-size: 15px; }
.auth-aside-foot { color: #999; font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(100%, 420px); }
.auth-card h2 { margin: 0 0 9px; font: 700 27px/1.2 'Manrope', sans-serif; letter-spacing: -.04em; }
.auth-lead { color: var(--muted); margin: 0 0 28px; line-height: 1.55; font-size: 14px; }
.auth-foot { margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }
.text-button { border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; padding: 0; }
.setup-box { background: var(--surface-2); border: 1px solid var(--line); padding: 16px; border-radius: 10px; font-size: 13px; line-height: 1.55; margin: 18px 0; }
.setup-box code { overflow-wrap: anywhere; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); height: 100vh; position: sticky; top: 0; padding: 22px 14px 14px; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { padding: 0 11px 24px; }
.sidebar .brand-mark { border-color: var(--line-strong); background: #111; color: #fff; width: 32px; height: 32px; }
.workspace-select { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 21px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; text-align: left; }
.workspace-monogram { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: #171717; color: white; font: 700 13px 'Manrope', sans-serif; }
.workspace-copy { min-width: 0; flex: 1; }
.workspace-copy strong, .workspace-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy strong { font-size: 12px; }
.workspace-copy small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.nav-label { padding: 0 11px; margin: 0 0 8px; color: #939393; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.nav-list { display: grid; gap: 4px; }
.nav-item { border: 0; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 8px; background: transparent; color: #616161; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; }
.nav-item:hover { background: #f0f0ef; color: #222; }
.nav-item.active { color: white; background: #181818; }
.nav-item .nav-count { margin-left: auto; min-width: 22px; padding: 3px 5px; border-radius: 5px; color: #777; text-align: center; font-size: 10px; background: rgba(0,0,0,.045); }
.nav-item.active .nav-count { color: white; background: rgba(255,255,255,.16); }
.sidebar-bottom { margin-top: auto; }
.side-divider { height: 1px; background: var(--line); margin: 14px 4px; }
.user-button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; padding: 10px 8px; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.user-button:hover { background: var(--surface-3); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #e7e7e5; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta strong { font-size: 12px; }
.user-meta small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.mobile-bar { display: none; }
.mobile-topbar { display: none; }
.main { min-width: 0; padding: 34px clamp(20px, 4vw, 54px) 60px; }
.main-inner { max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.page-title { margin: 0; font: 700 clamp(26px, 3vw, 34px)/1.12 'Manrope', sans-serif; letter-spacing: -.05em; }
.page-subtitle { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.head-actions { display: flex; align-items: center; gap: 9px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; padding: 9px 13px; min-height: 38px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s, border .15s, transform .15s; }
.btn:hover { background: var(--surface-2); border-color: #a9a9a9; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: white; background: #171717; border-color: #171717; }
.btn-primary:hover { background: #333; border-color: #333; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); }
.btn-small { min-height: 31px; padding: 6px 9px; font-size: 11px; }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: min(100%, 235px); max-width: 360px; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #888; width: 16px; height: 16px; }
.search-input, .filter-select { width: 100%; border: 1px solid var(--line); background: white; border-radius: 8px; min-height: 38px; padding: 9px 11px; font-size: 12px; color: var(--ink); }
.search-input { padding-left: 35px; }
.filter-select { width: auto; min-width: 125px; color: #4e4e4e; }
.toolbar-spacer { flex: 1; }
.result-note { color: var(--muted); font-size: 11px; }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 19px; }
.metric-card { min-height: 126px; border: 1px solid var(--line); border-radius: 11px; padding: 17px 18px; background: white; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #666; font-size: 11px; font-weight: 600; }
.metric-icon { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: #333; }
.metric-icon .icon { width: 15px; height: 15px; }
.metric-value { margin-top: 18px; font: 700 26px/1 'Manrope', sans-serif; letter-spacing: -.045em; }
.metric-foot { margin-top: 7px; font-size: 10px; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 17px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: white; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 0; font: 700 14px 'Manrope', sans-serif; letter-spacing: -.025em; }
.panel-caption { color: var(--muted); font-size: 11px; margin-top: 5px; }
.panel-content { padding: 14px 18px; }
.plain-link { border: 0; background: none; padding: 4px; font-size: 11px; font-weight: 700; cursor: pointer; }
.plain-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.stage-overview { display: grid; gap: 14px; }
.stage-row { display: grid; grid-template-columns: 95px 1fr 72px; align-items: center; gap: 10px; font-size: 11px; }
.stage-label { color: #666; }
.stage-bar { background: #efefee; height: 6px; border-radius: 5px; overflow: hidden; }
.stage-fill { background: #202020; height: 100%; border-radius: inherit; }
.stage-total { text-align: right; font-weight: 700; }
.task-preview { display: grid; }
.task-preview-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f0ef; }
.task-preview-row:last-child { border-bottom: 0; }
.task-check { width: 16px; height: 16px; accent-color: #171717; cursor: pointer; margin-top: 1px; }
.task-preview-copy { min-width: 0; flex: 1; }
.task-preview-copy strong { display: block; font-size: 11px; line-height: 1.45; font-weight: 600; }
.task-preview-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.due-flag { color: var(--danger) !important; }
.recent-list { display: grid; }
.recent-row { display: flex; gap: 11px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #f0f0ef; }
.recent-row:last-child { border: 0; }
.recent-marker { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; background: #f0f0ef; border-radius: 50%; }
.recent-marker .icon { width: 14px; height: 14px; }
.recent-copy { min-width: 0; }
.recent-copy strong { display: block; font-size: 11px; font-weight: 600; line-height: 1.45; }
.recent-copy small { color: var(--muted); display: block; font-size: 10px; margin-top: 4px; }
.dashboard-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 17px; }

/* Lists and pipeline */
.data-table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: white; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { background: #fafafa; color: #838383; text-align: left; font-size: 10px; letter-spacing: .055em; text-transform: uppercase; padding: 12px 15px; font-weight: 700; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px 15px; border-bottom: 1px solid #f0f0ef; font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfb; }
.row-click { cursor: pointer; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.person-avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: #efefed; font-size: 10px; font-weight: 700; flex: 0 0 auto; }
.person-main { min-width: 0; }
.person-main strong, .person-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.person-main strong { font-size: 12px; font-weight: 700; }
.person-main small { font-size: 10px; color: var(--muted); margin-top: 4px; }
.muted-cell { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; background: #f1f1ef; color: #555; border-radius: 20px; padding: 5px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pill-dot { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.pill.status-customer, .pill.status-won, .pill.task-done { color: var(--success); background: #eff5f1; }
.pill.status-lead, .pill.status-proposal { color: var(--warning); background: #f8f3e9; }
.pill.status-inactive, .pill.status-lost { color: #777; background: #f1f1f1; }
.table-actions { display: flex; gap: 3px; justify-content: flex-end; }
.icon-button { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #777; cursor: pointer; }
.icon-button:hover { color: #111; background: #f0f0ef; }
.icon-button .icon { width: 15px; height: 15px; }
.empty-state { text-align: center; padding: 54px 20px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #fcfcfb; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.empty-icon .icon { width: 20px; height: 20px; }
.empty-state h3 { font: 700 15px 'Manrope', sans-serif; margin: 0 0 6px; }
.empty-state p { max-width: 345px; margin: 0 auto 17px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.deal-board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); align-items: start; gap: 12px; overflow-x: auto; padding: 0 0 15px; }
.deal-column { background: #f7f7f6; border: 1px solid var(--line); border-radius: 10px; min-height: 200px; overflow: hidden; }
.deal-column-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.deal-column-head strong { font-size: 11px; }
.deal-column-head span { color: var(--muted); font-size: 10px; }
.deal-column-body { display: grid; gap: 8px; padding: 9px; }
.deal-card { padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: white; cursor: pointer; }
.deal-card:hover { border-color: #aaa; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.deal-card strong { display: block; font-size: 11px; line-height: 1.4; }
.deal-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; }
.deal-card-foot { display: flex; justify-content: space-between; margin-top: 12px; align-items: center; }
.deal-value { font-size: 11px; font-weight: 700; }
.deal-owner { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #eee; font-size: 8px; font-weight: 700; }
.deal-stage-quick { width: 100%; margin-top: 9px; border: 0; border-top: 1px solid #efefee; padding: 7px 0 0; background: white; font-size: 10px; color: #777; cursor: pointer; }
.pill.priority-high { color: var(--danger); background: #f8eeee; }
.pill.priority-low { color: #777; background: #f1f1f1; }
.deal-empty { border: 1px dashed #dededc; border-radius: 7px; color: #999; font-size: 10px; text-align: center; padding: 18px 5px; }
.task-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.task-row { display: flex; align-items: center; gap: 13px; padding: 14px 17px; background: white; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row-copy { flex: 1; min-width: 0; }
.task-row-copy strong { display: block; font-size: 12px; font-weight: 600; }
.task-row-copy small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.task-row.completed .task-row-copy strong { text-decoration: line-through; color: #888; }
.task-row-actions { display: flex; align-items: center; gap: 7px; }

/* Dialogs, drawers, form controls */
.dialog-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.38); backdrop-filter: blur(3px); }
.dialog { width: min(100%, 530px); max-height: min(92vh, 790px); overflow: auto; background: white; border-radius: 13px; box-shadow: var(--shadow); animation: pop-in .16s ease-out; }
@keyframes pop-in { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 21px 23px 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font: 700 18px 'Manrope', sans-serif; letter-spacing: -.035em; }
.dialog-header p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.dialog-body { padding: 20px 23px; }
.dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 23px 18px; border-top: 1px solid var(--line); }
.dialog-footer-left { display: flex; align-items: center; gap: 8px; }
.dialog-footer-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: #4d4d4d; font-size: 11px; font-weight: 700; }
.field label .optional { color: #999; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 10px; background: white; color: #222; font-size: 12px; }
.field textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.form-hint { color: var(--muted); font-size: 10px; margin-top: 1px; }
.error-message { color: var(--danger); font-size: 11px; min-height: 15px; margin-top: 7px; }
.drawer-backdrop { display: block; padding: 0; background: rgba(0,0,0,.27); }
.drawer { height: 100%; width: min(100%, 510px); margin-left: auto; overflow-y: auto; background: white; box-shadow: var(--shadow); animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(15px); opacity: .75; } to { transform: none; opacity: 1; } }
.drawer-top { display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding: 15px 19px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.drawer-profile { padding: 24px 25px 21px; border-bottom: 1px solid var(--line); }
.drawer-profile-head { display: flex; align-items: center; gap: 13px; }
.drawer-profile .person-avatar { width: 52px; height: 52px; font-size: 16px; }
.drawer-profile h2 { font: 700 20px 'Manrope', sans-serif; letter-spacing: -.04em; margin: 0; }
.drawer-profile p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.drawer-chip-row { margin-top: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.drawer-section { padding: 19px 25px; border-bottom: 1px solid var(--line); }
.drawer-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.drawer-section-head h3 { margin: 0; font: 700 12px 'Manrope', sans-serif; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 20px; }
.detail-item small { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.detail-item div { font-size: 12px; overflow-wrap: anywhere; }
.activity-entry { position: relative; padding: 0 0 17px 20px; border-left: 1px solid var(--line-strong); margin-left: 5px; }
.activity-entry:last-child { border-left-color: transparent; padding-bottom: 0; }
.activity-entry::before { content: ''; position: absolute; left: -5px; top: 2px; width: 9px; height: 9px; background: white; border: 2px solid #333; border-radius: 50%; }
.activity-entry strong { display: block; font-size: 11px; }
.activity-entry p { white-space: pre-wrap; margin: 5px 0 0; color: #5c5c5c; font-size: 11px; line-height: 1.55; }
.activity-entry small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.linked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f0ef; }
.linked-row:first-of-type { border-top: 0; }
.linked-row strong { font-size: 11px; display: block; }
.linked-row small { color: var(--muted); font-size: 10px; display: block; margin-top: 4px; }
.toast-region { position: fixed; z-index: 100; bottom: 20px; right: 20px; display: grid; gap: 8px; }
.toast { background: #171717; color: white; padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: min(380px, calc(100vw - 40px)); font-size: 12px; animation: pop-in .15s ease-out; }
.toast.error { background: #873e3e; }
.members-list { display: grid; gap: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #f0f0ef; }
.member-row:first-child { border-top: 0; }
.member-row .person-main { flex: 1; }
.invite-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; overflow-wrap: anywhere; font-size: 11px; }
.invite-box a { display: block; margin: 6px 0; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { min-height: auto; padding: 22px 24px; }
  .auth-pitch { margin: 46px 0 35px; }
  .auth-pitch h1 { font-size: 38px; }
  .auth-aside-foot { display: none; }
  .auth-main { padding: 36px 24px 54px; }
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar { display: none; }
  .mobile-topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
  .mobile-topbar .brand { font-size: 13px; gap: 7px; }
  .mobile-topbar .brand-mark { width: 28px; height: 28px; border-color: #222; background: #111; color: white; border-radius: 8px; }
  .mobile-workspace { position: relative; width: auto; min-width: 0; flex: 1; margin: 0; border: 0; padding: 5px 7px; background: transparent; }
  .mobile-workspace .workspace-monogram { display: none; }
  .mobile-workspace .workspace-copy strong { max-width: 125px; font-size: 11px; }
  .mobile-workspace .workspace-copy small { display: none; }
  .mobile-workspace > .icon { width: 14px; }
  .mobile-bar { display: flex; position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; height: 64px; padding: 5px 8px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); justify-content: space-around; }
  .mobile-bar .nav-item { min-width: 62px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 5px 7px; color: #777; font-size: 9px; }
  .mobile-bar .nav-item .icon { width: 17px; height: 17px; }
  .mobile-bar .nav-item.active { color: #111; background: transparent; }
  .mobile-bar .nav-count { display: none; }
  .main { padding: 23px 17px 36px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 21px; }
  .page-head .head-actions { width: 100%; }
  .page-head .head-actions .btn-primary { margin-left: auto; }
  .dashboard-lower { grid-template-columns: 1fr; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 108px; padding: 13px; }
  .metric-value { font-size: 23px; margin-top: 14px; }
  .metric-foot { font-size: 9px; }
  .metric-top { font-size: 10px; }
  .metric-icon { width: 25px; height: 25px; }
  .toolbar { gap: 7px; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .toolbar-spacer { display: none; }
  .toolbar .filter-select { flex: 1; }
  .result-note { margin-left: auto; }
}
@media (max-width: 440px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .dialog-backdrop { padding: 0; align-items: end; }
  .dialog { width: 100%; max-height: 94vh; border-radius: 14px 14px 0 0; }
  .dialog-header, .dialog-body, .dialog-footer { padding-left: 17px; padding-right: 17px; }
  .dialog-footer { flex-wrap: wrap; }
  .drawer { width: 100%; }
  .stage-row { grid-template-columns: 85px 1fr 60px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
