@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #19231f;
  --muted: #66726d;
  --muted-2: #8d9793;
  --paper: #f4f2ec;
  --surface: #fffefa;
  --surface-2: #f7f6f1;
  --line: #e3e0d7;
  --forest: #173c31;
  --forest-2: #245846;
  --green: #245846;
  --green-pale: #e7f2eb;
  --page: #f4f2ec;
  --mint: #dbe9df;
  --sage: #9bb7a7;
  --orange: #d87335;
  --orange-bg: #fff0e5;
  --red: #b94343;
  --red-bg: #fce9e7;
  --blue: #356b86;
  --blue-bg: #e8f1f5;
  --shadow: 0 18px 48px rgba(41, 52, 47, 0.08);
  --radius: 18px;
  --radius-sm: 11px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }

.environment-banner {
  min-height: 32px; padding: 6px 18px; position: fixed; inset: 0 0 auto; z-index: 100;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #fff; background: #a32f2f; box-shadow: 0 3px 12px rgba(83, 16, 16, .25);
  font-size: 11px; line-height: 1.35; text-align: center;
}
.environment-banner[hidden] { display: none; }
.environment-banner strong { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
body.is-local-environment .app-shell { min-height: calc(100vh - 32px); padding-top: 32px; }
body.is-local-environment .sidebar { top: 32px; height: calc(100vh - 32px); }
body.is-local-environment .topbar { top: 32px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; display: flex; flex-direction: column;
  color: #f8fbf8; background: linear-gradient(165deg, #142d25 0%, #193f32 58%, #10271f 100%); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.11); }
.brand-mark { width: 41px; height: 41px; border-radius: 13px; display: grid; place-items: center; background: #e5a86e; color: #173229; font-weight: 800; letter-spacing: -.04em; }
.brand strong { display: block; font-size: 14px; }
.brand span { display: block; margin-top: 3px; color: rgba(255,255,255,.56); font-size: 11px; }
.main-nav { display: grid; gap: 5px; margin-top: 28px; }
.nav-item { width: 100%; border: 0; border-radius: 12px; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 8px; padding: 12px; color: rgba(255,255,255,.64); background: transparent; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-item[hidden] { display: none !important; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 #e5a86e; }
.nav-icon { display: grid; place-items: center; font-size: 18px; }
.nav-count { min-width: 24px; padding: 3px 7px; border-radius: 999px; color: rgba(255,255,255,.74); background: rgba(0,0,0,.17); text-align: center; font-size: 11px; font-weight: 700; }
.sidebar-footer { margin-top: auto; }
.pwa-sidebar-install { width: 100%; min-height: 40px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; font-size: 11px; font-weight: 800; }
.pwa-sidebar-install[hidden] { display: none; }
.pwa-sidebar-install:hover { background: rgba(255,255,255,.14); }
.legal-note { display: flex; gap: 10px; padding: 13px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.05); }
.legal-dot { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #a6d1b3; box-shadow: 0 0 0 4px rgba(166,209,179,.1); }
.legal-note strong { display: block; font-size: 11px; }
.legal-note span:not(.legal-dot) { display: block; margin-top: 4px; color: rgba(255,255,255,.48); font-size: 11px; line-height: 1.4; }
.version { display: block; padding: 14px 12px 0; color: rgba(255,255,255,.35); font-size: 11px; }
.case-links { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 14px; }
.case-external-link { display: inline-flex; font-size: 12px; font-weight: 700; text-decoration: none; }
.case-external-link:hover { text-decoration: underline; }
.case-create-request { flex: 0 0 auto; margin-left: auto; padding: 8px 11px; border: 1px solid #b9cec2; border-radius: 9px; color: var(--forest-2); background: var(--mint); font: inherit; font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.case-create-request:hover { border-color: var(--forest-2); background: #dcebe2; }
.case-create-request:focus-visible { outline: 3px solid rgba(39, 94, 70, .2); outline-offset: 2px; }
.bitrix-link { color: var(--blue); }
.kad-link { color: var(--forest-2); }
.external-row-link { width: auto; min-width: 34px; padding: 0 6px; display: grid; place-items: center; color: var(--blue); font-size: 11px; font-weight: 800; text-decoration: none; }

.main { min-width: 0; }
.topbar { min-height: 91px; display: flex; align-items: center; gap: 18px; padding: 20px clamp(24px, 4vw, 54px); border-bottom: 1px solid rgba(217,214,205,.75); background: rgba(244,242,236,.88); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.page-heading { margin-right: auto; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-family: inherit; font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.auth-user { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.auth-user[hidden] { display: none; }
.auth-user-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #fff; background: var(--forest); font-size: 11px; font-weight: 900; }
.auth-user-copy { min-width: 90px; display: grid; gap: 1px; }
.auth-user-copy strong { max-width: 145px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.auth-user-copy small { color: var(--muted); font-size: 11px; }
.auth-user-action { min-height: 29px; padding: 0 8px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 11px; font-weight: 800; }
.auth-user-action:hover { color: var(--forest); background: #e5eee8; }
.icon-button, .notification-button { border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-button { width: 43px; height: 43px; border-radius: 12px; }
.notification-button { width: 46px; height: 43px; border-radius: 12px; position: relative; font-size: 19px; }
.notification-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--paper); border-radius: 999px; color: #fff; background: var(--orange); font-size: 11px; font-weight: 800; }
.mobile-menu { display: none; }
.content { padding: 32px clamp(24px, 4vw, 54px) 56px; }
.view { display: none; animation: reveal .24s ease; }
.view.is-active { display: block; }
@keyframes reveal { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.my-day-header { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 22px; padding: 25px 27px; border-left: 4px solid var(--forest-2); }
.team-day-header { grid-template-columns: minmax(0, 1fr); }
.team-day-header .pilot-badge { grid-column: auto; margin-top: -12px; }
.my-day-intro h2 { margin: 5px 0 7px; font-family: inherit; font-size: 28px; font-weight: 600; letter-spacing: -.025em; }
.my-day-intro p { max-width: 760px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.my-day-person { display: grid; gap: 6px; }
.my-day-person[hidden], .my-day-identity[hidden] { display: none; }
.my-day-person > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.my-day-person select { width: 100%; min-height: 45px; padding: 0 36px 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfaf7; font-weight: 700; }
.my-day-identity { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 13px; background: #fbfaf7; }
.my-day-identity-avatar, .team-day-member-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--forest-2); font-size: 11px; font-weight: 900; }
.my-day-identity > span:last-child { min-width: 0; display: grid; gap: 3px; }
.my-day-identity small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.my-day-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pilot-badge { grid-column: 2; justify-self: start; margin-top: -15px; color: #976025; font-size: 11px; line-height: 1.35; }
.team-day-members { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 10px; margin: 17px 0 14px; }
.team-day-member { min-width: 0; min-height: 68px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); text-align: left; cursor: pointer; box-shadow: 0 6px 20px rgba(41,52,47,.025); }
.team-day-member:hover { border-color: #bdd1c5; background: #fbfdfb; }
.team-day-member.is-active { border-color: var(--forest-2); background: var(--mint); box-shadow: inset 0 0 0 1px var(--forest-2); }
.team-day-member.is-active .team-day-member-avatar { background: var(--forest); }
.team-day-member-copy { min-width: 0; display: grid; gap: 4px; }
.team-day-member-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.team-day-member-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.my-day-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 17px 0 14px; }
.my-day-toolbar { min-height: 58px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 13px; }
.my-day-filter-stack { min-width: 0; display: grid; gap: 8px; }
.my-day-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.my-day-filters button { min-height: 35px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.my-day-filters button:hover { color: var(--forest); background: var(--surface-2); }
.my-day-filters button.is-active { border-color: #bdd1c5; color: var(--forest); background: var(--mint); }
.my-day-updated { flex: 0 0 auto; color: var(--muted-2); font-size: 11px; }
.my-day-queue { display: grid; gap: 10px; }
.my-day-item { min-height: 132px; display: grid; grid-template-columns: 7px minmax(0, 1fr) minmax(245px, auto); gap: 17px; align-items: stretch; padding: 19px 20px 19px 0; border: 1px solid rgba(225,222,212,.9); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(41,52,47,.035); }
.my-day-item-marker { width: 7px; height: 100%; min-height: 92px; border-radius: 0 99px 99px 0; background: var(--sage); }
.my-day-item.is-overdue .my-day-item-marker { background: var(--red); }
.my-day-item.is-today .my-day-item-marker { background: var(--orange); }
.my-day-item.is-upcoming .my-day-item-marker { background: var(--blue); }
.my-day-item-copy { min-width: 0; align-self: center; }
.my-day-item-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.work-type, .work-status { padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.work-type { color: var(--forest-2); background: var(--mint); text-transform: uppercase; letter-spacing: .04em; }
.work-status { color: var(--muted); background: var(--surface-2); }
.my-day-item-copy h3 { margin: 9px 0 4px; overflow: hidden; font-family: inherit; font-size: 19px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.my-day-item-copy > p { margin: 0; color: var(--ink); font-size: 11px; font-weight: 700; }
.my-day-item-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.my-day-item-meta strong { color: var(--ink); }
.my-day-item-side { min-width: 245px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 13px; padding: 4px 0; }
.my-day-item-side > strong { color: var(--muted); font-size: 11px; }
.my-day-item.is-overdue .my-day-item-side > strong { color: var(--red); }
.my-day-item.is-today .my-day-item-side > strong { color: #a75120; }
.my-day-item-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.my-day-item-actions .button { min-height: 35px; padding-inline: 10px; font-size: 11px; text-decoration: none; }

.debtor-scope-panel { min-height: 58px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 11px; }
.debtor-scope-panel > span { color: var(--muted-2); font-size: 11px; text-align: right; }
.debtor-scope-tabs { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.debtor-scope-tab { min-height: 39px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.debtor-scope-tab strong { min-width: 22px; padding: 3px 6px; border-radius: 999px; color: inherit; background: rgba(255,255,255,.78); font-size: 11px; text-align: center; }
.debtor-scope-tab:hover { color: var(--forest); background: rgba(255,255,255,.72); }
.debtor-scope-tab.is-active { border-color: #b8cdbf; color: var(--forest); background: #e5f0e8; box-shadow: 0 3px 10px rgba(37,74,59,.07); }
.debtor-scope-tab.is-individual.is-active { border-color: #b9d2df; color: #28657e; background: #e8f3f8; }
.debtor-scope-tab.is-all.is-active { border-color: #d5d1c8; color: var(--ink); background: #fff; }
.debtor-scope-tabs.is-compact { width: fit-content; padding: 3px; }
.debtor-scope-tabs.is-compact .debtor-scope-tab { min-height: 31px; padding-inline: 9px; font-size: 11px; }
.debtor-type-badge { min-height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; border: 1px solid #b9cfbf; border-radius: 999px; color: #31654c; background: #e7f1ea; font-size: 11px; font-weight: 900; line-height: 1; vertical-align: middle; white-space: nowrap; }
.debtor-type-badge.is-individual { border-color: #b9d2df; color: #28657e; background: #e8f3f8; }
.my-day-item-tags .debtor-type-badge { min-height: 22px; }
.cell-main strong .debtor-type-badge, .case-list-debtor strong .debtor-type-badge { margin-left: 5px; display: inline-flex; }

.button { min-height: 41px; border: 1px solid transparent; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; font-weight: 700; font-size: 12px; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--forest); box-shadow: 0 8px 18px rgba(23,60,49,.13); }
.button-primary:hover { background: var(--forest-2); }
.button-secondary { border-color: var(--line); background: var(--surface); }
.button-light { color: var(--forest); background: #f6f4eb; }
.button-ghost-light { color: #f7f6ef; border-color: rgba(255,255,255,.28); background: transparent; }
.button-quiet { border-color: transparent; color: var(--muted); background: transparent; }
.button-block { width: 100%; }
.text-button { border: 0; color: var(--forest-2); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }

.hero { min-height: 265px; overflow: hidden; position: relative; display: grid; grid-template-columns: 1fr 280px; align-items: center; padding: 40px 46px; border-radius: 24px; color: #fff; background: radial-gradient(circle at 78% 20%, rgba(229,168,110,.3), transparent 28%), linear-gradient(120deg, #173c31 0%, #245847 100%); box-shadow: var(--shadow); }
.hero-copy { max-width: 610px; position: relative; z-index: 2; }
.hero-kicker { color: #e7be94; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h2 { margin: 12px 0 11px; font-family: inherit; font-size: clamp(31px, 4vw, 47px); line-height: 1.05; font-weight: 600; letter-spacing: -.045em; }
.hero p { max-width: 580px; margin-bottom: 24px; color: rgba(255,255,255,.68); font-size: 14px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-visual { min-height: 190px; position: relative; display: grid; place-items: center; }
.hero-orbit { width: 136px; height: 136px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.hero-orbit span { font-family: inherit; font-size: 36px; }
.hero-orbit small { width: 80px; color: rgba(255,255,255,.55); font-size: 11px; text-align: center; text-transform: uppercase; letter-spacing: .07em; line-height: 1.4; }
.pulse-ring { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.pulse-ring-one { width: 210px; height: 210px; }
.pulse-ring-two { width: 290px; height: 290px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 18px 0; }
.metric-card { min-height: 125px; padding: 20px; border: 1px solid rgba(225,222,212,.86); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(41,52,47,.035); }
.metric-top { display: flex; justify-content: space-between; gap: 12px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.metric-value { display: block; margin: 8px 0 3px; font-family: inherit; font-size: 31px; font-weight: 600; line-height: 1; }
.metric-note { color: var(--muted-2); font-size: 11px; }
.metric-card.is-danger .metric-value { color: var(--red); }
.metric-card.is-warning .metric-value { color: var(--orange); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; }
.panel { border: 1px solid rgba(225,222,212,.86); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px rgba(41,52,47,.04); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 24px 16px; }
.panel-header h2, .section-toolbar h2, .integration-grid h2 { margin: 4px 0 0; font-family: inherit; font-size: 23px; font-weight: 600; letter-spacing: -.025em; }
.panel-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.digest-status { color: var(--muted); font-size: 11px; line-height: 1.35; text-decoration: none; }
.digest-status[href]:hover { text-decoration: underline; }
.digest-status.is-sent { color: var(--forest-2); }
.digest-status.is-failed { color: var(--red); }
.digest-status.is-pending { color: #a75120; }
.panel-kicker { color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.priority-list { padding: 0 14px 15px; }
.priority-item { width: 100%; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 15px; padding: 15px 11px; border: 0; border-top: 1px solid #ece9e2; color: inherit; background: transparent; cursor: pointer; font: inherit; text-align: left; }
.priority-item:hover { background: #faf9f5; }
.priority-item:focus-visible { outline: 3px solid rgba(45, 112, 86, .2); outline-offset: -3px; }
.priority-marker { width: 8px; height: 34px; border-radius: 99px; background: var(--sage); }
.priority-marker.danger { background: var(--red); }
.priority-marker.warning { background: var(--orange); }
.priority-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.priority-copy span { display: block; margin-top: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.priority-due { min-width: 105px; text-align: right; }
.priority-due strong { display: block; font-size: 11px; }
.priority-due span { display: block; margin-top: 4px; color: var(--muted-2); font-size: 11px; }
.cases-summary-panel { padding-bottom: 13px; }
.case-summary-item { margin: 0 16px 10px; padding: 14px; border-radius: 13px; background: var(--surface-2); }
.case-summary-item strong { display: block; font-size: 11px; }
.case-summary-item > span { display: block; margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.progress-line { height: 5px; overflow: hidden; border-radius: 99px; background: #e4e2da; }
.progress-line i { display: block; height: 100%; border-radius: inherit; background: var(--forest-2); }
.progress-0 { width: 0; }
.progress-10 { width: 10%; }
.progress-20 { width: 20%; }
.progress-30 { width: 30%; }
.progress-40 { width: 40%; }
.progress-50 { width: 50%; }
.progress-60 { width: 60%; }
.progress-70 { width: 70%; }
.progress-80 { width: 80%; }
.progress-90 { width: 90%; }
.progress-100 { width: 100%; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted-2); font-size: 11px; }
.empty-state { padding: 32px 20px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }

.section-toolbar { min-height: 70px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-toolbar h2 { margin-top: 5px; font-size: 30px; }
.toolbar-actions { display: flex; gap: 9px; }
.cases-toolbar-actions { align-items: center; }
.view-switcher { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #ebe9e2; }
.view-switcher button { min-height: 35px; padding: 0 13px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.view-switcher button[aria-pressed="true"] { color: var(--forest); background: var(--surface); box-shadow: 0 3px 10px rgba(37, 50, 44, .09); }
.view-switcher button:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.filters { display: grid; grid-template-columns: minmax(230px,1fr) 150px 190px 150px 170px auto; gap: 10px; padding: 13px; margin-bottom: 14px; }
.filters select, .search-field { min-height: 43px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.filters select { width: 100%; padding: 0 34px 0 12px; color: var(--ink); }
.filters select, .case-filters select {
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23245846' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
}
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search-field span { color: var(--muted); font-size: 20px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.table-panel { max-width: 100%; min-width: 0; overflow: hidden; }
.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.request-case-group-row td { padding: 0; border-top: 10px solid var(--page); background: #eef3ef; }
.request-case-group-row:first-child td { border-top: 0; }
.request-case-group-heading { min-height: 70px; display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; }
.request-case-toggle { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.request-case-toggle:focus-visible { border-radius: 8px; outline: 2px solid var(--green); outline-offset: 2px; }
.request-case-chevron { flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--forest-2); background: var(--mint); font-size: 0; line-height: 1; transition: transform .16s ease; }
.request-case-chevron::before { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; transform: rotate(45deg); transform-origin: center; }
.request-case-group-row.is-collapsed .request-case-chevron { transform: rotate(-90deg); }
.request-case-title { min-width: 0; }
.request-case-title strong, .request-case-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-case-title strong { color: var(--forest); font-family: inherit; font-size: 18px; font-weight: 600; }
.request-case-title span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.request-case-title .request-case-name { margin-top: 0; display: flex; align-items: center; gap: 7px; }
.request-case-title .request-case-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-case-title .debtor-type-badge { flex: 0 0 auto; margin: 0; display: inline-flex; }
.request-case-metrics { display: flex; align-items: stretch; gap: 6px; }
.request-case-metrics > span { min-width: 74px; padding: 7px 9px; border: 1px solid rgba(72, 101, 88, .12); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.58); font-size: 11px; white-space: nowrap; }
.request-case-metrics strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 11px; }
.request-case-metrics .is-danger, .request-case-metrics .is-danger strong { color: var(--red); }
.request-case-metrics .request-case-filtered { color: var(--blue); font-weight: 800; display: flex; align-items: center; }
.request-case-actions { display: flex; justify-content: flex-end; gap: 6px; }
.request-case-action { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.request-case-action:hover { border-color: var(--sage); background: var(--mint); }
.request-case-action.is-primary { min-height: 36px; padding-inline: 13px; border-color: var(--forest); color: #fff; background: var(--forest); box-shadow: 0 7px 16px rgba(23, 60, 49, .18); font-size: 11px; letter-spacing: .01em; }
.request-case-action.is-primary:hover { border-color: var(--forest-2); color: #fff; background: var(--forest-2); box-shadow: 0 9px 19px rgba(23, 60, 49, .24); transform: translateY(-1px); }
.request-case-action.is-primary:focus-visible { outline: 3px solid rgba(36, 88, 70, .22); outline-offset: 2px; }
.request-case-attention { padding: 0 18px 9px 49px; color: var(--red); font-size: 11px; font-weight: 800; }
.request-authority-cell strong { white-space: normal; }
table { width: 100%; border-collapse: collapse; min-width: 1030px; }
th { padding: 14px 16px; color: var(--muted-2); background: #f8f7f3; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 15px 16px; border-top: 1px solid #ebe8e1; vertical-align: middle; font-size: 11px; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #fbfaf7; }
.cell-main { max-width: 230px; }
.cell-main strong, .cell-main span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cell-main strong { font-size: 11px; }
.cell-main span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.cell-main .authority-badge { display: inline-flex; width: fit-content; margin-top: 7px; padding: 3px 6px; border-radius: 999px; color: var(--green); background: var(--green-pale); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cell-date strong, .cell-date span { display: block; }
.cell-date span { margin-top: 4px; color: var(--muted-2); font-size: 11px; }
.priority-flag { margin-right: 6px; color: var(--orange); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 999px; color: #53615b; background: #edf0ed; white-space: nowrap; font-size: 11px; font-weight: 800; }
.status-badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-badge.overdue, .status-badge.returned { color: var(--red); background: var(--red-bg); }
.status-badge.due_soon, .status-badge.due_today, .status-badge.requires_followup { color: #a75120; background: var(--orange-bg); }
.status-badge.delivery_tracking, .status-badge.awaiting_delivery { color: var(--blue); background: var(--blue-bg); }
.status-badge.response_received { color: #397052; background: #e7f2eb; }
.status-badge.requisition-review { color: #9f2f2f; background: var(--red-bg); }
.status-badge.requisition-preparing, .status-badge.requisition-ready { color: #a75120; background: var(--orange-bg); }
.status-badge.requisition-filed, .status-badge.requisition-hearing { color: var(--blue); background: var(--blue-bg); }
.status-badge.requisition-completed { color: #397052; background: #e7f2eb; }
.status-badge.requisition-cancelled { color: var(--muted); background: #edf0ed; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-action { min-width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; font-size: 11px; }
.row-action:hover { border-color: var(--sage); }
.table-footer { padding: 13px 17px; border-top: 1px solid #ebe8e1; color: var(--muted); background: #faf9f6; font-size: 11px; }

.cases-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
/* Вложенный контейнер сохраняет совместимость с ранее закэшированными версиями PWA.
   В актуальном клиенте он должен занимать всю сетку, а не первую из трёх колонок. */
#casesGrid > #casesContainer { width: 100%; min-width: 0; grid-column: 1 / -1; }
.case-filters { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(150px, .45fr) minmax(180px, .55fr) minmax(190px, .55fr) auto; gap: 10px; padding: 13px; margin-bottom: 14px; }
.case-filters select, .case-filters .search-field { min-height: 43px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.case-filters select { width: 100%; padding-left: 12px; color: var(--ink); }
.cases-footer { margin-top: 12px; color: var(--muted); font-size: 11px; text-align: right; }
.cases-list-view { min-width: 0; }
.cases-list-table { min-width: 1120px; }
.cases-list-table th:nth-child(1) { width: 215px; }
.cases-list-table th:nth-child(2) { width: 145px; }
.cases-list-table th:nth-child(3) { width: 170px; }
.cases-list-table th:nth-child(4), .cases-list-table th:nth-child(5), .cases-list-table th:nth-child(6) { width: 95px; }
.cases-list-table th:nth-child(7) { width: 125px; }
.case-list-debtor { max-width: 260px; }
.case-list-metric { min-width: 78px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; color: inherit; background: var(--surface-2); cursor: pointer; text-align: left; }
.case-list-metric:hover { border-color: var(--sage); background: var(--mint); }
.case-list-metric:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.case-list-metric strong, .case-list-metric span { display: block; }
.case-list-metric strong { font-size: 11px; }
.case-list-metric span { margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.case-list-metric.is-danger { color: var(--red); background: var(--red-bg); }
.case-list-actions { min-width: 180px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.case-list-action { min-height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; color: var(--forest-2); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 800; }
.case-list-action:hover { border-color: var(--sage); }
.case-card { min-height: 255px; padding: 22px; position: relative; overflow: hidden; }
.case-card::after { width: 105px; height: 105px; position: absolute; top: -45px; right: -35px; border-radius: 50%; background: var(--mint); opacity: .55; content: ""; }
.case-card-top { display: flex; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.procedure-tag { display: inline-block; padding: 5px 7px; border-radius: 7px; color: var(--forest-2); background: var(--mint); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.case-card-top > .debtor-type-badge { min-height: 24px; margin-right: auto; }
.case-sensitive-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #ead8b4; border-radius: 12px; background: #fff9ed; color: #6e562c; }
.case-sensitive-note strong { white-space: nowrap; }
.case-sensitive-note span { font-size: 11px; line-height: 1.45; }
.form-grid-nested { margin: 0; }
.case-physical-fields { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fbfaf6; }
.related-persons-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.related-persons-header div { display: grid; gap: 3px; }
.related-persons-header span { color: var(--muted); font-size: 11px; }
.related-persons-list { display: grid; gap: 12px; margin-top: 12px; }
.related-person-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.related-person-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.request-kit-intro { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.request-kit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.request-kit-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.request-kit-item input { margin-top: 3px; accent-color: var(--green); }
.request-kit-item span { display: grid; gap: 2px; }
.request-kit-item small { color: var(--muted); font-size: 11px; }
.request-kit-item.is-existing { opacity: .58; cursor: default; }
.bank-kind-switch { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #d6e2da; border-radius: 12px; background: #f4f8f5; cursor: pointer; }
.bank-kind-switch input { position: absolute; opacity: 0; pointer-events: none; }
.bank-kind-switch-control { width: 38px; height: 22px; flex: 0 0 38px; position: relative; border-radius: 99px; background: #b8c3bd; transition: background .16s ease; }
.bank-kind-switch-control::after { width: 16px; height: 16px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); content: ""; transition: transform .16s ease; }
.bank-kind-switch input:checked + .bank-kind-switch-control { background: var(--orange); }
.bank-kind-switch input:checked + .bank-kind-switch-control::after { transform: translateX(16px); }
.bank-kind-switch input:focus-visible + .bank-kind-switch-control { outline: 3px solid rgba(36,88,70,.2); outline-offset: 2px; }
.bank-kind-switch > span:last-child { display: grid; gap: 2px; }
.bank-kind-switch strong { color: var(--forest); font-size: 11px; }
.bank-kind-switch small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.bank-kit-common-fields { margin-bottom: 16px; }
.bank-kit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.bank-kit-toolbar > div:first-child { display: grid; gap: 2px; }
.bank-kit-toolbar strong { color: var(--forest); font-size: 11px; }
.bank-kit-toolbar span { color: var(--muted); font-size: 11px; }
.bank-kit-toolbar > div:last-child { display: flex; gap: 6px; }
.bank-kit-list { max-height: 310px; display: grid; gap: 7px; overflow: auto; padding-right: 3px; }
.bank-kit-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.bank-kit-item.is-selected { border-color: #abc7b7; background: #f0f7f2; }
.bank-kit-item.is-filtered { display: none; }
.bank-kit-select { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
.bank-kit-name { min-width: 0; display: grid; gap: 2px; }
.bank-kit-name strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bank-kit-name small { color: var(--muted); font-size: 11px; }
.bank-kit-kind { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.bank-kit-kind input { accent-color: var(--orange); }
.bank-kit-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.bank-request-kind-badge { display: inline-flex; margin-left: 5px; padding: 2px 5px; border-radius: 6px; color: #8b3b1d; background: #f8dfcf; font-size: 11px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.case-menu { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.case-card h3 { margin: 19px 0 7px; font-family: inherit; font-size: 20px; font-weight: 600; line-height: 1.2; }
.case-number { color: var(--muted); font-size: 11px; }
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 22px 0 18px; }
.case-stat { width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 10px; color: inherit; background: var(--surface-2); font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.case-stat:hover { border-color: #bdd1c7; background: var(--mint); transform: translateY(-1px); }
.case-stat:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.case-stat strong { display: block; font-size: 16px; }
.case-stat span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.case-owner { display: flex; align-items: center; gap: 9px; padding-top: 15px; border-top: 1px solid var(--line); }
.case-owner > .avatar { width: 38px; height: 38px; flex: 0 0 38px; margin: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--forest-2); font-size: 13px; font-weight: 800; line-height: 1; letter-spacing: .02em; text-align: center; }
.case-owner > div { min-width: 0; flex: 1 1 auto; }
.case-owner > div > strong { display: block; font-size: 11px; }
.case-owner > div > span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.case-owner > .case-card-actions { width: calc(100% - 47px); margin: 10px 0 0 47px; flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.case-card-actions .case-create-request { min-width: 0; min-height: 36px; margin-left: 0; padding: 6px 8px; justify-content: center; white-space: normal; line-height: 1.2; }
.case-card-actions .case-create-request:last-child:nth-child(odd) { grid-column: 1 / -1; }
.case-deposit-summary { margin: -8px 0 13px; padding: 8px 10px; border-radius: 9px; color: var(--forest-2); background: #eef5ef; font-size: 11px; }
.case-deposit-summary strong { font-size: 12px; }

.deposit-filters { grid-template-columns: minmax(240px, 1fr) minmax(220px, .7fr) auto; }
.deposit-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.deposit-metric-value { display: block; margin: 10px 0 5px; font-family: inherit; font-size: 23px; font-weight: 600; }
.deposits-table { min-width: 1080px; }
.deposit-attention-row { background: #fffaf2; }
.deposit-escalation { display: block; width: fit-content; margin-top: 5px; padding: 4px 7px; border-radius: 999px; color: var(--red); background: var(--red-bg); font-size: 11px; font-weight: 800; }
.status-badge.deposit-motion_required, .status-badge.deposit-waiting_ruling { color: #a75120; background: var(--orange-bg); }
.status-badge.deposit-motion_filed, .status-badge.deposit-court_review, .status-badge.deposit-accounting, .status-badge.deposit-payment_expected { color: var(--blue); background: var(--blue-bg); }
.status-badge.deposit-paid { color: #397052; background: #e7f2eb; }
.status-badge.deposit-suspended, .status-badge.deposit-cancelled { color: var(--muted); background: #edf0ed; }
.deposit-history { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.deposit-history-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.deposit-history-header strong { font-size: 11px; }
.deposit-history-item { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.deposit-history-item time { color: var(--muted-2); font-size: 11px; }
.deposit-history-item strong, .deposit-history-item span, .deposit-history-item small { display: block; }
.deposit-history-item strong { font-size: 11px; }
.deposit-history-item span, .deposit-history-item small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.deposit-form-section { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; }
.deposit-form-section > summary { min-height: 50px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; position: relative; list-style: none; cursor: pointer; user-select: none; }
.deposit-form-section > summary::-webkit-details-marker { display: none; }
.deposit-form-section > summary::after { margin-left: auto; color: var(--forest-2); content: "+"; font-size: 21px; font-weight: 500; line-height: 1; }
.deposit-form-section[open] > summary::after { content: "−"; }
.deposit-form-section > summary span { color: var(--ink); font-size: 11px; font-weight: 800; }
.deposit-form-section > summary small { color: var(--muted-2); font-size: 11px; }
.deposit-form-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 15px 14px; border-top: 1px solid var(--line); }

.integration-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(340px,.9fr); gap: 18px; }
.legal-entities-import-panel { margin-bottom: 18px; padding: 26px; }
.legal-entities-import-panel > p { max-width: 850px; margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.preview-only-badge { padding: 7px 10px; border-radius: 999px; color: var(--forest); background: var(--mint); font-size: 11px; font-weight: 800; white-space: nowrap; }
.legal-entities-import-controls { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(260px, 1.2fr); gap: 18px; align-items: center; }
.legal-entities-dropzone { min-height: 145px; margin: 0; }
.legal-entities-import-action { max-width: 430px; }
.legal-entities-import-action .file-help, .legal-entities-import-action .file-selection { text-align: left; }
.legal-entities-preview { margin-top: 22px; }
.legal-entities-summary { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 14px; }
.legal-entities-preview-table { min-width: 1120px; }
.legal-entities-preview-table th:nth-child(2), .legal-entities-preview-table td:nth-child(2) { width: 230px; }
.legal-entities-preview-table th:nth-child(3), .legal-entities-preview-table td:nth-child(3) { width: 155px; }
.legal-entities-preview-table th:nth-child(4), .legal-entities-preview-table td:nth-child(4) { width: 120px; }
.legal-entities-preview-table th:nth-child(5), .legal-entities-preview-table td:nth-child(5) { width: 110px; }
.legal-entities-preview-table .import-issue-list { color: #8a521f; }
.table-external-link { color: var(--forest-2); font-size: 11px; font-weight: 800; text-decoration: none; }
.table-external-link:hover { text-decoration: underline; }
.import-panel, .integration-guide { padding: 28px; }
.integration-icon { width: 47px; height: 47px; margin-bottom: 21px; border-radius: 14px; display: grid; place-items: center; color: var(--forest); background: var(--mint); font-size: 23px; }
.integration-grid p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.dropzone { min-height: 180px; margin: 23px 0 10px; border: 1.5px dashed #aab8b0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: #fafbf8; cursor: pointer; transition: .18s ease; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--forest-2); background: #f0f6f1; }
.dropzone:focus-within { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,88,70,.1); }
.dropzone.is-disabled { opacity: .6; cursor: wait; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.dropzone-icon { width: 36px; height: 36px; margin-bottom: 12px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--forest-2); }
.dropzone strong { color: var(--ink); font-size: 12px; }
.dropzone > span:last-child { margin-top: 5px; font-size: 11px; }
.file-help { margin: 0 0 8px; color: var(--muted-2); font-size: 11px !important; text-align: center; }
.file-selection { margin: 0 0 14px; color: var(--muted-2); font-size: 11px; text-align: center; }
.import-result { margin-top: 14px; padding: 13px; border-radius: 11px; color: var(--forest); background: var(--mint); font-size: 11px; line-height: 1.5; }
.steps-list { margin: 25px 0 24px; padding: 0; list-style: none; }
.steps-list li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps-list li > span { color: #c28b57; font-family: inherit; font-size: 20px; font-weight: 600; }
.steps-list strong { font-size: 11px; }
.steps-list p { margin: 6px 0 0; font-size: 11px; }
.download-stack { display: flex; flex-wrap: wrap; gap: 9px; }

.import-flow-stack { display: grid; gap: 18px; margin-top: 18px; }
.import-preview-panel, .import-result-panel { padding: 25px; }
.import-preview-panel > .panel-header, .import-history-panel > .panel-header { padding: 0 0 18px; }
.import-preview-panel h2, .import-result-panel h2, .import-history-panel h2 { margin: 4px 0 0; font-family: inherit; font-size: 25px; font-weight: 600; }
.import-preview-panel h2:focus, .import-result-panel h2:focus { outline: none; }
.import-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; }
.import-summary-card { min-height: 105px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.import-summary-card span, .import-summary-card small { display: block; color: var(--muted-2); font-size: 11px; }
.import-summary-card strong { display: block; margin: 7px 0 4px; font-size: 25px; }
.import-summary-actions { grid-column: 1 / -1; margin: 2px 0 0 !important; font-size: 11px !important; }
.import-filter-group { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 12px; }
.import-filter { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 700; }
.import-filter span { min-width: 20px; margin-left: 5px; padding: 2px 5px; border-radius: 999px; display: inline-block; color: var(--forest); background: var(--mint); }
.import-filter[aria-pressed="true"] { border-color: var(--forest-2); color: var(--forest); background: var(--mint); }
.import-preview-wrap { border: 1px solid var(--line); border-radius: 12px; }
.import-preview-table { min-width: 980px; }
.import-preview-table th:first-child, .import-preview-table td:first-child { width: 68px; text-align: center; }
.import-preview-table td:nth-child(2) { width: 250px; }
.import-preview-table td:nth-child(3) { width: 145px; }
.import-preview-table td:nth-child(5) { width: 135px; }
.import-preview-row.is-conflict { background: #fffaf2; }
.import-preview-row.is-invalid { background: #fff7f5; }
.import-status { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 999px; color: var(--muted); background: #edf0ed; font-size: 11px; font-weight: 800; white-space: nowrap; }
.import-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.import-status.is-ready { color: #397052; background: #e7f2eb; }
.import-status.is-unchanged { color: #53615b; background: #edf0ed; }
.import-status.is-conflict { color: #a75120; background: var(--orange-bg); }
.import-status.is-invalid { color: var(--red); background: var(--red-bg); }
.import-change-list, .import-issue-list { margin: 0; padding: 0; list-style: none; }
.import-change-list li, .import-issue-list li { padding: 4px 0; border-top: 1px solid rgba(0,0,0,.05); font-size: 11px; line-height: 1.4; }
.import-change-list li:first-child, .import-issue-list li:first-child { border-top: 0; }
.import-change-list strong, .import-change-list span { display: block; }
.import-change-list span { margin-top: 2px; color: var(--muted); }
.import-issue-list { color: var(--red); }
.muted-copy { color: var(--muted-2); font-size: 11px; }
.import-decision { font-size: 11px; }
.import-decision.is-apply { color: #397052; }
.import-decision.is-skip { color: var(--muted-2); }
.import-acknowledgement { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; padding: 13px 14px; border: 1px solid #e4c69f; border-radius: 11px; color: #80451f; background: #fffaf2; font-size: 11px; line-height: 1.45; }
.import-acknowledgement[hidden] { display: none; }
.import-acknowledgement input { margin-top: 1px; accent-color: var(--forest); }
.import-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 16px; }
.import-actions p { margin: 0 auto 0 0; font-size: 11px; }
.import-error { margin-top: 14px; padding: 13px 14px; border: 1px solid #ebc2ba; border-radius: 11px; color: var(--red); background: var(--red-bg); font-size: 11px; line-height: 1.45; }
.import-error:focus { outline: 3px solid rgba(169,56,43,.16); }
.import-error strong { display: block; }
.import-error ul { margin: 7px 0 0; padding-left: 18px; }
.import-result-panel > p { margin: 8px 0 18px; }
.import-result-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; }
.import-result-footer code { color: var(--muted-2); font-size: 11px; overflow-wrap: anywhere; }
.import-history-panel { padding: 24px; }
.import-history-list { border-top: 1px solid var(--line); }
.import-history-item { border-bottom: 1px solid var(--line); }
.import-history-item summary { display: grid; grid-template-columns: minmax(0,1fr) 90px 130px; align-items: center; gap: 14px; padding: 15px 5px; cursor: pointer; list-style-position: outside; }
.import-history-main strong, .import-history-main small, .import-history-count strong, .import-history-count small { display: block; }
.import-history-main small, .import-history-count small { margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.import-history-count strong { font-size: 17px; }
.import-history-status { justify-self: end; padding: 5px 7px; border-radius: 7px; color: #397052; background: #e7f2eb; font-size: 11px; font-weight: 800; }
.import-history-details { padding: 0 5px 15px 20px; }
.import-history-details p { margin: 4px 0; font-size: 11px; }
.import-history-details code { display: inline-block; margin-top: 5px; color: var(--muted-2); font-size: 11px; overflow-wrap: anywhere; }

.audit-panel { padding: 6px 24px; }
.access-intro { margin-bottom: 16px; padding: 20px 22px; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(420px, 1.4fr); gap: 24px; }
.access-intro > div:first-child, .access-legend { display: grid; gap: 6px; }
.access-intro strong { font-size: 13px; }
.access-intro span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.access-legend { grid-template-columns: 1fr 1fr; }
.access-panel { overflow: hidden; }
.access-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.access-table th { padding: 13px 16px; color: var(--muted-2); background: var(--surface-2); font-size: 11px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.access-table td { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; vertical-align: middle; }
.access-table td strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 11px; }
.access-role { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: var(--forest); background: #e7f0ea; font-weight: 800; }
.access-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.access-state::before { width: 7px; height: 7px; border-radius: 50%; background: #3b8a65; content: ""; }
.access-state.is-disabled { color: #9a5c59; }
.access-state.is-disabled::before { background: #c26d68; }
.access-edit { min-width: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--forest); background: var(--surface); cursor: pointer; font-weight: 900; }
.modal-compact { width: min(520px, calc(100vw - 30px)); }
.permission-hidden { display: none !important; }
.audit-item { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 17px 0; border-top: 1px solid var(--line); }
.audit-item:first-child { border-top: 0; }
.audit-symbol { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--forest-2); background: var(--mint); font-weight: 800; }
.audit-copy strong { display: block; font-size: 11px; }
.audit-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.audit-time { color: var(--muted-2); font-size: 11px; text-align: right; }

.modal { width: min(620px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); padding: 0; overflow: hidden; border: 0; border-radius: 19px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 90px rgba(13,28,22,.28); }
.modal-wide { width: min(790px, calc(100vw - 28px)); }
.modal::backdrop { background: rgba(13,29,23,.62); backdrop-filter: blur(4px); }
.modal form { min-height: 0; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); display: flex; flex-direction: column; overflow: hidden; }
.modal-header { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 25px 17px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 4px 0 0; font-family: inherit; font-size: 25px; font-weight: 600; }
.modal-close { width: 34px; height: 34px; flex: 0 0 34px; position: relative; display: block; padding: 0; border: 0; border-radius: 10px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 0; line-height: 1; transition: color .16s ease, background .16s ease; }
.modal-close::before, .modal-close::after { width: 14px; height: 2px; margin: -1px 0 0 -7px; position: absolute; top: 50%; left: 50%; border-radius: 99px; background: currentColor; content: ""; transform-origin: center; }
.modal-close::before { transform: rotate(45deg); }
.modal-close::after { transform: rotate(-45deg); }
.modal-close:hover { color: var(--forest); background: var(--mint); }
.modal-close:focus-visible { outline: 3px solid rgba(36, 88, 70, .2); outline-offset: 2px; }
.modal-body { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; align-content: start; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-span-2 { grid-column: 1 / -1; }
.field > span { font-size: 11px; font-weight: 800; }
.field b { color: var(--orange); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dcd9d0; border-radius: 10px; outline: none; color: var(--ink); background: #fbfaf7; }
.field input, .field select { min-height: 41px; padding: 0 11px; }
.field textarea { resize: vertical; padding: 10px 11px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,88,70,.08); }
.field small { color: var(--muted-2); font-size: 11px; line-height: 1.3; }
.field input[readonly] { color: #54615b; background: #f1f3f1; cursor: not-allowed; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea,
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(169, 56, 43, .08); }
.checkbox-field.is-invalid { color: var(--red); }
.checkbox-field.is-invalid input { outline: 2px solid rgba(169, 56, 43, .22); }
.field .field-error { color: var(--red); font-size: 11px; font-weight: 700; }
.form-error-summary { margin: 0 24px; padding: 10px 12px; border: 1px solid #ebc2ba; border-radius: 10px; color: var(--red); background: var(--red-bg); font-size: 11px; font-weight: 700; }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.checkbox-field input { accent-color: var(--forest); }
.modal-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 25px; border-top: 1px solid var(--line); background: #faf9f6; }
.modal-footer > div { display: flex; gap: 7px; }
.form-hint { color: var(--muted-2); font-size: 11px; }
.response-context { padding: 13px 25px; color: var(--muted); background: var(--mint); font-size: 11px; }
.automatic-number-note, .document-name-preview { padding: 10px 12px; border: 1px solid #dfe6e1; border-radius: 10px; color: var(--muted); background: #f6f8f6; font-size: 11px; line-height: 1.45; }
.document-name-preview strong { display: block; margin-top: 3px; color: var(--forest); overflow-wrap: anywhere; }
.requisition-control { padding: 11px 12px; border: 1px solid #ead8b7; border-radius: 10px; color: #76531f; background: #fff8e8; font-weight: 700; }
.requisition-control[hidden] { display: none; }
.incoming-dropzone { padding: 16px; border: 1.5px dashed #aab8b0; border-radius: 12px; background: #fafbf8; cursor: pointer; }
.incoming-dropzone:hover, .incoming-dropzone.is-dragging { border-color: var(--forest-2); background: #f0f6f1; }
.incoming-dropzone > strong { color: var(--forest-2); font-size: 11px; }
.attachment-dropzone { min-height: 108px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 7px 13px; padding: 15px 16px; border: 1.5px dashed #aab8b0; border-radius: 13px; color: var(--muted); background: #fafbf8; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.attachment-dropzone:hover, .attachment-dropzone.is-dragging, .attachment-dropzone.has-files { border-color: var(--forest-2); background: #f3f8f4; }
.attachment-dropzone:focus-visible, .attachment-dropzone:focus-within { outline: 0; border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36, 88, 70, .1); }
.attachment-input { width: 1px !important; height: 1px; padding: 0 !important; position: absolute; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0 !important; opacity: 0; white-space: nowrap; pointer-events: none; }
.attachment-dropzone-icon { width: 42px; height: 42px; grid-row: 1 / 3; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--forest-2); }
.attachment-dropzone-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.attachment-dropzone-copy { min-width: 0; }
.attachment-dropzone-copy strong, .attachment-dropzone-copy small { display: block; }
.attachment-dropzone-copy strong { color: var(--ink); font-size: 11px; }
.attachment-dropzone-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.attachment-picker { min-height: 36px; padding: 0 13px; border: 1px solid var(--forest); border-radius: 9px; color: #fff; background: var(--forest); box-shadow: 0 6px 14px rgba(23, 60, 49, .14); cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.attachment-picker:hover { background: var(--forest-2); }
.attachment-picker:focus-visible { outline: 3px solid rgba(36, 88, 70, .2); outline-offset: 2px; }
.attachment-dropzone-help { min-width: 0; grid-column: 2 / -1; color: var(--muted-2); font-size: 11px; line-height: 1.4; }
.attachment-selection { display: grid; gap: 7px; padding-top: 3px; }
.attachment-selection[hidden] { display: none; }
.attachment-selection-summary { color: var(--muted); font-size: 11px; font-weight: 700; }
.attachment-file { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 9px; border: 1px solid #dfe6e1; border-radius: 10px; background: #f6f8f6; }
.attachment-file-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--forest-2); background: var(--mint); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.attachment-file-copy { min-width: 0; }
.attachment-file-copy strong, .attachment-file-copy small { display: block; }
.attachment-file-copy strong { overflow: hidden; color: var(--forest); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.attachment-file-copy small { margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.attachment-file-remove { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 700; }
.attachment-file-remove:hover { border-color: #d9b5b2; color: var(--red); background: var(--red-bg); }
.document-match-note { padding: 10px 12px; border: 1px solid #bfd7c7; border-radius: 10px; color: var(--forest); background: #edf6ef; font-size: 11px; line-height: 1.45; }
.requisitions-table { min-width: 1050px; }
.document-link { display: inline-flex; margin-top: 4px; color: #176692; font-size: 11px; font-weight: 800; text-decoration: none; }
.document-link:hover { text-decoration: underline; }

.pwa-install-banner { width: min(620px, calc(100vw - 28px)); min-height: 82px; position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; grid-template-columns: 49px minmax(0, 1fr) auto 30px; align-items: center; gap: 12px; padding: 14px; border: 1px solid rgba(225,222,212,.94); border-radius: 17px; color: var(--ink); background: rgba(255,254,250,.98); box-shadow: 0 18px 55px rgba(13,29,23,.2); backdrop-filter: blur(12px); }
.pwa-install-banner[hidden] { display: none; }
.pwa-install-mark { width: 49px; height: 49px; border-radius: 13px; display: grid; place-items: center; color: var(--forest); background: #e5a86e; font-size: 16px; font-weight: 900; letter-spacing: -.04em; }
.pwa-install-copy { min-width: 0; }
.pwa-install-copy strong, .pwa-install-copy span { display: block; }
.pwa-install-copy strong { margin-bottom: 4px; font-size: 12px; }
.pwa-install-copy span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.pwa-install-banner .button { min-height: 39px; white-space: nowrap; }
.pwa-install-close { width: 30px; height: 30px; border: 0; border-radius: 9px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 19px; line-height: 1; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 270px; max-width: 380px; padding: 14px 16px; border-radius: 12px; color: #fff; background: var(--forest); box-shadow: 0 15px 35px rgba(13,29,23,.25); font-size: 11px; animation: toast-in .2s ease; }
.toast.error { background: #8b3939; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.has-open-dialog { overflow: hidden; overscroll-behavior: none; }
.sr-only { width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; position: absolute; top: 0; left: 0; border: 0; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
.sidebar-scrim { display: none; }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .my-day-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(140px, .6fr)); }
  .filters .button { display: none; }
  .case-filters { grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, .55fr)); }
  .case-filters .button { grid-column: 1 / -1; justify-self: end; }
  .import-summary-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .deposit-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { width: 250px; position: fixed; left: 0; transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.is-open { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 19; background: rgba(10,25,19,.45); }
  .sidebar-scrim.is-visible { display: block; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar { padding: 15px 18px; }
  .page-heading h1 { font-size: 21px; }
  .topbar-actions .button { display: none; }
  .auth-user-copy, .auth-user-action:first-of-type { display: none; }
  .content { padding: 22px 18px max(16px, env(safe-area-inset-bottom)); }
  .my-day-header { grid-template-columns: 1fr; }
  .pilot-badge { grid-column: auto; margin-top: -9px; }
  .my-day-item { grid-template-columns: 7px minmax(0, 1fr); }
  .my-day-item-side { min-width: 0; grid-column: 2; align-items: flex-start; }
  .my-day-item-actions { justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; padding: 30px 26px; }
  .hero-visual { display: none; }
  .hero h2 { font-size: 34px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .debtor-scope-panel { align-items: stretch; flex-direction: column; }
  .debtor-scope-panel > span { text-align: left; }
  .debtor-scope-tabs { width: 100%; overflow-x: auto; }
  .debtor-scope-tab { flex: 1 0 auto; justify-content: center; }
  .search-field { grid-column: 1 / -1; }
  .case-filters { grid-template-columns: 1fr 1fr; }
  .case-filters .search-field { grid-column: 1 / -1; }
  .case-filters .button { grid-column: auto; }
  .request-case-group-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .request-case-metrics { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; padding-left: 39px; }
  .request-case-actions { grid-column: 2; grid-row: 1; }
  .cases-grid, .integration-grid, .legal-entities-import-controls { grid-template-columns: 1fr; }
  .legal-entities-import-action { max-width: none; }
  .import-history-item summary { grid-template-columns: minmax(0,1fr) 75px 110px; }
  .access-intro { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .request-kit-grid { grid-template-columns: 1fr; }
  .bank-kit-toolbar { align-items: stretch; flex-direction: column; }
  .bank-kit-toolbar > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .bank-kit-item { grid-template-columns: auto minmax(0, 1fr); }
  .bank-kit-kind { grid-column: 2; }
  .bank-kit-add { grid-template-columns: 1fr; }
  .related-persons-header { align-items: flex-start; flex-direction: column; }
  .case-sensitive-note { display: grid; }
  .environment-banner { min-height: 38px; padding-inline: 10px; gap: 6px; flex-direction: column; font-size: 11px; }
  .environment-banner strong { font-size: 11px; }
  body.is-local-environment .app-shell { min-height: calc(100vh - 38px); padding-top: 38px; }
  body.is-local-environment .sidebar { top: 38px; height: calc(100vh - 38px); }
  body.is-local-environment .topbar { top: 38px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-value { font-size: 26px; }
  .my-day-header { padding: 20px; }
  .my-day-intro h2 { font-size: 24px; }
  .my-day-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .my-day-toolbar { align-items: flex-start; flex-direction: column; }
  .my-day-filter-stack, .debtor-scope-tabs.is-compact { width: 100%; }
  .debtor-scope-tabs.is-compact .debtor-scope-tab { flex: 1 0 auto; }
  .my-day-filters { width: 100%; }
  .my-day-filters button { flex: 1 1 44%; }
  .my-day-item { padding-right: 14px; gap: 12px; }
  .my-day-item-copy h3 { white-space: normal; }
  .my-day-item-actions .button { flex: 1 1 auto; }
  .section-toolbar { align-items: flex-end; }
  .section-toolbar h2 { font-size: 26px; }
  #view-access .section-toolbar { align-items: stretch; flex-direction: column; }
  #view-access .section-toolbar .button { width: 100%; }
  .access-intro { padding: 17px; }
  .access-legend { grid-template-columns: 1fr; }
  .access-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .access-table { min-width: 0; border-collapse: separate; }
  .access-table thead { display: none; }
  .access-table, .access-table tbody, .access-table tr, .access-table td { width: 100%; display: block; }
  .access-table tbody { display: grid; gap: 10px; }
  .access-table tr { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .access-table td { padding: 5px 0; border: 0; }
  .access-table td:last-child { padding-top: 10px; }
  .access-edit { width: 100%; }
  #view-cases .section-toolbar { align-items: stretch; flex-direction: column; }
  .cases-toolbar-actions { width: 100%; justify-content: space-between; }
  .view-switcher { flex: 1 1 auto; }
  .view-switcher button { flex: 1 1 50%; }
  .toolbar-actions .button-secondary { display: none; }
  .filters { grid-template-columns: 1fr; }
  #view-requests .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  #view-requests .table-wrap { overflow: visible; }
  .requests-table { min-width: 0; border-collapse: separate; }
  .requests-table thead { display: none; }
  .requests-table, .requests-table tbody, .requests-table tr, .requests-table td { width: 100%; display: block; }
  .requests-table tbody { display: grid; gap: 10px; }
  .requests-table .request-case-group-row { overflow: hidden; border: 1px solid #dbe6de; border-radius: 14px; background: #eef3ef; }
  .requests-table .request-case-group-row td { padding: 0; border: 0; }
  .request-case-group-heading { display: flex; align-items: stretch; flex-direction: column; gap: 10px; padding: 13px; }
  .request-case-toggle { width: 100%; }
  .request-case-title strong, .request-case-title span { white-space: normal; overflow-wrap: anywhere; }
  .request-case-title strong { font-size: 17px; }
  .request-case-metrics { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
  .request-case-metrics > span { min-width: 0; white-space: normal; }
  .request-case-metrics .request-case-filtered { grid-column: 1 / -1; }
  .request-case-actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
  .request-case-action { min-width: 0; padding-inline: 6px; }
  .request-case-attention { padding: 0 13px 12px; }
  .attachment-dropzone { grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .attachment-dropzone-icon { grid-row: 1 / 3; }
  .attachment-picker { width: 100%; grid-column: 1 / -1; grid-row: 3; }
  .attachment-dropzone-help { grid-column: 1 / -1; grid-row: 4; }
  .attachment-file { grid-template-columns: 32px minmax(0, 1fr); }
  .attachment-file-remove { grid-column: 1 / -1; width: 100%; }
  .requests-table .request-item-row { padding: 16px; overflow: hidden; border: 1px solid rgba(225,222,212,.9); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 22px rgba(41,52,47,.04); }
  .requests-table .request-item-row td { min-width: 0; padding: 7px 0; border: 0; }
  .requests-table .request-item-row td::before { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .requests-table .request-item-row td:nth-child(1)::before { content: "Должник и ведомство"; }
  .requests-table .request-item-row td:nth-child(2)::before { content: "Код и запрос"; }
  .requests-table .request-item-row td:nth-child(3)::before { content: "Отправка"; }
  .requests-table .request-item-row td:nth-child(4)::before { content: "Контрольные даты"; }
  .requests-table .request-item-row td:nth-child(5)::before { content: "Статус"; }
  .requests-table .request-item-row td:nth-child(6)::before { content: "Ответственный"; }
  .requests-table .request-item-row td:nth-child(7)::before { content: "Действия"; }
  .requests-table .cell-main { max-width: none; }
  .requests-table .cell-main strong, .requests-table .cell-main span { white-space: normal; overflow-wrap: anywhere; }
  .requests-table .row-actions { justify-content: flex-start; }
  .case-filters { grid-template-columns: 1fr; }
  .case-filters .search-field, .case-filters .button { grid-column: auto; }
  .case-filters .button { width: 100%; }
  .case-create-request { padding-inline: 9px; font-size: 11px; }
  .case-owner { align-items: flex-start; flex-wrap: wrap; }
  .case-owner > .case-card-actions { width: calc(100% - 47px); margin-left: 47px; }
  .deposit-summary-grid { grid-template-columns: 1fr 1fr; }
  #view-deposits .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  #view-deposits .table-wrap { overflow: visible; }
  .deposits-table { min-width: 0; border-collapse: separate; }
  .deposits-table thead { display: none; }
  .deposits-table, .deposits-table tbody, .deposits-table tr, .deposits-table td { width: 100%; display: block; }
  .deposits-table tbody { display: grid; gap: 10px; }
  .deposits-table tr { padding: 16px; overflow: hidden; border: 1px solid rgba(225,222,212,.9); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 22px rgba(41,52,47,.04); }
  .deposits-table tr.deposit-attention-row { border-color: #ead8b7; background: #fffaf2; }
  .deposits-table td { min-width: 0; padding: 7px 0; border: 0; }
  .deposits-table td::before { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .deposits-table td:nth-child(1)::before { content: "Дело и вид выплаты"; }
  .deposits-table td:nth-child(2)::before { content: "Сумма"; }
  .deposits-table td:nth-child(3)::before { content: "Стадия"; }
  .deposits-table td:nth-child(4)::before { content: "Следующее действие"; }
  .deposits-table td:nth-child(5)::before { content: "Ответственный"; }
  .deposits-table td:nth-child(6)::before { content: "Действия"; }
  .deposits-table .cell-main { max-width: none; }
  .deposits-table .cell-main strong, .deposits-table .cell-main span { white-space: normal; overflow-wrap: anywhere; }
  .deposits-table .row-actions { justify-content: flex-start; }
  .deposits-table .deposit-empty-row { padding: 0; }
  .deposits-table .deposit-empty-row td { padding: 0; }
  .deposits-table .deposit-empty-row td::before { display: none; }
  .deposit-form-section-grid { grid-template-columns: minmax(0, 1fr); }
  .deposit-form-section-grid .field-span-2 { grid-column: auto; }
  .search-field { grid-column: auto; }
  .priority-item { grid-template-columns: 7px minmax(0,1fr); }
  .priority-due { grid-column: 2; text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .modal, .modal-wide { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .modal form { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; }
  .modal-header { padding: max(14px, env(safe-area-inset-top)) 16px 13px; }
  .modal-header h2 { font-size: 21px; }
  .modal-body { padding: 15px 16px; }
  .modal-footer { align-items: stretch; flex-direction: column; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .modal-footer > span { display: none; }
  .modal-footer > div { width: 100%; }
  .modal-footer > div .button { flex: 1 1 0; }
  .response-context { padding: 11px 16px; }
  .form-hint { display: none; }
  .cases-grid { grid-template-columns: 1fr; }
  .cases-list-view .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .cases-list-view .table-wrap { overflow: visible; }
  .cases-list-table { min-width: 0; border-collapse: separate; }
  .cases-list-table thead { display: none; }
  .cases-list-table, .cases-list-table tbody, .cases-list-table tr, .cases-list-table td { width: 100%; display: block; }
  .cases-list-table tbody { display: grid; gap: 10px; }
  .cases-list-table tr { padding: 16px; overflow: hidden; border: 1px solid rgba(225,222,212,.9); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 22px rgba(41,52,47,.04); }
  .cases-list-table td { min-width: 0; padding: 7px 0; border: 0; }
  .cases-list-table td::before { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .cases-list-table td:nth-child(1)::before { content: "Должник"; }
  .cases-list-table td:nth-child(2)::before { content: "Дело"; }
  .cases-list-table td:nth-child(3)::before { content: "Ответственные"; }
  .cases-list-table td:nth-child(4)::before { content: "Запросы"; }
  .cases-list-table td:nth-child(5)::before { content: "Ответы"; }
  .cases-list-table td:nth-child(6)::before { content: "Просрочено"; }
  .cases-list-table td:nth-child(7)::before { content: "Депозиты"; }
  .cases-list-table td:nth-child(8)::before { content: "Действия"; }
  .cases-list-table .cell-main, .case-list-debtor { max-width: none; }
  .cases-list-table .cell-main strong, .cases-list-table .cell-main span { white-space: normal; overflow-wrap: anywhere; }
  .cases-list-table .case-list-metric { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .cases-list-table .case-list-metric span { margin: 0; }
  .case-list-actions { min-width: 0; justify-content: flex-start; }
  .import-preview-panel, .import-result-panel, .import-history-panel { padding: 18px; }
  .import-summary-grid { grid-template-columns: 1fr 1fr; }
  .import-summary-card { min-height: 95px; }
  .import-actions, .import-result-footer { align-items: stretch; flex-direction: column; }
  .import-actions .button, .import-result-footer .button { width: 100%; }
  .import-history-item summary { grid-template-columns: minmax(0,1fr) auto; }
  .import-history-status { grid-column: 1 / -1; justify-self: start; }
  .toast-region { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; }
  .pwa-install-banner { width: auto; min-height: 0; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); grid-template-columns: 43px minmax(0, 1fr) 30px; gap: 10px; padding: 12px; border-radius: 15px; }
  .pwa-install-mark { width: 43px; height: 43px; border-radius: 12px; font-size: 14px; }
  .pwa-install-copy strong { font-size: 11px; }
  .pwa-install-copy span { font-size: 11px; }
  .pwa-install-banner .button { grid-column: 1 / -1; width: 100%; }
  .pwa-install-close { grid-column: 3; grid-row: 1; }
}

@media (display-mode: standalone) {
  .pwa-install-banner, .pwa-sidebar-install { display: none !important; }
}
