:root {
  color-scheme: light;
  --ink: #17202d;
  --muted: #7a8492;
  --line: #e5e8ed;
  --surface: #ffffff;
  --canvas: #f5f6f8;
  --navy: #16459e;
  --navy-dark: #0f3378;
  --red: #e30613;
  --red-soft: #fff0f1;
  --green: #16845d;
  --green-soft: #eaf7f1;
  --amber: #ae6a09;
  --amber-soft: #fff4df;
  --shadow: 0 16px 50px rgba(21, 31, 48, .10);
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
html { min-width: 320px; scroll-behavior: smooth; }
body { background: var(--canvas); color: var(--ink); font-size: 14px; overflow-x: hidden; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(22,69,158,.25); outline-offset: 2px; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 560px); background: #fff; }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 6vw, 84px); background: #f2f4f7; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; width: 560px; height: 560px; border: 1px solid rgba(22,69,158,.10); border-radius: 50%; position: absolute; right: -220px; bottom: -280px; box-shadow: 0 0 0 60px rgba(22,69,158,.025), 0 0 0 120px rgba(22,69,158,.02); }
.auth-brand img { width: 184px; height: 172px; object-fit: contain; object-position: center; position: relative; z-index: 1; }
.auth-brand-copy { max-width: 440px; position: relative; z-index: 1; }
.auth-brand-copy h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.13; letter-spacing: -.045em; margin: 0 0 16px; font-weight: 700; }
.auth-brand-copy p { color: #687384; font-size: 16px; line-height: 1.75; margin: 0; max-width: 380px; }
.auth-version { color: #a3aab4; font-size: 11px; position: relative; z-index: 1; }
.auth-panel { display: grid; place-items: center; padding: 36px; }
.auth-card { width: min(100%, 370px); }
.auth-card .mobile-logo { display: none; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.auth-card h2 { margin: 9px 0 7px; font-size: 26px; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.65; }
.field { display: grid; gap: 7px; margin-bottom: 16px; min-width: 0; }
.field label, .field-label { font-size: 12px; font-weight: 700; color: #465263; }
.field input, .field select, .field textarea, .inline-input { width: 100%; min-width: 0; border: 1px solid #dfe3e9; background: #fff; color: var(--ink); border-radius: 10px; padding: 11px 13px; outline: 0; transition: border .16s, box-shadow .16s; }
.field textarea { resize: vertical; min-height: 86px; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus { border-color: #7191cc; box-shadow: 0 0 0 3px rgba(22,69,158,.10); }
.field input::placeholder, .field textarea::placeholder { color: #a2aab5; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; margin: 5px 0 22px; }
.text-button { border: 0; background: transparent; color: var(--navy); padding: 5px 0; font-size: 12px; font-weight: 700; text-decoration: none; }
.text-button:hover { color: var(--navy-dark); text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; padding: 10px 15px; min-height: 40px; transition: background .15s, border-color .15s, transform .15s; text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--navy-dark); }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--red); }
.button-primary:hover { background: #c9000b; }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button-secondary:hover { background: #f7f8fa; border-color: #cbd1da; }
.button-danger { background: #fff; color: #c51c2a; border-color: #f0c3c7; }
.button-danger:hover { background: var(--red-soft); }
.button-quiet { color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--ink); background: #f0f2f5; }
.button-small { min-height: 32px; border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.button-wide { width: 100%; }
.button svg, .icon-button svg { width: 17px; height: 17px; }
.form-error { min-height: 20px; color: #c51c2a; font-size: 12px; margin: 0 0 7px; }
.auth-note { margin-top: 18px !important; font-size: 11px; text-align: center; color: #9aa2ae !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0,1fr); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 22px 14px 16px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; }
.sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 4px 11px 23px; border-bottom: 1px solid #eff1f4; }
.sidebar-logo img { width: 42px; height: 42px; object-fit: contain; }
.sidebar-logo span { font-size: 18px; font-weight: 800; letter-spacing: .08em; color: var(--navy); }
.nav-caption { color: #9aa2ae; font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 21px 12px 9px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; color: #647080; border: 0; background: transparent; padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; color: #8993a1; }
.nav-item:hover { color: var(--ink); background: #f6f7f9; }
.nav-item.active { color: var(--navy); background: #edf2fb; }
.nav-item.active svg { color: var(--navy); }
.nav-item.admin-item.active { color: #b91824; background: #fff0f1; }
.logout-item { margin-top: 8px; }
.sidebar-spacer { flex: 1; }
.profile-entry { border-top: 1px solid #eff1f4; padding: 14px 2px 0; display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #e9edf4; color: var(--navy); display: grid; place-items: center; font-size: 12px; font-weight: 800; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-entry .person { min-width: 0; }
.profile-entry strong { display: block; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-entry small { color: var(--muted); font-size: 10px; display: block; margin-top: 3px; }
.icon-button { border: 0; background: transparent; color: #7c8795; border-radius: 8px; display: inline-grid; place-items: center; width: 34px; height: 34px; }
.icon-button:hover { background: #f0f2f5; color: var(--ink); }
.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 70px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.82); border-bottom: 1px solid var(--line); gap: 16px; position: sticky; top: 0; z-index: 4; backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
.topbar-copy { min-width: 0; max-width: 100%; }
.breadcrumb { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #9aa2ae; font-size: 11px; }
.topbar-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 800; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.user-filter select { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 28px 8px 10px; max-width: 230px; color: var(--ink); }
.mobile-menu-button { display: none; }
.page-wrap { padding: 30px 34px 48px; width: 100%; max-width: 1480px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.page-heading h1 { font-size: 26px; letter-spacing: -.05em; line-height: 1.2; margin: 0; }
.page-heading p { color: var(--muted); margin: 7px 0 0; font-size: 12px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 2px 6px rgba(22,32,45,.025); }
.client-tools { display: grid; gap: 15px; margin-bottom: 17px; }
.search-row { display: flex; gap: 9px; align-items: center; }
.search-field { flex: 1; position: relative; min-width: 120px; }
.search-field svg { position: absolute; width: 17px; height: 17px; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa2ae; }
.search-field input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 13px 0 38px; outline: 0; }
.search-field input:focus { border-color: #7191cc; box-shadow: 0 0 0 3px rgba(22,69,158,.08); }
.client-list-controls { display: grid; grid-template-columns: minmax(130px,.85fr) minmax(190px,1.15fr); gap: 8px; flex: 0 0 auto; }
.client-list-controls select { min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--ink); font-size: 11px; }
.check-panel { padding: 15px 16px; display: grid; grid-template-columns: minmax(180px,1fr) minmax(200px, 2fr); gap: 14px; align-items: center; }
.check-title strong { display: block; font-size: 12px; }
.check-title span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.check-controls { display: grid; grid-template-columns: minmax(0,1fr) 130px; gap: 8px; }
.check-controls input, .check-controls select { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; outline: 0; }
.check-results { grid-column: 1 / -1; margin-top: -2px; display: grid; gap: 7px; }
.check-result { padding: 9px 11px; border-radius: 8px; background: #f7f8fa; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.check-result strong { color: var(--ink); }
.check-result span { color: var(--muted); text-align: right; }
.check-result.free { color: var(--green); background: var(--green-soft); font-weight: 700; }
.check-result.busy { color: #ac2430; background: var(--red-soft); }
.client-list { display: grid; gap: 10px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: stretch; }
.client-card { min-width: 0; min-height: 340px; padding: 22px; display: flex; flex-direction: column; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.client-card:hover { border-color: #c4d0e3; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22,32,45,.08); }
.client-card:focus-visible { outline: 3px solid rgba(22,69,158,.24); outline-offset: 2px; }
.client-card-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.client-card .client-mark { width: 50px; height: 50px; border-radius: 14px; font-size: 16px; }
.client-card-arrow { color: #98a3b2; display: inline-grid; place-items: center; margin-left: auto; flex: 0 0 auto; }
.client-card-main { min-width: 0; flex: 1 1 auto; }
.client-card-main strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
.client-card-main small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); margin-top: 5px; font-size: 12px; }
.client-card-details { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #eff1f4; min-width: 0; }
.client-card-detail { display: grid; grid-template-columns: 88px minmax(0,1fr); align-items: start; gap: 10px; min-width: 0; font-size: 14px; line-height: 1.45; }
.client-card-detail + .client-card-detail { border-top: 1px solid #f1f3f6; padding-top: 8px; }
.client-card-detail small, .client-card-activity-head small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.client-card-detail span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; min-width: 0; }
.client-card-activity { margin-top: 17px; min-width: 0; }
.client-card-activity-head { display: flex; align-items: center; gap: 6px; }
.client-card-activity-head strong { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; color: var(--navy); background: #edf2fb; font-size: 11px; }
.client-card-task-list { display: grid; gap: 7px; margin-top: 9px; }
.client-card-task { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; font-size: 13px; line-height: 1.45; }
.client-card-task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.client-card-task time { color: var(--muted); white-space: nowrap; flex: 0 0 auto; font-size: 11px; }
.client-card-more, .client-card-no-tasks { display: block; color: var(--muted); margin-top: 7px; font-size: 11px; }
.client-card-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: auto; padding-top: 18px; }
.client-card-metrics > div { min-width: 0; padding: 12px 14px; border: 1px solid #edf0f4; border-radius: 11px; background: #f8f9fc; }
.client-card-metrics small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.client-card-metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.client-card-footer { display: flex; justify-content: space-between; gap: 10px; min-width: 0; border-top: 1px solid #eff1f4; margin-top: 15px; padding-top: 12px; color: var(--muted); font-size: 12px; }
.client-card-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-registry-card { min-height: 300px; }
.deal-registry-card .deal-registry-status { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto; }
.deal-registry-details { gap: 8px; }
.deal-registry-details .deal-transport-detail span { font-weight: 600; color: var(--navy); }
.deal-registry-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; margin-top: 14px; padding: 10px 0 0; border-top: 1px solid #f1f3f6; color: var(--muted); font-size: 12px; }
.deal-registry-summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-registry-count { padding: 10px 2px 0; }
.deal-create-related { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.deal-live-finance { margin-top: 17px; padding: 14px; border: 1px solid #dce6f6; border-radius: 12px; background: #f7f9fd; }
.deal-live-finance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.deal-live-finance-grid > div { min-width: 0; display: grid; align-content: start; gap: 6px; padding: 10px; border: 1px solid rgba(220,230,246,.85); border-radius: 9px; background: #fff; }
.deal-live-finance-grid span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.deal-live-finance-grid strong { overflow-wrap: anywhere; font-size: 14px; font-variant-numeric: tabular-nums; }
.deal-live-finance-hint { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.deal-create-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.deal-create-section-title strong, .deal-create-section-title small { display: block; }
.deal-create-section-title strong { font-size: 14px; }
.deal-create-section-title small { color: var(--muted); margin-top: 4px; font-size: 12px; line-height: 1.5; }
.deal-client-field { position: relative; }
.deal-client-results { position: absolute; z-index: 30; inset: calc(100% - 1px) 0 auto; display: grid; gap: 5px; max-height: min(280px, 36vh); margin-top: 7px; padding: 7px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 16px 36px rgba(20,32,52,.14); }
.deal-client-option { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; text-align: left; }
.deal-client-option:hover { border-color: #b9c9e2; background: #f8faff; }
.deal-client-option strong { font-size: 13px; line-height: 1.4; }
.deal-client-option span, .deal-client-empty { color: var(--muted); font-size: 11px; line-height: 1.5; }
.deal-client-empty { padding: 9px 11px; border: 1px dashed var(--line); border-radius: 9px; }
.deal-client-selected { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 11px 12px; border: 1px solid #dce6f6; border-radius: 10px; background: #f7f9fd; }
.deal-client-selected strong, .deal-client-selected small { display: block; }
.deal-client-selected strong { font-size: 13px; }
.deal-client-selected small { color: var(--muted); margin-top: 3px; font-size: 11px; line-height: 1.45; }
.deal-upload-toggle { display: flex; align-items: flex-start; gap: 10px; margin: 11px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.deal-upload-toggle input { margin: 3px 0 0; accent-color: var(--navy); }
.deal-upload-toggle strong, .deal-upload-toggle small { display: block; }
.deal-upload-toggle strong { font-size: 13px; }
.deal-upload-toggle small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.deal-create-dialog { max-height: min(88vh, 860px); overflow: auto; overscroll-behavior: contain; }
.deal-create-dialog form { padding-bottom: 1px; }
.deal-create-dialog .dialog-actions { position: sticky; z-index: 5; bottom: 0; padding: 12px 0 3px; background: linear-gradient(180deg, rgba(255,255,255,.92), #fff 35%); box-shadow: 0 -10px 16px rgba(255,255,255,.84); }
.app-dialog.deal-create-modal { overflow: hidden; }
.app-dialog.deal-create-modal > .deal-create-dialog { max-height: min(88dvh, 860px); overflow-y: auto; overscroll-behavior: contain; }
.expense-empty { padding: 12px 13px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); background: #fafbfd; font-size: 13px; line-height: 1.5; }
.invoice-lock-tag { align-self: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.client-empty { grid-column: 1 / -1; }
.client-row { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(100px,.7fr) minmax(100px,.7fr) minmax(90px,.55fr) 38px; align-items: center; gap: 16px; padding: 17px 18px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.client-row:hover { border-color: #c4d0e3; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(22,32,45,.06); }
.admin-user-row { grid-template-columns: minmax(0,1.4fr) minmax(100px,.7fr) minmax(100px,.8fr) minmax(80px,.55fr) auto; }
.admin-user-row .page-actions { flex-wrap: wrap; justify-content: flex-end; }
.admin-user-inactive { opacity: .68; }
.admin-user-inactive .client-name strong::after { content: " · отключён"; color: var(--muted); font-size: 11px; font-weight: 500; }
.client-contact-editor { grid-column: 1 / -1; }
.client-contact-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.client-contact-editor-heading > label { color: var(--ink); font-size: 12px; font-weight: 600; }
.client-contact-edit-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) 32px; gap: 7px; margin-top: 7px; }
.client-contact-edit-row input { min-width: 0; }
.admin-section-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; align-items: stretch; }
.admin-section-card { appearance: none; display: flex; flex-direction: column; align-items: stretch; gap: 11px; min-width: 0; min-height: 164px; padding: 18px; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.admin-section-card:hover { border-color: #c4d0e3; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22,32,45,.08); }
.admin-section-card:focus-visible { outline: 3px solid rgba(22,69,158,.22); outline-offset: 2px; }
.admin-section-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-section-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #edf2fb; color: var(--navy); }
.admin-section-card > strong { font-size: 15px; line-height: 1.35; }
.admin-section-card > small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.admin-section-link { display: flex; align-items: center; gap: 6px; margin-top: auto; color: var(--navy); font-size: 11px; font-weight: 700; }
.admin-section-page { display: grid; gap: 14px; min-width: 0; }
.admin-section-page > .admin-queue-panel { width: 100%; }
.admin-users-list { gap: 10px; }
.admin-queues { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.admin-queue-panel { min-width: 0; padding: 16px; }
.admin-queue-panel > .panel-heading { padding: 0 0 12px; }
.admin-queue-list { display: grid; gap: 9px; }
.admin-audit-panel, .admin-backups-panel { grid-column: 1 / -1; }
.backup-list { display: grid; gap: 8px; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #edf0f3; border-radius: 9px; background: #fafbfc; }
.backup-row > div:first-child { display: grid; gap: 4px; min-width: 0; }
.backup-row strong { font-size: 12px; }
.backup-row small, .backup-restore-note { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.backup-row .button { text-decoration: none; }
.backup-restore-note { display: block; margin-top: 11px; line-height: 1.5; }
.salary-approval-row, .deletion-request-row { display: grid; gap: 8px; padding: 12px; border: 1px solid #edf0f3; border-radius: 10px; background: #fafbfc; min-width: 0; }
.salary-payout-summary { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.salary-payout-summary > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.salary-payout-summary strong { color: var(--ink); white-space: nowrap; }
.salary-payout-summary .salary-payout-total { padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 650; }
.salary-payout-summary .salary-payout-total strong { color: var(--green, #16845d); font-size: 16px; }
.salary-approval-main { display: grid; gap: 3px; min-width: 0; }
.salary-approval-main strong { font-size: 13px; overflow-wrap: anywhere; }
.salary-approval-main span, .salary-approval-meta, .deletion-request-row p { color: var(--muted); font-size: 11px; line-height: 1.45; }
.salary-approval-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.salary-approval-formula { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.salary-approval-formula strong { white-space: nowrap; }
.salary-approval-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.deletion-request-row .page-actions { justify-content: flex-start; flex-wrap: wrap; }
.deletion-request-row p { margin: 0; overflow-wrap: anywhere; }
.client-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client-mark { width: 38px; height: 38px; border-radius: 11px; background: #edf2fb; color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.client-name strong { display: block; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.client-name small, .client-meta small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.client-meta span { font-size: 12px; font-weight: 700; }
.client-meta label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.amount-positive { color: var(--green) !important; }
.amount-debt { color: #b36c0c !important; }
.row-arrow { color: #a6aeb8; }
.empty-state { border: 1px dashed #dbe0e7; border-radius: 12px; padding: 42px 22px; color: var(--muted); text-align: center; background: rgba(255,255,255,.5); }
.empty-state strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 12px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card { padding: 18px; min-height: 112px; }
.metric-card .metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card .metric-label svg { width: 16px; height: 16px; color: #8390a0; }
.metric-card strong { font-size: 23px; letter-spacing: -.04em; display: block; margin-top: 18px; }
.metric-card small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
.analytics-note { padding: 15px 17px; color: #727e8c; font-size: 11px; line-height: 1.7; }
.analytics-note strong { color: var(--ink); }
.text-danger { color: #b32632 !important; }
.dashboard-metrics-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
.dashboard-metric { min-height: 132px; }
.dashboard-metric strong { font-size: clamp(19px, 1.7vw, 25px); }
.dashboard-metric-link { width: 100%; border: 1px solid var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; appearance: none; }
.dashboard-metric-link:hover { border-color: #c8d4e4; box-shadow: 0 5px 14px rgba(22,32,45,.07); }
.dashboard-metric-hint { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--navy); font-size: 9px; font-weight: 700; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(270px,.85fr); gap: 15px; align-items: start; }
.dashboard-work-panel, .dashboard-tips, .dashboard-team-panel, .analytics-team-panel { min-width: 0; overflow: hidden; }
.panel-heading { padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.dashboard-work-list { display: grid; padding: 0 12px 12px; }
.dashboard-work-row { min-width: 0; width: 100%; display: grid; grid-template-columns: 52px minmax(0,1fr) 24px; align-items: center; gap: 10px; padding: 11px 7px; border: 0; border-top: 1px solid #f0f2f5; background: #fff; text-align: left; color: var(--ink); }
.dashboard-work-row:hover { background: #fafbfc; }
.dashboard-work-row.overdue .dashboard-work-date { color: #a8212d; background: #fff0f1; }
.dashboard-work-date { justify-self: start; border-radius: 7px; background: #f1f4f8; color: #58677a; padding: 6px 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.dashboard-work-copy { min-width: 0; }
.dashboard-work-copy strong, .dashboard-work-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-work-copy strong { font-size: 11px; }
.dashboard-work-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.dashboard-work-arrow { color: #a6aeb8; display: grid; place-items: center; }
.dashboard-empty { padding: 16px 18px 21px; border-top: 1px solid #f0f2f5; color: var(--muted); font-size: 11px; line-height: 1.6; }
.dashboard-shortcuts { display: grid; padding: 0 12px 12px; }
.dashboard-shortcuts > button { display: grid; grid-template-columns: 26px minmax(0,1fr) 20px; align-items: center; gap: 10px; padding: 12px 7px; text-align: left; border: 0; border-top: 1px solid #f0f2f5; background: #fff; color: var(--navy); }
.dashboard-shortcuts > button:hover { background: #fafbfc; }
.dashboard-shortcuts > button > svg:last-child { color: #a6aeb8; }
.dashboard-shortcuts > button strong, .dashboard-shortcuts > button small { display: block; }
.dashboard-shortcuts > button strong { color: var(--ink); font-size: 11px; }
.dashboard-shortcuts > button small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.dashboard-team-panel, .analytics-team-panel { margin-top: 15px; }
.team-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; background: #f1f4f8; color: #667487; font-size: 9px; }
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: nowrap; }
.data-table th { padding: 10px 13px; background: #fafbfc; color: var(--muted); text-align: right; font-size: 9px; font-weight: 700; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td { padding: 9px 13px; border-top: 1px solid #f0f2f5; text-align: right; }
.data-table tr:hover td { background: #fcfcfd; }
.team-person { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.team-person:hover strong { color: var(--navy); text-decoration: underline; }
.team-person .client-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 10px; }
.team-person strong, .team-person small { display: block; }
.team-person strong { font-size: 10px; }
.team-person small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.table-empty { text-align: center !important; padding: 18px !important; color: var(--muted); }
.analytics-toolbar { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.period-switch { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 10px; background: #f2f4f7; }
.period-button { min-height: 32px; padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; color: #687384; font-size: 10px; font-weight: 700; }
.period-button:hover { color: var(--ink); }
.period-button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(22,32,45,.12); }
.anchor-controls, .custom-range-controls { display: flex; align-items: center; gap: 7px; }
.anchor-controls label { color: var(--muted); font-size: 9px; }
.anchor-controls input, .custom-range-controls input { min-width: 132px; height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 10px; }
.custom-range-controls label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.analytics-range-caption { padding: 14px 1px 10px; color: var(--muted); font-size: 10px; }
.analytics-metrics-grid { margin-bottom: 14px; }
.analytics-metric { min-height: 128px; }
.analytics-metric strong { font-size: clamp(17px,1.5vw,22px); }
.analytics-comparison { display: block; margin-top: 5px; color: var(--navy); font-size: 9px; line-height: 1.35; }
.analytics-charts { display: grid; gap: 14px; }
.chart-panel { min-width: 0; overflow: hidden; }
.chart-panel .panel-heading { padding-bottom: 9px; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 0 18px 7px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; color: #687384; font-size: 9px; }
.chart-legend-mark { display: block; flex: 0 0 8px; width: 8px; height: 8px; }
.chart-scroll { width: 100%; overflow-x: auto; padding: 0 12px 8px; overscroll-behavior-inline: contain; }
.analytics-chart { display: block; height: 290px; max-width: none; color: var(--muted); }
.chart-scroll-hint { display: none; margin: -1px 12px 10px; color: var(--muted); font-size: 10px; }
.chart-grid-line { stroke: #e9edf2; stroke-width: 1; }
.chart-zero-line { stroke: #aeb8c5; stroke-width: 1.3; }
.chart-axis-label { fill: #8792a0; font-family: inherit; font-size: 9px; }
.chart-empty { padding: 28px 18px 32px; border-top: 1px solid #f0f2f5; color: var(--muted); text-align: center; font-size: 11px; }

.calendar-panel { overflow: hidden; }
.calendar-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.calendar-month { display: flex; align-items: center; gap: 9px; }
.calendar-month strong { min-width: 130px; text-align: center; font-size: 14px; text-transform: capitalize; }
.calendar-nav { display: flex; align-items: center; gap: 7px; }
.week-grid, .days-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.week-grid { background: #fbfbfc; border-bottom: 1px solid var(--line); }
.week-grid span { padding: 11px 8px; text-align: center; color: var(--muted); font-size: 10px; font-weight: 700; }
.day-cell { min-height: 116px; border-right: 1px solid #edf0f3; border-bottom: 1px solid #edf0f3; padding: 8px; background: #fff; cursor: pointer; min-width: 0; }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell:hover { background: #fafbfc; }
.day-cell.outside { background: #fafbfc; color: #bbc1ca; }
.day-number { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: 11px; color: #6b7583; }
.day-cell.today .day-number { background: var(--navy); color: #fff; font-weight: 800; }
.day-events { display: grid; gap: 4px; margin-top: 5px; }
.event-chip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 5px; padding: 4px 6px; font-size: 9px; line-height: 1.2; background: #edf2fb; color: #244b8a; }
.event-chip.reminder { background: var(--amber-soft); color: #8b5a13; }
.event-chip.vacation { background: #f0eaff; color: #6544a0; }
.event-chip.birthday { background: var(--red-soft); color: #af2430; }
.event-chip.done { opacity: .58; text-decoration: line-through; }
.more-events { color: var(--muted); font-size: 9px; padding-left: 5px; }

.app-dialog { border: 1px solid var(--line); padding: 0; border-radius: 15px; width: min(790px, calc(100vw - 28px)); max-height: min(90vh, 960px); max-height: min(90dvh, 960px); box-shadow: var(--shadow); color: var(--ink); overflow: auto; overscroll-behavior: contain; }
.app-dialog::backdrop { background: rgba(16,24,38,.40); backdrop-filter: blur(2px); }
.dialog-inner { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.dialog-header h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.dialog-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.dialog-header-actions { display: flex; align-items: center; gap: 5px; }
.dialog-close { flex: 0 0 auto; }
.dialog-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.dialog-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 11px; }
.section-title h3 { margin: 0; font-size: 13px; }
.section-title span { color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 13px; }
.field-full { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 16px; }
.detail-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-bottom: 15px; }
.detail-sum-card { background: #f7f8fa; border-radius: 10px; padding: 11px 12px; }
.detail-sum-card span { color: var(--muted); font-size: 10px; display: block; }
.detail-sum-card strong { display: block; margin-top: 6px; font-size: 15px; }
.file-list, .payment-list, .reminder-list { display: grid; gap: 7px; }
.file-line, .payment-line, .reminder-line, .deal-card { background: #fafbfc; border: 1px solid #edf0f3; border-radius: 9px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.reminder-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 0 auto; }
.file-info, .line-info { min-width: 0; }
.file-info a, .file-name-preview, .line-info strong { font-weight: 700; font-size: 11px; text-decoration: none; }
.file-name-preview { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--navy); text-align: left; font-family: inherit; cursor: pointer; overflow-wrap: anywhere; }
.file-info a:hover, .file-name-preview:hover { text-decoration: underline; }
.file-info small, .line-info small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; overflow-wrap: anywhere; }
.file-actions, .line-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tag { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 8px; background: #edf2fb; color: #244b8a; font-size: 9px; font-weight: 800; white-space: nowrap; }
.tag.payment { background: var(--green-soft); color: var(--green); }
.tag.refund { background: var(--red-soft); color: #b22532; }
.tag.debt { background: var(--amber-soft); color: #88530d; }
.deal-card { display: block; padding: 13px; margin-bottom: 8px; scroll-margin-top: 20px; transition: border-color .18s, box-shadow .18s; }
.deal-card-focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,69,158,.12); }
.deal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.deal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.deal-title { font-size: 12px; font-weight: 800; }
.deal-invoice-label { margin-top: 4px; }
.deal-status-select { width: auto; padding: 6px 8px; font-size: 10px; }
.deal-invoice-picker { display: grid; justify-items: start; gap: 6px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.deal-invoice-picker .select-search-control { width: min(100%, 420px); }
.deal-invoice-picker select { width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; background: #fff; color: var(--ink); font-size: 12px; }
.deal-selected-invoices { display: grid; gap: 6px; width: min(100%, 420px); margin-top: 8px; }
.deal-selected-invoice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid #dfe7f2; border-radius: 8px; background: #fff; }
.deal-selected-invoice > span { min-width: 0; }
.deal-selected-invoice strong, .deal-selected-invoice small { display: block; overflow-wrap: anywhere; }
.deal-selected-invoice strong { color: var(--ink); font-size: 11px; }
.deal-selected-invoice small, .deal-invoice-empty { color: var(--muted); font-size: 10px; }
.payment-line-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 0 auto; }
.select-search-control { display: grid; gap: 6px; min-width: 0; }
.select-search-input { width: 100%; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.select-search-input::placeholder { color: #929ba7; }
.select-search-input:focus-visible,.select-search-control select:focus-visible { outline: 3px solid rgba(22,69,158,.16); border-color: #9cb1d4; }
.select-search-empty { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.select-search-status { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.deal-salary { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 11px; border: 1px solid #edf0f3; border-radius: 9px; background: #f6f8fb; }
.deal-salary.pending { border-color: #f2e2c3; background: #fffaf0; }
.deal-salary.approved { border-color: #d7ebe2; background: #f1faf6; }
.deal-salary.cancelled { border-color: #e5e8ed; background: #f6f7f9; }
.deal-salary > div { min-width: 0; }
.deal-salary > div strong, .deal-salary > div small { display: block; }
.deal-salary > div strong { font-size: 12px; }
.deal-salary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.deal-invoice-label a { color: var(--navy); }
.deal-salary > div small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.deal-salary.missing { align-items: flex-start; flex-direction: column; }
.deletion-request-button { white-space: nowrap; }
.deletion-pending { color: var(--amber); font-size: 10px; font-weight: 700; white-space: nowrap; }
.deletion-history { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); }
.deletion-history > strong { display: block; color: var(--ink); font-size: 12px; }
.deletion-history p { margin: 7px 0 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.file-type-group { margin: 11px 0 7px; }
.file-type-title { margin-bottom: 7px; }
.expense-heading { margin: 4px 0 8px; }
.deal-form-actions { border: 0; margin: 12px 0 0; padding: 0; }
.deal-costs { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.deal-costs li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; font-size: 12px; line-height: 1.45; color: #5d6876; }
.deal-costs a { color: var(--navy); }
.inline-file-preview { padding: 0; border: 0; background: transparent; color: var(--navy); font: inherit; text-align: left; text-decoration: underline; cursor: pointer; overflow-wrap: anywhere; }
.inline-file-download, .deal-summary-download { color: var(--navy); font-size: 12px; text-decoration: none; white-space: nowrap; }
.inline-file-download:hover, .deal-summary-download:hover { text-decoration: underline; }
.deal-transport-order, .deal-summary-cost-file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.deal-transport-order button { padding: 0; border: 0; background: transparent; color: var(--navy); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.expense-row { display: grid; grid-template-columns: 112px minmax(0,1.4fr) 100px 126px minmax(100px,1fr) 32px; gap: 6px; align-items: center; margin-bottom: 7px; }
.expense-row input:not(.visually-hidden-file), .expense-row select { width: 100%; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12px; background: #fff; }
.expense-document-control { grid-column: 5; gap: 4px; }
.expense-document-control .select-search-input { min-height: 32px; height: 32px; padding: 4px 8px; font-size: 12px; }
.expense-document-control .select-search-status { font-size: 11px; overflow-wrap: anywhere; }
.expense-file-upload { grid-column: 2 / 6; grid-row: 2; display: flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 9px; border: 1px dashed #cfd7e2; border-radius: 8px; background: #fafbfd; color: var(--navy); cursor: pointer; }
.expense-file-upload > span { display: inline-flex; color: var(--muted); }
.expense-file-upload strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.expense-file-upload small { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.expense-file-upload:hover { border-color: var(--blue); background: #f4f7fc; }
.expense-file-upload:focus-within { outline: 3px solid rgba(22,69,158,.16); outline-offset: 2px; }
.deal-finance-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.deal-finance-preview > span { display: grid; gap: 3px; min-width: 0; padding: 8px 10px; border: 1px solid #edf0f4; border-radius: 8px; background: #fafbfd; }
.deal-finance-preview small { color: var(--muted); font-size: 11px; }
.deal-finance-preview strong { font-size: 12px; }
.deal-edit-lock-hint { margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.subtle { color: var(--muted); font-size: 10px; }
.inline-form { padding: 12px; border-radius: 10px; background: #f7f8fa; }
.inline-form .field { margin-bottom: 10px; }
.inline-form .field:last-child { margin-bottom: 0; }
.event-list { display: grid; gap: 8px; }
.event-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid #edf0f3; border-radius: 9px; padding: 10px; }
.event-kind { width: 30px; height: 30px; border-radius: 8px; background: #edf2fb; color: var(--navy); display: grid; place-items: center; }
.event-kind.reminder { background: var(--amber-soft); color: var(--amber); }
.event-kind.vacation { background: #f0eaff; color: #6544a0; }
.event-kind.birthday { background: var(--red-soft); color: var(--red); }
.event-row.done .event-row-text { opacity: .58; text-decoration: line-through; }
.event-row-text strong { display: block; font-size: 11px; }
.event-row-text small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.event-row-actions { display: flex; gap: 3px; }
.calendar-events-more { display: flex; justify-content: center; padding-top: 12px; }
.profile-photo-row { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.profile-photo-row .avatar { width: 56px; height: 56px; font-size: 16px; }
.profile-photo-row small { display: block; color: var(--muted); margin-top: 4px; }
.client-detail-page { display: grid; gap: 14px; min-width: 0; }
.client-route-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; color: var(--muted); font-size: 10px; }
.client-route-toolbar > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; }
.back-link { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 6px 0; color: var(--navy); font-weight: 700; font-size: 11px; white-space: nowrap; }
.back-link svg { transform: rotate(180deg); }
.client-detail-head { padding: clamp(16px, 2.2vw, 26px); display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; }
.client-detail-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.client-mark-large { width: 58px; height: 58px; border-radius: 16px; font-size: 18px; }
.client-detail-title { min-width: 0; }
.client-detail-title h1 { margin: 4px 0 3px; font-size: clamp(19px, 2vw, 27px); line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
.client-detail-title p { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.client-detail-head .dialog-header-actions { flex: 0 0 auto; }
.client-contact-panel { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; overflow: hidden; }
.client-contact-people { grid-column: span 2; min-width: 0; padding: 14px 16px; border-right: 1px solid #eff1f4; }
.client-contact-people > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.client-contact-people-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 14px; }
.client-contact-person { min-width: 0; }
.client-contact-person > strong, .client-contact-person > small, .client-contact-person > span { display: block; overflow-wrap: anywhere; }
.client-contact-person > strong { font-size: 11px; }
.client-contact-person > small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.client-contact-person > span { margin-top: 3px; font-size: 10px; }
.client-contact-person a { color: var(--ink); text-decoration: none; }
.client-contact-person a:hover { color: var(--navy); text-decoration: underline; }
.client-contact-item { min-width: 0; padding: 14px 16px; border-right: 1px solid #eff1f4; }
.client-contact-item:last-child { border-right: 0; }
.client-contact-item > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.client-contact-item > a, .client-contact-item > strong { display: block; overflow-wrap: anywhere; font-size: 11px; font-weight: 600; text-decoration: none; }
.client-contact-notes { grid-column: 1 / -1; border-top: 1px solid #eff1f4; border-right: 0; }
.client-tabs { display: flex; gap: 4px; min-width: 0; padding: 5px; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.client-tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; flex: 1 0 auto; border: 0; border-radius: 8px; padding: 8px 11px; background: transparent; color: #637083; font-size: 10px; font-weight: 700; white-space: nowrap; }
.client-tab svg { color: #8290a0; }
.client-tab small { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border-radius: 99px; background: #f0f2f5; color: #697789; font-size: 9px; }
.client-tab.active { background: #edf2fb; color: var(--navy); }
.client-tab.active svg { color: var(--navy); }
.client-tab.active small { background: #fff; color: var(--navy); }
.client-section-panel { min-width: 0; overflow: hidden; }
.client-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.client-section-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.client-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.client-section-content { display: grid; gap: 10px; padding: 18px 20px 20px; min-width: 0; }
.client-section-search { width: 100%; min-width: 0; }
.client-section-search-empty { padding: 24px 16px; }
.client-section-content > .file-list { gap: 8px; }
.client-section-files { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 4px; }
.section-empty { padding: 30px 16px; }
.file-picker { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px dashed #ccd4df; border-radius: 10px; background: #fafbfc; cursor: pointer; }
.file-picker:hover { border-color: #8ca5cf; background: #f7f9fd; }
.file-picker-icon { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; color: var(--navy); background: #edf2fb; }
.file-picker > span:nth-child(2) { flex: 1; min-width: 0; }
.file-picker strong, .file-picker small { display: block; overflow-wrap: anywhere; }
.file-picker strong { font-size: 11px; }
.file-picker small { color: var(--muted); margin-top: 4px; font-size: 9px; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); border: 0; }
.visually-hidden-file:focus-visible + * { outline: 3px solid rgba(22,69,158,.25); }
.toast-region { position: fixed; right: 20px; bottom: 18px; z-index: 20; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { background: #17202d; color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { background: #a91f2b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.mobile-sidebar-shade { display: none; }
[hidden] { display: none !important; }
summary.section-title { list-style: none; cursor: pointer; }
summary.section-title::-webkit-details-marker { display: none; }
summary.section-title::after { content: "⌄"; color: #9aa2ae; margin-left: auto; }

@media (max-width: 1050px) {
  .admin-section-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .client-row { grid-template-columns: minmax(0,1.3fr) minmax(100px,.7fr) minmax(100px,.7fr) 36px; }
  .client-row .client-owner { display: none; }
  .admin-user-row { display: grid; grid-template-columns: minmax(0,1fr) auto !important; }
  .admin-user-row .client-meta { grid-column: 1 / -1; }
  .admin-user-row .page-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .backup-row { align-items: flex-start; flex-direction: column; }
  .backup-row .page-actions { justify-content: flex-start; }
  .client-contact-edit-row { grid-template-columns: 1fr 1fr 32px; }
  .client-contact-edit-row input:nth-child(2) { grid-column: 1 / 2; }
  .client-contact-edit-row input:nth-child(3) { grid-column: 2 / 3; }
  .client-contact-edit-row input:nth-child(4) { grid-column: 1 / 3; }
  .client-contact-edit-row button { grid-column: 3; grid-row: 1 / span 3; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-metrics-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .day-cell { min-height: 100px; padding: 6px; }
  .expense-row { grid-template-columns: 96px minmax(0,1.4fr) 82px 112px minmax(90px,1fr) 30px; }
}
@media (max-width: 760px) {
  .auth-page { display: block; min-height: 100vh; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 22px; align-items: start; }
  .auth-card { margin: 0 auto; padding-top: 9vh; }
  .auth-card .mobile-logo { display: block; width: 126px; height: 104px; object-fit: contain; margin: 0 auto 32px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 12; left: 0; top: 0; transform: translateX(-105%); width: 265px; transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-sidebar-shade.open { display: block; position: fixed; z-index: 11; inset: 0; background: rgba(16,24,38,.35); }
  .mobile-menu-button { display: inline-grid; }
  .topbar { height: 62px; padding: 0 15px; }
  .topbar-title { font-size: 13px; }
  .topbar-right { gap: 6px; }
  .user-filter { gap: 5px; font-size: 0; }
  .user-filter select { max-width: 150px; font-size: 10px; padding: 7px 22px 7px 8px; }
  .page-wrap { padding: 23px 14px 35px; }
  .admin-section-grid { grid-template-columns: 1fr; gap: 10px; }
  .admin-section-card { min-height: 145px; padding: 16px; }
  .admin-queues { grid-template-columns: 1fr; }
  .admin-queue-panel { padding: 14px; }
  .deal-top { flex-direction: column; }
  .deal-actions { justify-content: flex-start; width: 100%; }
  .deal-salary { align-items: flex-start; flex-direction: column; }
  .deal-invoice-picker { align-items: flex-start; flex-direction: column; }
  .deal-invoice-picker select { width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 23px; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .check-panel { grid-template-columns: 1fr; gap: 10px; }
  .check-controls { grid-template-columns: minmax(0,1fr) 110px; }
  .check-results { grid-column: auto; }
  .client-row { grid-template-columns: minmax(0,1fr) auto 30px; gap: 10px; padding: 13px; }
  .client-row .client-meta.mobile-hide { display: none; }
  .client-row .client-meta.mobile-value { display: block; }
  .client-row .client-owner { display: none; }
  .client-row .client-meta label { font-size: 9px; }
  .client-row .client-meta span { font-size: 10px; }
  .search-row { flex-wrap: wrap; }
  .search-row > .button { flex: 1 0 100%; }
  .client-list-controls { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar-head { padding: 12px; align-items: flex-start; flex-direction: column; }
  .calendar-head > .button { width: 100%; }
  .week-grid span { padding: 9px 2px; font-size: 9px; }
  .day-cell { min-height: 76px; padding: 3px; }
  .day-number { width: 22px; height: 22px; font-size: 10px; }
  .day-events { gap: 2px; margin-top: 3px; }
  .event-chip { padding: 3px; font-size: 0; height: 6px; border-radius: 4px; }
  .event-chip::first-letter { font-size: 0; }
  .more-events { font-size: 8px; padding-left: 1px; }
  .app-dialog { width: calc(100vw - 14px); max-height: 94vh; border-radius: 12px; }
  .dialog-inner { padding: 16px 13px; }
  .dialog-header h2 { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .detail-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
  .detail-sum-card { padding: 9px 7px; }
  .detail-sum-card span { font-size: 8px; }
  .detail-sum-card strong { font-size: 12px; }
  .expense-row { grid-template-columns: 1fr 1fr 32px; border: 1px solid #e6e9ee; border-radius: 8px; padding: 7px; }
  .expense-row .expense-description { grid-column: 1 / 3; grid-row: 1; }
  .expense-row .expense-category { grid-column: 1; grid-row: 2; }
  .expense-row .expense-amount { grid-column: 2; grid-row: 2; }
  .expense-row .expense-date { grid-column: 1; grid-row: 3; }
  .expense-row .expense-document-control { grid-column: 2; grid-row: 3; }
  .expense-row .expense-file-upload { grid-column: 1 / 3; grid-row: 4; flex-wrap: wrap; }
  .expense-row .expense-file-upload small { margin-left: 0; }
  .expense-row .expense-remove { grid-column: 3; grid-row: 1; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .dashboard-metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-card { min-height: 96px; padding: 12px; }
  .metric-card strong { font-size: 17px; margin-top: 14px; }
  .metric-card .metric-label { font-size: 9px; gap: 5px; }
  .metric-card .metric-label svg { width: 14px; height: 14px; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-metric { min-height: 108px; }
  .dashboard-metric strong { font-size: 16px; margin-top: 14px; }
  .panel-heading { padding: 14px 13px; }
  .dashboard-work-list, .dashboard-shortcuts { padding-inline: 9px; }
  .analytics-toolbar { align-items: stretch; padding: 10px; }
  .period-switch { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); }
  .period-button { padding: 6px 4px; font-size: 8px; }
  .anchor-controls, .custom-range-controls { justify-content: space-between; flex-wrap: wrap; }
  .custom-range-controls { width: 100%; }
  .custom-range-controls label { flex: 1 1 42%; }
  .custom-range-controls input { min-width: 0; width: 100%; }
  .custom-range-controls .button { flex: 1 1 100%; }
  .chart-panel .panel-heading { padding-bottom: 8px; }
  .chart-legend { gap: 8px; padding-inline: 13px; }
  .chart-legend-item { font-size: 8px; }
  .analytics-chart { height: 250px; }
  .client-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%,330px),1fr)); gap: 12px; }
  .client-card { min-height: 0; padding: 18px; }
  .client-card-main { margin-top: 0; }
  .client-card-details { margin-top: 16px; gap: 9px; }
  .client-card-activity { margin-top: 14px; }
  .client-card-task-list { margin-top: 8px; }
  .client-card-metrics { gap: 9px; padding-top: 14px; }
  .client-card-metrics small { font-size: 11px; }
  .client-card-footer { margin-top: 13px; padding-top: 10px; font-size: 11px; }
  .client-detail-page { gap: 10px; }
  .client-detail-head { align-items: flex-start; padding: 15px; gap: 10px; }
  .client-detail-identity { align-items: flex-start; gap: 10px; }
  .client-mark-large { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }
  .client-detail-title h1 { font-size: 18px; }
  .client-detail-title .eyebrow { font-size: 8px; }
  .client-detail-head .dialog-header-actions { gap: 3px; }
  .client-detail-head .button-small { min-height: 32px; padding: 6px 8px; }
  .client-contact-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .client-contact-item { padding: 11px 12px; }
  .client-contact-item:nth-child(2) { border-right: 0; }
  .client-contact-people { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid #eff1f4; padding: 11px 12px; }
  .client-contact-people-list { grid-template-columns: 1fr; }
  .client-contact-item:nth-child(2) { border-top: 0; }
  .client-contact-notes { grid-column: 1 / -1; border-top: 1px solid #eff1f4; }
  .client-contact-edit-row { grid-template-columns: minmax(0,1fr) 30px; }
  .client-contact-edit-row input { grid-column: 1; }
  .client-contact-edit-row button { grid-column: 2; grid-row: 1 / span 4; }
  .client-contact-notes { border-top: 1px solid #eff1f4; }
  .client-section-head { align-items: flex-start; flex-direction: column; padding: 15px; }
  .client-section-head .page-actions { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .client-section-head .page-actions .button { width: 100%; justify-content: center; }
  .client-section-content { padding: 13px; }
}
@media (max-width: 390px) {
  .client-list-controls { grid-template-columns: 1fr; }
  .user-filter select { max-width: 116px; }
  .check-controls { grid-template-columns: 1fr; }
  .check-controls select { width: 100%; }
  .calendar-month strong { min-width: 110px; font-size: 12px; }
  .client-name { gap: 8px; }
  .client-mark { width: 32px; height: 32px; }
  .client-route-toolbar { align-items: flex-start; flex-direction: column; gap: 3px; }
  .client-route-toolbar > span { text-align: left; max-width: 100%; }
  .detail-summary { grid-template-columns: 1fr; }
  .detail-sum-card { padding: 11px 12px; }
  .detail-sum-card span { font-size: 9px; }
  .detail-sum-card strong { font-size: 14px; margin-top: 4px; }
  .client-section-head .page-actions { grid-template-columns: 1fr; }
  .client-section-head .page-actions .button { min-height: 42px; }
  .file-line, .payment-line, .reminder-line { align-items: flex-start; padding: 10px; }
  .payment-line { flex-wrap: wrap; }
  .payment-line-actions { justify-content: flex-start; flex-wrap: wrap; }
  .reminder-actions { flex-wrap: wrap; }
  .file-actions { align-self: center; }
  .file-picker { gap: 8px; padding: 10px; }
  .file-picker-icon { flex-basis: 32px; width: 32px; height: 32px; }
}

@media (max-width: 340px) {
  .topbar { padding: 0 9px; }
  .topbar-left { gap: 7px; }
  .topbar-title { font-size: 11px; }
  .topbar-right { gap: 4px; }
  .user-filter select { max-width: 90px; padding-right: 18px; }
  .page-wrap { padding-inline: 10px; }
  .page-actions { gap: 6px; }
  .page-actions .button { padding-inline: 9px; font-size: 10px; }
  .client-detail-head { flex-direction: column; }
  .client-detail-head .dialog-header-actions { align-self: flex-end; }
  .client-tabs { margin-inline: -2px; }
  .client-tab { min-height: 40px; padding-inline: 9px; }
  .client-section-content { padding-inline: 10px; }
}

@media (max-width: 375px) {
  .client-card { padding: 15px; }
}

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

.deal-summary-page { display: grid; gap: 14px; min-width: 0; }
.deal-summary-hero { padding: 20px; }
.deal-summary-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.deal-summary-title h1 { margin: 6px 0 5px; font-size: 23px; line-height: 1.25; overflow-wrap: anywhere; }
.deal-summary-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.deal-summary-status { margin-top: 5px; font-size: 10px; }
.deal-summary-status-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.deal-summary-status-select { min-width: 150px; font-size: 12px; }
.deal-summary-transport-status { color: var(--navy); background: #edf3fc; white-space: normal; text-align: center; }
.deal-summary-additional-info { padding: 13px 2px 2px; color: var(--ink); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.deal-summary-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.deal-summary-meta span, .deal-summary-meta small, .deal-summary-meta strong { display: block; min-width: 0; }
.deal-summary-meta small { color: var(--muted); font-size: 10px; }
.deal-summary-meta strong { margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.deal-summary-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.deal-summary-metric { padding: 14px; min-width: 0; }
.deal-summary-metric span { display: block; color: var(--muted); font-size: 10px; }
.deal-summary-metric strong { display: block; margin-top: 8px; font-size: 17px; overflow-wrap: anywhere; }
.deal-summary-columns { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 12px; align-items: start; }
.deal-summary-section { padding: 16px; min-width: 0; }
.deal-summary-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); color: var(--navy); }
.deal-summary-section > header h2 { margin: 0; color: var(--ink); font-size: 15px; }
.deal-summary-section > header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.deal-summary-subheading, .deal-summary-doc-group > h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 15px 0 9px; color: var(--ink); font-size: 11px; }
.deal-summary-subheading h3 { margin: 0; font-size: inherit; }
.deal-summary-subheading > span, .deal-summary-doc-group > h3 span { color: var(--muted); font-size: 10px; }
.deal-summary-page .deal-salary { align-items: flex-start; margin-top: 12px; padding: 12px; }
.deal-summary-page .deal-salary > div strong { font-size: 12px; }
.deal-summary-page .deal-salary > div small { font-size: 10px; line-height: 1.5; }
.deal-summary-cost-list { display: grid; gap: 0; }
.deal-summary-cost { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #eff1f4; font-size: 11px; }
.deal-summary-cost:last-child { border-bottom: 0; }
.deal-summary-cost > div { display: grid; gap: 3px; min-width: 0; }
.deal-summary-cost > div > strong { font-size: 11px; }
.deal-summary-cost > div > span, .deal-summary-cost > div > small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.deal-summary-cost > div > a { display: inline-flex; align-items: center; gap: 4px; width: fit-content; color: var(--navy); font-size: 10px; text-decoration: none; overflow-wrap: anywhere; }
.deal-summary-cost > div > a:hover { text-decoration: underline; }
.deal-summary-cost > strong { flex: 0 0 auto; white-space: nowrap; }
.deal-summary-doc-group + .deal-summary-doc-group { margin-top: 14px; }
.deal-summary-doc-group > h3 { margin-top: 13px; }
.deal-summary-file { display: grid; grid-template-columns: 34px minmax(0,1fr) 16px; align-items: center; gap: 10px; padding: 10px; border: 1px solid #edf0f3; border-radius: 9px; color: var(--ink); text-decoration: none; min-width: 0; }
.deal-summary-file + .deal-summary-file { margin-top: 7px; }
.deal-summary-file:hover { border-color: #ccd7e8; background: #fafbfc; }
.deal-summary-file-entry { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; }
.deal-summary-file-entry + .deal-summary-file-entry { margin-top: 7px; }
.deal-summary-file-button { width: 100%; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.deal-summary-download { padding: 7px 3px; }
.deal-summary-file > span:nth-child(2) { min-width: 0; }
.deal-summary-file strong, .deal-summary-file small { display: block; overflow-wrap: anywhere; }
.deal-summary-file strong { font-size: 11px; line-height: 1.4; }
.deal-summary-file small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.deal-summary-file > svg { color: #98a4b3; }
.deal-summary-file-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #eef3fa; color: var(--navy); }
.deal-summary-empty { padding: 11px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }

@media (max-width: 900px) {
  .deal-summary-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .deal-summary-columns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .deal-summary-page { gap: 10px; }
  .deal-summary-hero, .deal-summary-section { padding: 14px; }
  .deal-summary-title { flex-direction: column; gap: 9px; }
  .deal-summary-status-controls { justify-content: flex-start; }
  .deal-summary-title h1 { font-size: 19px; }
  .deal-summary-meta { grid-template-columns: 1fr 1fr; gap: 12px 8px; margin-top: 15px; }
  .deal-summary-metric { padding: 11px; }
  .deal-summary-metric span { font-size: 9px; }
  .deal-summary-metric strong { margin-top: 6px; font-size: 14px; }
  .deal-summary-page .deal-salary { padding: 10px; }
}

.app-dialog.file-preview-dialog { width: min(1240px, calc(100vw - 28px)); max-height: min(96dvh, 1120px); }
.file-preview-inner { display: grid; grid-template-rows: auto minmax(260px, 1fr); gap: 16px; min-height: min(76dvh, 800px); }
.file-preview-content { min-width: 0; min-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #f7f8fa; }
.file-preview-message { display: grid; min-height: 240px; place-items: center; padding: 24px; color: var(--muted); text-align: center; }
.file-preview-pdf { display: block; width: 100%; height: min(76dvh, 820px); border: 0; background: #eceff3; }
.file-preview-pdf-content { display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; background: #eceff3; }
.file-preview-pdf-toolbar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.file-preview-pdf-controls { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.file-preview-pdf-page-info, .file-preview-pdf-zoom-info { min-width: 54px; color: var(--muted); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.file-preview-pdf-page { width: max-content; max-width: calc(100% - 24px); margin: 16px auto; overflow: hidden; border-radius: 3px; background: #fff; box-shadow: 0 2px 12px rgba(24,38,58,.14); }
.file-preview-pdf-canvas { display: block; max-width: none; background: #fff; }
.file-preview-image { display: block; max-width: 100%; max-height: min(76dvh, 820px); margin: 0 auto; object-fit: contain; }
.file-preview-text { margin: 0; padding: 22px; color: var(--ink); font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-preview-sheet-toolbar { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.file-preview-sheet-toolbar label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.file-preview-sheet-toolbar select { max-width: min(52vw, 360px); min-width: 120px; }
.file-preview-table-wrap { overflow: auto; max-height: 62dvh; background: #fff; }
.file-preview-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--ink); font-size: 12px; }
.file-preview-table th, .file-preview-table td { max-width: 320px; min-width: 100px; padding: 8px 10px; border-right: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-preview-table thead th { position: sticky; z-index: 1; top: 0; background: #f4f6f9; color: var(--muted); }
.file-preview-table tbody th { position: sticky; left: 0; background: #f8f9fb; color: var(--muted); }
.file-preview-note { margin: 0; padding: 10px 14px; color: var(--muted); font-size: 12px; }
.file-preview-pagination { margin: 10px 14px 14px; }
@media (max-width: 560px) {
  .app-dialog.file-preview-dialog { width: calc(100vw - 12px); max-height: 96dvh; }
  .file-preview-inner { min-height: min(84dvh, 800px); padding: 13px; }
  .file-preview-inner .dialog-header { align-items: flex-start; }
  .file-preview-inner .dialog-header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .file-preview-content { min-height: 220px; }
  .file-preview-pdf { height: 76dvh; }
  .file-preview-pdf-toolbar { justify-content: space-between; gap: 5px; padding: 8px; }
  .file-preview-pdf-controls { gap: 5px; }
  .file-preview-pdf-toolbar .button-small { min-width: 34px; padding: 6px 8px; }
  .file-preview-pdf-page { max-width: calc(100% - 12px); margin: 8px auto; }
  .file-preview-sheet-toolbar { align-items: flex-start; flex-direction: column; }
  .file-preview-table th, .file-preview-table td { min-width: 88px; padding: 7px; }
}

@media (max-width: 900px) {
  .chart-scroll-hint { display: block; }
}

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 2px 2px; color: var(--muted); font-size: 12px; }
.team-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.team-list-tools .search-field { width: min(100%, 360px); }
.team-list-tools .search-field input { min-width: 0; }
.team-list-tools > .subtle { flex: 0 0 auto; }
.pagination-summary { flex: 0 0 auto; }
.pagination-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.pagination-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination-jump { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.pagination-jump input { width: 62px; height: 34px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
.pagination-page, .pagination-arrow { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font-weight: 650; }
.pagination-page:hover, .pagination-arrow:not(:disabled):hover { border-color: var(--line); background: #fff; }
.pagination-page.active { border-color: #dce6f6; background: #edf2fb; color: var(--navy); }
.pagination-arrow { border-color: var(--line); background: #fff; font-size: 20px; line-height: 1; }
.pagination-arrow:disabled { color: #b6bdc8; cursor: default; }
.pagination-ellipsis { padding: 0 3px; }
.transport-deal-results { display: grid; gap: 5px; max-height: 220px; margin-top: 7px; overflow: auto; overscroll-behavior: contain; }
.transport-deal-option { display: grid; gap: 3px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); text-align: left; }
.transport-deal-option:hover { border-color: #b9c9e2; background: #f8faff; }
.transport-deal-option strong { font-size: 12px; line-height: 1.4; }
.transport-deal-option span, .transport-deal-empty { color: var(--muted); font-size: 11px; line-height: 1.45; }
.transport-deal-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 9px; }
.transport-deal-selected { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; padding: 10px 12px; border: 1px solid #d7e8df; border-radius: 9px; background: #f3faf6; }
.transport-deal-selected[hidden] { display: none; }
.transport-deal-selected span { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.transport-deal-selected small { color: var(--muted); text-align: right; }

@media (max-width: 560px) {
  .team-list-tools { align-items: stretch; flex-direction: column; gap: 7px; }
  .team-list-tools .search-field { width: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .pagination-controls { max-width: 100%; justify-content: flex-end; }
  .pagination-page, .pagination-arrow { min-width: 32px; height: 32px; }
  .pagination-jump { margin-left: auto; }
  .pagination-jump input { height: 32px; }
  .transport-deal-selected { align-items: flex-start; flex-direction: column; gap: 4px; }
  .transport-deal-selected small { text-align: left; }
}

.analytics-view-tabs { display: inline-flex; gap: 3px; width: fit-content; margin: 0 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.analytics-view-tab { min-height: 34px; padding: 7px 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer; }
.analytics-view-tab:hover { color: var(--navy); background: #f5f7fa; }
.analytics-view-tab.active { background: #edf2fb; color: var(--navy); }
.salary-metrics-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.salary-history-panel { overflow: hidden; }
.salary-history-search { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.salary-history-search .search-field { width: 100%; }
.salary-history-table { min-width: 900px; white-space: normal; font-size: 11px; }
.salary-history-table th { text-align: right; font-size: 10px; white-space: nowrap; }
.salary-history-table th:first-child, .salary-history-table td:first-child { text-align: left; }
.salary-history-table td { vertical-align: top; line-height: 1.45; }
.salary-deal-cell { min-width: 200px; max-width: 310px; overflow-wrap: anywhere; }
.salary-deal-cell strong, .salary-deal-cell small { display: block; }
.salary-deal-cell strong { color: var(--ink); font-size: 11px; }
.salary-deal-cell small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.salary-state-tag { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.salary-state-tag.paid { color: #147354; background: #e9f6f0; }
.salary-state-tag.waiting { color: #94610b; background: #fff4dc; }
.salary-state-tag.cancelled, .salary-state-tag.no-commission { color: #667085; background: #eef1f5; }
.salary-payout-value, .salary-payout-deduction { display: block; margin-top: 4px; }
.salary-payout-value { color: var(--ink); font-size: 11px; }
.salary-payout-deduction { color: var(--muted); font-size: 9px; white-space: nowrap; }
.salary-state-note { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.salary-history-note { margin-top: 12px; }
@media (max-width: 900px) {
  .salary-metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .analytics-view-tabs { display: flex; width: 100%; }
  .analytics-view-tab { flex: 1; }
  .salary-metrics-grid { grid-template-columns: 1fr; }
  .salary-history-search { padding: 10px; }
  .salary-history-panel .panel-heading { align-items: flex-start; }
}
.salary-basis-tabs { display: inline-flex; gap: 3px; width: fit-content; margin: 4px 0 12px; padding: 3px; border-radius: 10px; background: #f2f4f7; }
@media (max-width: 700px) { .salary-basis-tabs { display: flex; width: 100%; } }
