@font-face {
  font-family: "PT Astra Serif";
  src: url("fonts/PT-Astra-Serif_Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PT Astra Serif";
  src: url("fonts/PT-Astra-Serif_Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* -------------------- */
  /*   DESIGN TOKENS v2   */
  /* -------------------- */

  /* Цвета фонов */
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-2: #f8fbfe;
  --surface-3: #edf5fb;

  /* Границы */
  --border: #d8e4ee;
  --border-strong: #a9c7dd;

  /* Акцентные */
  --accent: #0b5fa5;
  --accent-light: #1678bf;
  --accent-hover: #064c86;
  --navy: #123a5d;

  /* Текст */
  --text: #223447;
  --muted: #566e82;
  --dim: #7e95a8;

  /* Семантические цвета */
  --gold: #d8a900;
  --green: #177245;
  --yellow: #d8991f;
  --danger: #c0392b;
  --success: #177245;
  --warning: #d8991f;
  --info: #0769a8;

  /* Тени */
  --shadow: 0 10px 28px rgba(32, 78, 119, 0.08);
  --shadow-strong: 0 18px 46px rgba(32, 78, 119, 0.14);
  --shadow-sm: 0 2px 8px rgba(32, 78, 119, 0.07);

  /* Размеры */
  --workspace-width: 1440px;
  --header-height: 76px;
  --base-font-size: 14px;

  /* Скругления */
  --card-radius: 6px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Отступы */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Типографика */
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;

  /* Шрифт */
  --interface-font: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--interface-font);
  font-size: var(--base-font-size);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  padding: 30px 16px 40px;
}

.login-wrap {
  width: min(980px, 100%);
  margin: 0 auto;
}

.login-head {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 48px;
  background: linear-gradient(#0b82c7 0%, #0769a8 100%);
  box-shadow: 0 16px 34px rgba(24, 77, 120, 0.2);
}

.brand-mark,
.header-mark {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 80px;
  height: 56px;
}

.header-mark {
  width: 72px;
  height: 50px;
}

.brand-mark-image,
.header-mark-image {
  object-fit: contain;
}

.brand-mark-image::before,
.brand-mark-image::after,
.header-mark-image::before,
.header-mark-image::after {
  content: none;
}

.header-titlebox {
  min-width: 0;
}

.brand-mark::before,
.header-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  clip-path: polygon(50% 0, 58% 27%, 98% 31%, 65% 45%, 78% 100%, 50% 68%, 22% 100%, 35% 45%, 2% 31%, 42% 27%);
}

.brand-mark::after,
.header-mark::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 18px;
  background: var(--gold);
  clip-path: polygon(0 50%, 32% 20%, 50% 48%, 68% 20%, 100% 50%, 68% 80%, 50% 52%, 32% 80%);
}

.brand-mark span,
.header-mark span {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #0f80ba;
}

.brand-kicker,
.header-kicker {
  color: #cbefff;
  font-size: 12px;
  font-weight: 700;
}

.login-head h1,
.header-title {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 47, 78, 0.22);
  overflow-wrap: anywhere;
}

.login-split {
  width: min(780px, 100%);
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid #bfd3e5;
  border-radius: 4px;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.login-col {
  min-height: 317px;
  padding: 19px 22px 22px;
}

.login-col + .login-col {
  border-left: 1px solid #bfd3e5;
}

.login-col h2,
.panel h2,
.preview-panel h2 {
  margin: 0 0 34px;
  color: #214969;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 35px;
  padding: 8px 12px;
  border: 1px solid #c8d8e8;
  border-radius: 3px;
  outline: none;
  background: #ffffff;
  color: #2a4052;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--border-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(11, 130, 199, 0.16);
}

.login-btn,
.btn.primary {
  border: 1px solid #075f9a;
  border-radius: 3px;
  background: linear-gradient(#1084c6 0%, #086aa5 100%);
  color: #ffffff;
  font-weight: 700;
}

.login-btn {
  width: 100%;
  height: 38px;
  margin: 4px 0 14px;
}

.login-btn:hover,
.btn.primary:hover {
  background: linear-gradient(#1692d4 0%, #075f9a 100%);
}

.link-button {
  border: 0;
  background: none;
  color: #0878bd;
  padding: 0;
  font-size: 12px;
  text-decoration: underline;
}

.login-warning p {
  max-width: 330px;
  margin: 0 0 16px;
  color: #365d7b;
  font-size: 13px;
  line-height: 1.58;
}

.login-disclaimer {
  width: min(680px, 100%);
  margin: 18px auto 0;
  padding: 12px 24px;
  border: 1px solid #e8c84d;
  border-radius: 5px;
  background: linear-gradient(#fffce6, #fff8cf);
  color: #7a6200;
  font-size: 12px;
  text-align: center;
}

.register-panel {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 28px 34px 30px;
  border: 1px solid #bfd3e5;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: var(--shadow-strong);
}

.register-panel h2 {
  margin: 0 0 4px;
  color: #223447;
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  text-transform: none;
}

.register-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dir-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.register-panel .field {
  margin-bottom: 13px;
}

.register-panel .field span {
  color: #8193a4;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.register-panel .field input {
  height: 34px;
  font-size: 13px;
}

.register-submit {
  width: 100%;
  height: 39px;
  margin: 10px 0 14px;
  border: 1px solid #075f9a;
  border-radius: 3px;
  background: linear-gradient(#1084c6 0%, #086aa5 100%);
  color: #ffffff;
  font-weight: 800;
}

.register-submit:hover {
  background: linear-gradient(#1692d4 0%, #075f9a 100%);
}

.register-back {
  border: 0;
  background: none;
  color: #0878bd;
  padding: 0;
  font-size: 12px;
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
  padding: var(--header-height) 0 0;
}

.main-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  background: linear-gradient(180deg, #0d68b0 0%, #07599b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(6, 54, 97, 0.18);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  overflow: hidden;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mobile-menu {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: transparent;
  place-items: center;
}

.mobile-menu span {
  width: 17px;
  height: 2px;
  display: block;
  margin: 3px auto;
  background: #ffffff;
}

.notification-button {
  position: relative;
  font-size: 12px;
  color: #1678bf;
}

.notification-button b {
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 10px;
  background: #c73939;
  color: #fff;
  font: 700 11px/18px Arial, sans-serif;
  text-align: center;
}

.notification-button b:empty,
.notification-button b[data-count="0"] {
  display: none;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  text-align: left;
}

.notification-item.is-unread {
  border-left: 4px solid #1678bf;
  background: #f4faff;
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  min-width: 0;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 600;
}

.header-status strong {
  color: #ffffff;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #90d69f;
  box-shadow: 0 0 0 2px rgba(144, 214, 159, 0.25);
}

.icon-btn,
.user-chip {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-btn {
  width: 38px;
  font-size: 17px;
}

.icon-btn-wide {
  width: auto;
  min-width: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 13px;
}

.icon-btn-search .icon-text {
  display: inline-block;
}

.icon-btn-search {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.icon-btn-search .icon-text {
  display: none;
}

.icon-btn-logout {
  width: 38px;
  padding: 0;
}

.top-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: currentColor;
}

.top-icon.search::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.top-icon.search::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 6px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: right center;
}

.top-icon.power::before {
  content: "";
  position: absolute;
  inset: 1px 3px 1px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
}

.top-icon.power::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  width: 2px;
  height: 9px;
  background: currentColor;
  border-radius: 2px;
}

.user-chip {
  padding: 0 13px;
  font-size: 13px;
}

.section-tabs {
  height: 40px;
  display: flex;
  align-items: stretch;
  padding-left: 14px;
  background: rgba(255, 255, 255, 0.45);
  overflow-x: auto;
}

.section-tab {
  min-width: 90px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: #294b64;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.section-tab.active {
  background: linear-gradient(#0f88c9, #0870aa);
  color: #ffffff;
}

.workspace {
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  margin: 0;
}

.workspace-body {
  min-width: 0;
  padding: 16px 22px 24px;
}

.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 58px 16px 18px;
  border-right: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 4px 0 20px rgba(32, 78, 119, 0.04);
}

.sidebar-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #405368;
  padding: 0 12px;
  text-align: left;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.sidebar-link span {
  min-width: 0;
}

.sidebar-link i,
.sidebar-link .sidebar-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px;
  background: #eef6fc;
  color: #0b5fa5;
}

.sidebar-link:hover {
  background: #f0f6fb;
  color: #0b5fa5;
}

.sidebar-link.active {
  background: #e8f3fd;
  color: #07599b;
  box-shadow: inset 3px 0 0 #1678bf;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
  background: #ffffff;
}

.admin-only {
  display: none !important;
}

.sidebar-link.admin-only:not(.is-hidden) {
  display: flex !important;
}

.quick-link.admin-only:not(.is-hidden) {
  display: block !important;
}

.sidebar-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: currentColor;
}

.sidebar-icon::before,
.sidebar-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.sidebar-icon.home::before {
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 11px;
  border-top: 0;
  border-radius: 2px;
}

.sidebar-icon.home::after {
  left: 5px;
  top: 2px;
  width: 11px;
  height: 11px;
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.sidebar-icon.grid::before {
  inset: 3px;
  border: 0;
  background:
    linear-gradient(currentColor 0 0) left top / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) right top / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) left bottom / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) right bottom / 6px 6px no-repeat;
}

.sidebar-icon.doc::before {
  inset: 2px 5px 2px 4px;
  border-radius: 2px;
}

.sidebar-icon.doc::after {
  left: 8px;
  right: 7px;
  top: 8px;
  height: 7px;
  border-width: 2px 0;
}

.sidebar-icon.chart::before {
  left: 4px;
  bottom: 3px;
  width: 3px;
  height: 9px;
  box-shadow: 7px -4px 0 -2px currentColor, 14px -9px 0 -2px currentColor;
}

.sidebar-icon.gear::before {
  inset: 3px;
  border-radius: 50%;
}

.sidebar-icon.gear::after {
  left: 9px;
  top: 0;
  width: 0;
  height: 22px;
  border-width: 0 0 0 2px;
  transform: rotate(45deg);
}

.sidebar-icon.users::before {
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border-width: 2px;
  box-shadow: 6px 0 0 -1px currentColor, 9px 0 0 -1px currentColor;
}

.sidebar-icon.users::after {
  left: 5px;
  bottom: 3px;
  width: 12px;
  height: 8px;
  border-width: 2px 0 0;
  border-radius: 8px 8px 0 0;
}

.sidebar-link[data-view="sudis"] .sidebar-icon,
.sidebar-link[data-view="admin"] .sidebar-icon {
  background: #eaf4e9;
  color: #177245;
}

.sidebar-release-link {
  margin-top: auto;
}

.sidebar-release-badge {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #177245;
  color: #fff;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.release-home-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  background: linear-gradient(120deg, #f8fcff 0%, #e7f5ff 62%, #d6f1e7 100%);
  border-color: #b9d9ea;
}

.release-home-banner h2 {
  margin: 8px 0 3px;
  color: var(--navy);
}

.release-home-banner p { margin: 0; color: var(--muted); }

.release-page {
  display: grid;
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.release-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: 330px;
  padding: clamp(28px, 5vw, 68px);
  overflow: hidden;
  border: 1px solid #9bc5df;
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 18%, rgba(80, 187, 220, .28), transparent 34%),
    linear-gradient(135deg, #f9fcff 0%, #eaf5fc 58%, #d9f0f7 100%);
  box-shadow: var(--shadow);
}

.release-hero::after {
  content: "3.2";
  position: absolute;
  right: -18px;
  bottom: -70px;
  color: rgba(11, 95, 165, .065);
  font-size: clamp(150px, 25vw, 340px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.release-hero-copy,
.release-summary { position: relative; z-index: 1; }

.release-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid #9ac5dd;
  border-radius: 999px;
  background: rgba(255, 255, 255, .76);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.release-hero h1 {
  margin: 18px 0 12px;
  color: #123a5d;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.release-hero h1 strong { color: var(--accent); }
.release-hero-copy > p { max-width: 760px; margin: 0; color: #48677f; font-size: clamp(15px, 1.5vw, 20px); }
.release-hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }

.release-summary {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(125, 176, 207, .8);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(10px);
}

.release-summary div {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-bottom: 1px solid var(--border);
}

.release-summary div:last-child { border-bottom: 0; }
.release-summary strong { color: var(--accent); font-size: 30px; line-height: 1; }
.release-summary span { color: var(--muted); font-weight: 700; }

.release-flow-panel {
  display: grid;
  grid-template-columns: minmax(230px, .55fr) minmax(0, 1.45fr);
  align-items: center;
  gap: 28px;
  padding: 22px;
}

.release-flow-panel h2 { margin: 4px 0; color: var(--navy); }
.release-flow { display: grid; grid-template-columns: repeat(6, minmax(92px, 1fr)); overflow-x: auto; padding: 12px 4px; }
.release-flow span { position: relative; display: grid; justify-items: center; gap: 7px; min-width: 92px; color: var(--muted); font-size: 11px; text-align: center; }
.release-flow span::after { content: ""; position: absolute; top: 17px; left: 60%; width: 80%; height: 2px; background: #9bc7df; }
.release-flow span:last-child::after { display: none; }
.release-flow i { z-index: 1; display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-weight: 800; box-shadow: 0 0 0 5px #eaf5fb; }
.release-flow b { color: #35536c; }

.release-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 2px 0;
}
.release-section-heading h2 { margin: 3px 0 0; color: var(--navy); font-size: 27px; }
.release-section-heading p { margin: 0; color: var(--muted); }

.release-change-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.release-change-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.release-change-card:hover { transform: translateY(-2px); border-color: #8ebcd8; box-shadow: var(--shadow); }
.release-change-number { color: #90b4ca; font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.release-change-card h3 { margin: 0 0 7px; color: var(--navy); font-size: 19px; }
.release-change-card p { margin: 0; color: var(--muted); }
.release-card-link { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; }
.release-card-link:hover { color: var(--accent-hover); text-decoration: underline; }

.release-notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.release-note { padding: 22px; border-left: 4px solid var(--accent); }
.release-note.future { border-left-color: var(--yellow); }
.release-note h2 { margin: 10px 0 6px; color: var(--navy); }
.release-note p { margin: 0; color: var(--muted); }

.system-banner {
  min-height: 50px;
  display: flex;
  align-items: center;
  margin: 0 auto 10px;
  max-width: var(--workspace-width);
  border: 1px solid #d8e7f2;
  border-radius: 6px;
  background: #f5fbff;
  color: #2f5571;
  padding: 0 44px 0 58px;
  font-size: 13px;
  position: relative;
}

.system-banner::before {
  content: "i";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid #8bb7d4;
  border-radius: 50%;
  color: #2d719d;
  font-weight: 800;
}

.system-banner-close {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4d6c82;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.system-banner-close:hover,
.system-banner-close:focus-visible {
  background: #e4f1f9;
  color: #174f75;
  outline: 2px solid #7db5d8;
  outline-offset: 1px;
}

.toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--workspace-width);
  margin: 0 auto 12px;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.back-btn {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  color: #1f4a6a;
  padding: 4px 10px;
  font-size: 12px;
}

.breadcrumb {
  color: #405c74;
  font-size: 13px;
}

.page-view {
  max-width: var(--workspace-width);
  margin: 0 auto;
  padding: 18px 18px 20px;
  border: 1px solid #e0e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  animation: fadeIn 0.16s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.service-grid-bottom {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  min-height: 156px;
  display: grid;
  grid-template-columns: 1fr 18px;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  padding: 20px 18px 16px;
  text-align: left;
  box-shadow: 0 3px 10px rgba(32, 78, 119, 0.05);
  position: relative;
}

.service-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 18px rgba(32, 78, 119, 0.11);
  transform: translateY(-1px);
}

.service-card strong {
  display: block;
  margin-bottom: 5px;
  color: #124f7d;
  font-size: 16px;
  font-weight: 800;
}

.service-card small {
  display: block;
  max-width: 170px;
  color: #5b7286;
  font-size: 12px;
  line-height: 1.32;
}

.service-card::after {
  content: "›";
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  color: #5d8bad;
  font-size: 26px;
  font-weight: 300;
}

.service-card > span {
  min-width: 0;
}

.icon {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  opacity: 1;
  color: #0b5fa5;
  border-radius: 8px;
  background: #eef6fc;
}

.service-card > span {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
}

.icon::before,
.icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.icon.mail::before {
  inset: 8px 2px 9px;
  border-radius: 4px;
}

.icon.mail::after {
  inset: 12px 6px auto;
  height: 17px;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.icon.doc::before {
  inset: 2px 7px 2px 9px;
  border-radius: 3px;
}

.icon.doc::after {
  top: 8px;
  right: 7px;
  width: 12px;
  height: 12px;
  border-width: 2px 2px 0 0;
}

.icon.lock::before {
  left: 7px;
  right: 7px;
  bottom: 7px;
  height: 24px;
  border-radius: 4px;
}

.icon.lock::after {
  left: 13px;
  top: 2px;
  width: 16px;
  height: 21px;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.icon.shield::before {
  inset: 3px 7px;
  border-radius: 5px;
  clip-path: polygon(50% 0, 100% 20%, 88% 70%, 50% 100%, 12% 70%, 0 20%);
}

.icon.shield::after {
  left: 15px;
  top: 15px;
  width: 12px;
  height: 7px;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.icon.pen::before {
  top: 5px;
  left: 17px;
  width: 10px;
  height: 33px;
  transform: rotate(35deg);
}

.icon.chart::before {
  left: 7px;
  bottom: 6px;
  width: 7px;
  height: 17px;
}

.icon.chart::after {
  right: 7px;
  bottom: 6px;
  width: 7px;
  height: 31px;
}

.icon.helmet::before {
  left: 7px;
  right: 7px;
  top: 14px;
  height: 18px;
  border-radius: 24px 24px 8px 8px;
}

.icon.helmet::after {
  left: 11px;
  right: 11px;
  top: 9px;
  height: 6px;
  border-width: 2px 0 0;
}

.icon.db::before {
  left: 8px;
  right: 8px;
  top: 6px;
  height: 30px;
  border-radius: 50% / 18%;
}

.icon.db::after {
  left: 8px;
  right: 8px;
  top: 17px;
  height: 9px;
  border-width: 2px 0 0;
  border-radius: 50%;
}

.icon.form::before {
  inset: 4px 9px 4px 6px;
  border-radius: 3px;
}

.icon.form::after {
  right: 5px;
  top: 9px;
  width: 15px;
  height: 11px;
  border-width: 2px 2px 0 0;
}

.upload-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #eef6fc;
  color: #0b5fa5;
  font-size: 0;
}

.upload-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 10px;
  height: 14px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.upload-icon::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  width: 10px;
  height: 16px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.award-placeholder-icon {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  color: #0b5fa5;
}

.award-placeholder-icon::before,
.award-placeholder-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.award-placeholder-icon::after {
  inset: 8px;
  border-width: 2px;
  transform: rotate(45deg);
  clip-path: polygon(50% 0, 61% 31%, 94% 31%, 67% 49%, 78% 82%, 50% 63%, 22% 82%, 33% 49%, 6% 31%, 39% 31%);
}

.icon.chart::before,
.icon.chart::after {
  border-width: 2px;
}

.icon.hand::before,
.icon.car::before,
.icon.search::before {
  inset: 8px;
  border-radius: 50%;
}

.section-title {
  margin: 22px 0 14px;
  color: #0f2438;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: none;
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(32, 78, 119, 0.05);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.news-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.date-chip {
  color: var(--accent);
  font-weight: 800;
}

.news-row p,
.panel p,
.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hint.is-error {
  color: #b3261e;
  font-weight: 800;
}

.quick-panel {
  display: grid;
  align-content: start;
  gap: 8px;
}

.quick-link {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-hero,
.dashboard-metrics {
  grid-column: 1 / -1;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  align-items: end;
  gap: 16px;
}

.dashboard-hero h2 {
  margin-bottom: 8px;
}

.dashboard-search,
.global-search-box {
  display: flex;
  gap: 8px;
}

.dashboard-search input,
.global-search-box input,
.doc-filter input,
.doc-filter select,
.mail-filter input {
  min-height: 35px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 7px 10px;
}

.dashboard-search input,
.global-search-box input,
.mail-filter input {
  flex: 1;
}

.dashboard-card {
  min-height: 235px;
}

.dashboard-row,
.search-result {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 10px 0;
  text-align: left;
}

.dashboard-row strong,
.dashboard-row span,
.search-result span,
.search-result strong,
.search-result small,
.summary-list span {
  display: block;
}

.dashboard-row span,
.search-result small,
.summary-list span {
  color: var(--muted);
  font-size: 12px;
}

.notice-row {
  border: 1px solid #f2d28a;
  background: #fff8df;
  color: #72530a;
  border-radius: 4px;
  padding: 9px 10px;
  font-weight: 700;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.global-search-results {
  margin-top: 12px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
}

.tab {
  min-width: 100px;
  height: 36px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tab.active {
  background: #e7f3fc;
  color: #0870aa;
  border-bottom: 2px solid var(--accent-light);
}

.tabs-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
}

.btn.secondary {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.btn.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

thead tr {
  background: linear-gradient(#edf7fe 0%, #dceefa 100%);
}

th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: #315f7f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.empty-cell {
  height: 82px;
  color: var(--muted);
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.pill.blue {
  color: #075f9a;
  background: #e0f1fb;
}

.pill.green {
  color: #00923f;
  background: #dff8eb;
  border: 1px solid #61d28c;
}

.pill.red {
  color: #c01818;
  background: #ffe5e5;
  border: 1px solid #ffb2b2;
}

.btn.danger {
  border: 1px solid #ff2f2f;
  background: #ffffff;
  color: #d71919;
}

.btn.success {
  float: right;
  border: 1px solid #15803d;
  background: #15803d;
  color: #ffffff;
}

.report-list {
  width: min(900px, 100%);
  display: grid;
  gap: 8px;
  margin: 0 auto 18px;
}

.report-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 110px 90px 80px 42px;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.report-row strong {
  color: var(--accent);
  font-family: Consolas, monospace;
}

.report-row span {
  color: var(--muted);
}

.report-row b {
  color: var(--text);
}

.report-row em {
  font-style: normal;
  font-weight: 800;
}

.report-row .secret {
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid #f0a0a0;
  border-radius: 4px;
  background: #fff0f0;
  color: #e01818;
}

.report-editor {
  width: min(900px, 100%);
  margin-inline: auto;
}

.segmented {
  display: flex;
  gap: 8px;
}

.segmented button {
  min-width: 110px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
}

.segmented button.active {
  border-color: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--accent-light);
}

.large-text {
  min-height: 180px !important;
}

.upload-zone {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed #bfd3e5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
}

.upload-zone strong {
  color: var(--text);
  font-size: 16px;
}

.upload-icon {
  font-size: 36px;
}

.admin-tabs {
  overflow-x: auto;
}

.audit-row {
  display: grid;
  grid-template-columns: 140px max-content 1fr 90px;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.audit-row small {
  justify-self: end;
  color: var(--muted);
}

.service-work {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

#operativeView .service-work {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}

.left-menu {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

#operativeView .left-menu {
  margin-top: 1px;
}

.left-menu strong,
.left-menu button {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 11px 14px;
  text-align: left;
}

#operativeView .left-menu strong {
  padding: 13px 16px 10px;
  background: #ffffff;
  color: #6e879b;
  font-size: 11px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

#operativeView .left-menu button {
  min-height: 48px;
  padding: 13px 16px;
  background: linear-gradient(#0786c7, #0472ac);
  color: #ffffff;
  font-weight: 800;
}

.left-menu strong {
  background: #0870aa;
  color: #ffffff;
  font-weight: 800;
}

.left-menu button {
  background: #e8f2fb;
  color: #224863;
}

.left-menu button.active {
  background: #0b82c7;
  color: #ffffff;
  font-weight: 800;
}

.left-menu span,
.count-badge {
  float: right;
  min-width: 24px;
  border-radius: 999px;
  background: #d9effc;
  color: #0b70aa;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.filter-line,
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.order-registry {
  margin-top: 16px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions .btn {
  min-height: 30px;
  padding-inline: 10px;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 12px;
}

.backup-import-label {
  display: inline-flex;
  align-items: center;
}

.backup-metrics {
  margin-top: 12px;
}

.click-row,
.click-table tbody tr {
  cursor: pointer;
}

.click-row:hover,
.click-table tbody tr:hover {
  background: #e8f4fc;
}

.wanted-row {
  box-shadow: inset 4px 0 0 #d72828;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.form-grid.five {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.form-divider {
  margin: 12px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: #1672a9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ibd-search-panel .filter-line {
  margin-top: 10px;
}

#operativeView .ibd-search-panel {
  min-height: 126px;
  padding: 14px 14px 15px;
}

#operativeView .form-grid.five {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 12px;
}

#operativeView .field span {
  color: #8599aa;
  font-size: 11px;
  letter-spacing: 0.8px;
}

#operativeView .field input {
  height: 36px;
}

#operativeView .filter-line {
  margin-top: 12px;
  margin-bottom: 0;
}

#operativeView .btn {
  min-height: 34px;
  padding-inline: 13px;
}

.ibd-results .panel-head {
  margin-bottom: 12px;
}

#operativeView .ibd-results {
  margin-top: 12px;
  padding: 14px;
}

#operativeView .ibd-results .empty-panel {
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 0;
  background: #ffffff;
  color: #617587;
}

#operativeView .ibd-results .panel-head {
  align-items: center;
  justify-content: space-between;
}

#operativeView .ibd-results table th {
  height: 42px;
}

#operativeView .ibd-results table td {
  height: 46px;
}

.registry-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.registry-card h3,
.orientation-detail h3,
.person-subpanels h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #eef6fc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.person-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.person-detail-grid div {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

.person-detail-grid .wide {
  grid-column: 1 / -1;
}

.person-detail-grid span,
.orientation-detail span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.person-subpanels {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.person-subpanels section {
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
}

.ibd-linked-panels section {
  min-height: 180px;
  overflow: hidden;
}

.ibd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 8px;
  border-bottom: 1px solid var(--border);
  background: #eef6fc;
}

.ibd-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
}

.ibd-panel-head .count-badge {
  min-width: 20px;
  padding: 2px 6px;
  font-size: 10px;
}

.mini-action {
  padding: 5px 7px;
  border: 1px solid #9fc5dc;
  border-radius: 4px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.mini-action:hover {
  border-color: var(--accent);
  background: #f7fcff;
}

.ibd-linked-list {
  display: grid;
}

.ibd-linked-list > .muted-line {
  padding: 12px;
}

.ibd-linked-item {
  position: relative;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #e4eef5;
}

.ibd-linked-item:last-child {
  border-bottom: 0;
}

.ibd-linked-item > button:first-child {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  padding: 9px 34px 9px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ibd-linked-item > button:first-child:hover {
  background: #f6fbfe;
}

.ibd-linked-item strong,
.ibd-linked-item span,
.ibd-linked-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ibd-linked-item span {
  color: var(--muted);
  font-size: 11px;
}

.ibd-linked-item small {
  color: var(--dim);
  font-size: 10px;
}

.ibd-remove-link,
.ibd-inline-actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.ibd-remove-link {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
}

.ibd-remove-link:hover,
.ibd-inline-actions button:last-child:hover {
  color: var(--danger);
}

.ibd-inline-actions {
  position: absolute;
  top: 6px;
  right: 5px;
  display: flex;
}

.orientation-detail {
  display: grid;
  grid-template-columns: 190px 1fr;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.orientation-detail aside {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
  background: #f3f8fc;
  border-right: 1px solid var(--border);
}

.orientation-detail aside strong {
  font-size: 20px;
}

.orientation-detail aside hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
}

.orientation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.orientation-grid div {
  padding: 12px;
  border-right: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
}

.orientation-grid .wide {
  grid-column: 1 / -1;
  border-right: 0;
  color: #3b5268;
}

.orientation-photo {
  width: min(100%, 420px);
  max-height: 260px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: 24px;
  background: rgba(4, 20, 32, 0.55);
  overflow: auto;
  pointer-events: auto;
  animation: modal-fade-in 160ms ease-out;
}

.modal-panel {
  position: relative;
  z-index: 1001;
  width: min(760px, 100%);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  padding: 18px;
  pointer-events: auto;
  animation: modal-rise-in 180ms ease-out;
}

body.modal-open {
  overflow: hidden;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-rise-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-panel:focus {
  outline: none;
}

.modal-head,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.modal-footer {
  justify-content: flex-end;
  border-bottom: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  padding-bottom: 0;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}

.modal-body {
  display: grid;
  gap: 12px;
  padding: 14px 0;
}

.orientation-form {
  display: grid;
  gap: 12px;
}

.modal-panel.person-modal {
  width: min(700px, calc(100vw - 28px));
  border-radius: 8px;
  padding: 18px;
}

.person-modal .modal-head h2 {
  font-size: 18px;
}

.person-modal .modal-footer {
  justify-content: flex-start;
}

.person-modal .modal-body {
  gap: 11px;
}

.person-modal .field textarea {
  min-height: 72px;
}

.analytics-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.period-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.period-controls input {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 9px;
  min-width: 150px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
}

.progress-row {
  display: grid;
  grid-template-columns: 130px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.chart-panel {
  min-height: 260px;
}

.bar-chart {
  height: 210px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 24px 10px 10px;
  border: 1px solid var(--border);
  background: repeating-linear-gradient(to top, #fff 0, #fff 39px, #d8e9f5 40px);
}

.bar-chart span {
  width: 46px;
  display: grid;
  place-items: start center;
  border-radius: 5px 5px 0 0;
  background: #0b69a3;
  color: #ffffff;
  font-size: 11px;
}

.bar-chart span i {
  display: block;
  padding-top: 8px;
  font-style: normal;
  text-align: center;
  line-height: 1.1;
}

.sign-work {
  display: grid;
  gap: 12px;
}

.sign-upload {
  min-height: 84px;
}

.sign-empty-drop {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
}

.sign-empty-drop span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.sign-empty-drop strong {
  color: var(--text);
}

.sign-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.sign-canvas-wrap,
.signed-doc-image-wrap {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #f7fbff;
  cursor: crosshair;
}

.sign-document-image,
.signed-doc-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.signed-doc-error {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  padding: 24px;
  background: rgba(247, 251, 255, 0.94);
  color: var(--danger);
  font-weight: 800;
  text-align: center;
}

.signed-doc-image-wrap.image-load-error .signed-doc-image,
.signed-doc-image-wrap.image-load-error .sign-placement {
  display: none;
}

.signed-doc-image-wrap.image-load-error .signed-doc-error {
  display: grid;
}

.doc-attachment-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.doc-attachment-preview h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.doc-attachment-preview .btn {
  justify-self: start;
}

.doc-attachment-preview img {
  width: min(100%, 620px);
  max-height: 70vh;
  object-fit: contain;
  justify-self: center;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 48, 74, 0.16);
}

.sign-placement {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 0;
  cursor: move;
  pointer-events: none;
}

.sign-placement.readonly {
  pointer-events: none;
}

.placed-ep-stamp {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 3px 8px;
  align-items: center;
  border: 2px solid #111;
  border-radius: 5px;
  background: #ffffff;
  padding: 8px 10px;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: clamp(8px, 1vw, 12px);
  line-height: 1.12;
}

.placed-ep-stamp img {
  width: 38px;
  grid-row: span 4;
}

.placed-ep-stamp strong {
  text-align: center;
  font-size: clamp(10px, 1.2vw, 14px);
  line-height: 1.08;
}

.placed-ep-stamp span {
  color: #24364a;
  overflow-wrap: anywhere;
}

.placed-ep-stamp-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.placed-manual-sign {
  width: 100%;
  display: block;
  background: transparent;
}

.placed-manual-fallback {
  border-bottom: 2px solid #111;
  color: #111;
  font-family: "PT Astra Serif", "Times New Roman", serif;
  font-size: 28px;
  font-style: italic;
  text-align: center;
}

.sign-side {
  display: grid;
  gap: 12px;
}

.sign-mode-tabs {
  display: flex;
  gap: 8px;
}

.slim-panel {
  margin: 0;
  padding: 12px;
}

.slim-panel h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stamp-sample {
  transform-origin: left top;
}

.full-btn {
  width: 100%;
}

.manual-sign-box.is-muted {
  opacity: 0.68;
}

.sign-preview {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 5px;
  background: #f8fbfe;
  color: var(--muted);
  overflow: hidden;
}

.sign-preview img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.manual-sign-box {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  padding: 10px;
}

.manual-sign-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#manualSignPad {
  width: 100%;
  height: 160px;
  display: block;
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  background: #ffffff;
  cursor: crosshair;
}

.signed-doc-view {
  display: grid;
  gap: 12px;
}

.signed-doc-image {
  max-width: 100%;
  max-height: 560px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
}

.manual-sign-preview {
  width: 260px;
  max-width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
}

.person-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.person-db-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  padding: 12px;
}

.person-db-card.wanted {
  border-color: #e55b5b;
  background: #fff4f4;
}

.pill.red {
  background: #ffe0e0;
  color: #cf1f1f;
}

.pill.brown {
  background: #f6ead6;
  color: #8a5a10;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-grid {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--border-strong);
  border-radius: 5px;
  padding: 12px;
  background: var(--surface-2);
}

.access-grid strong {
  color: #284a63;
}

.access-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.access-check {
  min-height: 28px;
  padding: 3px 0;
  font-weight: 700;
  color: #36546d;
}

.compact-upload {
  min-height: 66px;
}

.asset-folders {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.asset-folder {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.asset-folder h3 {
  margin: 0;
  color: #2b6388;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f7fbff;
  padding: 8px 10px;
}

.asset-row code {
  color: #126da1;
  overflow-wrap: anywhere;
}

.award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.award-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  padding: 12px;
}

.award-card div {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f1f7fc;
  color: var(--gold);
  font-size: 28px;
}

.award-card img {
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
}

.award-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.filter-line input {
  min-height: 34px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 12px;
}

.panel-head {
  justify-content: space-between;
}

.form-grid.four {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.adis-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.adis-list {
  position: sticky;
  top: 12px;
}

.adis-list .panel-head.compact {
  align-items: flex-start;
  margin-bottom: 10px;
}

.adis-filter {
  margin-bottom: 10px;
}

.adis-list button {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #f6fbff;
  padding: 9px 10px;
  text-align: left;
}

.adis-list button.active {
  background: #e2f0fa;
}

.adis-list span {
  color: var(--muted);
  font-size: 12px;
}

.adis-list small {
  color: #3f6f8f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.adis-card {
  min-width: 0;
}

.adis-card-head,
.adis-actions,
.adis-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.adis-card-head {
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.adis-card-head h2 {
  margin-bottom: 8px;
}

.adis-card-head strong {
  display: block;
  color: #17384f;
  font-size: 18px;
}

.adis-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.adis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: #f7fbfe;
}

.adis-summary div {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}

.adis-summary div:last-child {
  border-right: 0;
}

.adis-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.adis-summary strong {
  display: block;
  margin-top: 4px;
  color: #17384f;
}

.adis-actions {
  margin-bottom: 14px;
}

.finger-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.finger-card {
  position: relative;
  min-height: 232px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
}

.finger-card.is-empty {
  background: #f7f9fb;
}

.finger-card.status-damaged {
  background: #fff9e8;
}

.finger-card .pill {
  position: absolute;
  top: 12px;
  right: 12px;
}

.fingerprint {
  width: 132px;
  height: 132px;
  margin: 24px auto 12px;
  border-radius: 48% 48% 44% 44%;
  background:
    repeating-linear-gradient(8deg, rgba(0, 0, 0, 0.26) 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at center, #bbbbbb 0 45%, transparent 46%);
  opacity: 0.75;
}

.finger-card.is-empty .fingerprint {
  opacity: 0.18;
  filter: grayscale(1);
}

.finger-card.status-damaged .fingerprint {
  opacity: 0.36;
  filter: sepia(0.5);
}

.finger-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.finger-actions .btn {
  min-height: 30px;
  padding: 5px 6px;
  font-size: 11px;
}

.dir-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(540px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.dir-form h2,
.preview-panel h2 {
  margin-bottom: 14px;
}

.form-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-section-title {
  margin: 16px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.person-result {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: #172c3d;
  font-size: 12px;
  font-weight: 800;
}

.paper-scroll {
  max-height: calc(100vh - 190px);
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #d8e2eb;
}

.dir-preview-scroll {
  max-height: calc(100vh - 176px);
  justify-content: flex-start;
  padding: 0 22px 24px;
  border-radius: 7px;
  border-color: #bdd3e4;
  background: linear-gradient(90deg, #ffffff 0 calc(100% - 26px), #d6e3ef calc(100% - 26px), #c7d8e6 100%);
}

.paper {
  width: 21cm;
  min-height: 29.7cm;
  flex: none;
  padding: 2cm 1cm 2cm 3cm;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 8px 24px rgba(20, 48, 74, 0.18);
  font-family: "PT Astra Serif", "Times New Roman", serif;
  font-size: 12pt;
  line-height: 1.15;
}

.dir-print-sheet {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  position: relative;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
  font-family: "PT Astra Serif", "Times New Roman", serif;
  font-size: 10pt;
  line-height: 1.12;
}

.dir-print-sheet.has-overflow {
  outline: 2px solid #b3261e;
  outline-offset: -2px;
}

.dir-print-header {
  position: absolute;
  text-align: center;
}

.dir-print-sheet:not(.is-blank) .dir-print-header {
  top: 10mm;
  left: 25mm;
  right: 25mm;
}

.dir-print-sheet:not(.is-blank) .dir-print-emblem {
  display: block;
  width: auto;
  height: 44mm;
  object-fit: contain;
  margin: 0 auto 4mm;
  filter: grayscale(1) contrast(1.15);
}

.dir-blank-recipient {
  display: none;
}

.dir-print-sheet:not(.is-blank) .dir-print-ministry,
.dir-print-sheet:not(.is-blank) .dir-print-agency-short {
  font-size: 13pt;
  font-weight: 700;
  line-height: 1.05;
}

.dir-print-sheet:not(.is-blank) .dir-print-org,
.dir-print-sheet:not(.is-blank) .dir-print-agency-full {
  margin-top: 2mm;
  font-size: 12pt;
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
}

.paper-emblem {
  width: 90px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 2px solid #000000;
  font-family: Arial, sans-serif;
  font-weight: 800;
}

.paper-center,
.paper-kind,
.paper-city {
  text-align: center;
}

.paper-kind {
  margin-top: 24px;
  font-weight: 800;
  letter-spacing: 8px;
}

.dir-print-kind {
  position: absolute;
  top: 86mm;
  left: 0;
  right: 0;
  margin: 0;
  font-size: 15pt;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}

.dir-print-meta {
  position: absolute;
  top: 99mm;
  left: 32mm;
  right: 32mm;
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  font-size: 11.5pt;
  font-weight: 700;
}

.dir-blank-fields {
  display: none;
}

.dir-form.is-blank .dir-blank-fields {
  display: grid;
}

.dir-meta-line {
  display: flex;
  align-items: end;
  gap: 3mm;
}

.dir-print-sheet:not(.is-blank) .dir-meta-line:first-child {
  display: grid;
  grid-template-columns: 1fr auto auto;
  width: 100%;
  gap: 3mm;
}

.dir-print-sheet:not(.is-blank) .dir-meta-line:first-child #paperNumber {
  text-align: right;
}

.dir-meta-line strong {
  font-weight: 700;
}

.dir-blank-incoming-line {
  display: none;
}

.paper-city {
  margin-top: 14px;
}

.dir-print-city {
  position: absolute;
  top: 110mm;
  left: 0;
  right: 0;
  margin: 0;
  font-size: 11.5pt;
  font-weight: 700;
  text-align: center;
}

.paper-subject {
  width: 8cm;
  margin: 38px 0 22px;
  padding: 10px 12px 0;
  border-top: 1px solid #000000;
  text-align: center;
}

.dir-print-subject {
  position: absolute;
  top: 124mm;
  left: 40mm;
  width: 96mm;
  min-height: 20mm;
  display: grid;
  align-items: center;
  justify-items: start;
  transform: none;
  margin: 0;
  padding: 3mm 4mm 2mm;
  border: 0;
  box-sizing: border-box;
  font-size: 12.5pt;
  font-weight: 700;
  text-align: left;
}

.dir-print-subject > div {
  width: 100%;
}

.dir-corner {
  position: absolute;
  width: 16px;
  height: 20px;
}

.dir-corner.tl {
  top: 0;
  left: 0;
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
}

.dir-corner.tr {
  top: 0;
  right: 0;
  border-top: 1px solid #000000;
  border-right: 1px solid #000000;
}

.dir-corner.bl {
  display: none;
}

.dir-corner.br {
  display: none;
}

.dir-print-body {
  position: absolute;
  top: 147mm;
  left: 32mm;
  right: 32mm;
  width: auto;
  margin: 0;
  font-size: 10pt;
  text-align: left;
}

.dir-print-body > p {
  width: 145mm;
  margin: 0 auto;
  line-height: 1.12;
  text-align: center;
}

.paper-action {
  margin: 16px 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: 6px;
}

.dir-print-action {
  margin: 8mm 0 0;
  font-size: 14pt;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.dir-print-body #paperResolution {
  width: 150mm;
  margin-top: 6mm;
  padding: 0;
  line-height: 1.15;
  text-align: left;
}

.dir-print-body #paperResolution p {
  margin: 0 0 1.5mm;
}

.paper-sign {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: start;
  gap: 28px;
  margin-top: 42px;
}

.dir-print-signature {
  position: absolute;
  top: 224mm;
  left: 32mm;
  right: 32mm;
  display: grid;
  grid-template-columns: 1fr 55mm 1fr;
  column-gap: 12mm;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 11pt;
}

.sign-stamp {
  justify-self: center;
  width: 260px;
  padding: 8px 10px;
  border: 1.5px solid #000000;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.dir-print-stamp {
  width: 55mm;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  line-height: 1;
}

.dir-print-signer-name {
  text-align: right;
}

.dir-stamp-svg {
  display: block;
  width: 100%;
  height: auto;
}

.dir-rp-mark {
  position: absolute;
  right: 12mm;
  bottom: 8mm;
  color: #8a8a8a;
  font-family: Arial, sans-serif;
  font-size: 6.5pt;
  line-height: 1;
}

.dir-print-sheet.is-blank {
  padding: 0;
}

.dir-print-sheet.is-blank .dir-print-header {
  inset: 0;
  text-align: center;
}

.dir-print-sheet.is-blank .dir-print-emblem {
  position: absolute;
  top: 8mm;
  left: 67mm;
  width: auto;
  height: 40mm;
  margin: 0;
  object-fit: contain;
  transform: translateX(-50%);
  filter: grayscale(1) contrast(1.15);
}

.dir-print-sheet.is-blank .dir-print-ministry,
.dir-print-sheet.is-blank .dir-print-org {
  position: absolute;
  left: 19mm;
  width: 96mm;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.dir-print-sheet.is-blank .dir-print-ministry {
  top: 49mm;
  min-height: 0;
  font-size: 0;
  line-height: 1.05;
}

.dir-print-sheet.is-blank .dir-print-org {
  top: 56mm;
  font-size: 10.8pt;
  line-height: 1.02;
}

.dir-print-sheet.is-blank .dir-print-org span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dir-print-sheet.is-blank .dir-print-org .dir-blank-title-line {
  font-weight: 700;
  text-transform: uppercase;
}

.dir-print-sheet.is-blank .dir-print-org .dir-blank-short-org {
  margin-top: 1mm;
  font-size: 9.2pt;
  font-weight: 400;
  line-height: 1.08;
  text-transform: uppercase;
}

.dir-print-sheet.is-blank .dir-print-org .dir-blank-address {
  margin-top: 0.8mm;
  font-size: 9.2pt;
  font-weight: 400;
  line-height: 1.08;
  text-transform: none;
}

.dir-print-sheet.is-blank .dir-print-org .dir-blank-short-org + .dir-blank-address {
  margin-top: 4mm;
}

.dir-print-sheet.is-blank .dir-blank-recipient {
  position: absolute;
  top: 64mm;
  left: 116mm;
  width: 68mm;
  min-height: 28mm;
  display: block;
  padding: 0;
  border: 0;
  box-sizing: border-box;
  text-align: left;
}

.dir-print-sheet.is-blank .dir-blank-recipient::before {
  content: "";
  position: absolute;
  top: -16mm;
  left: -2mm;
  width: 10mm;
  height: 6mm;
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  display: block;
}

.dir-print-sheet.is-blank .dir-blank-recipient::after {
  content: "";
  position: absolute;
  right: -5mm;
  bottom: -15mm;
  width: 10mm;
  height: 6mm;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
}

.dir-print-sheet.is-blank .dir-blank-recipient strong,
.dir-print-sheet.is-blank .dir-blank-recipient span:not(.dir-corner) {
  display: block;
  padding: 0;
  font-size: 11.5pt;
  line-height: 1.16;
  font-weight: 400;
}

.dir-print-sheet.is-blank .dir-blank-recipient strong {
  padding-top: 0;
}

.dir-print-sheet.is-blank .dir-blank-recipient .dir-corner {
  display: none;
}

.dir-print-sheet.is-blank .dir-print-kind {
  display: none;
}

.dir-print-sheet.is-blank .dir-print-meta {
  top: 126mm;
  left: 22mm;
  right: auto;
  width: 82mm;
  display: grid;
  gap: 1.5mm;
  justify-content: stretch;
  font-size: 10.5pt;
  font-weight: 400;
}

.dir-print-sheet.is-blank .dir-meta-line {
  display: grid;
  align-items: end;
  gap: 2mm;
}

.dir-print-sheet.is-blank .dir-meta-line:first-child {
  grid-template-columns: 31mm auto 31mm;
}

.dir-print-sheet.is-blank .dir-blank-incoming-line {
  display: grid;
  grid-template-columns: auto 30mm auto 25mm;
}

.dir-print-sheet.is-blank .dir-meta-line strong {
  min-width: 0;
  padding: 0 1mm 1px;
  border-bottom: 1px solid #000000;
  text-align: center;
}

.dir-print-sheet.is-blank .dir-print-city {
  display: none;
}

.dir-print-sheet.is-blank .dir-print-subject {
  top: 145mm;
  left: 40mm;
  width: 104mm;
  min-height: 18mm;
  margin: 0;
  transform: none;
}

.dir-print-sheet.is-blank .dir-print-subject .dir-corner {
  display: block;
}

.dir-print-sheet.is-blank .dir-print-body {
  top: 168mm;
  left: 28mm;
  right: 28mm;
  font-size: 11pt;
}

.dir-print-sheet.is-blank .dir-print-body > p {
  width: 154mm;
  max-width: 154mm;
  margin: 0;
  text-align: left;
  text-indent: 10mm;
  line-height: 1.22;
}

.dir-print-sheet.is-blank .dir-print-signature {
  top: 236mm;
  left: 28mm;
  right: 28mm;
  grid-template-columns: 1fr 55mm 1fr;
  column-gap: 12mm;
}

.dir-print-sheet.is-blank .dir-print-stamp {
  width: 55mm;
}

.dir-print-sheet.is-blank .dir-print-action,
.dir-print-sheet.is-blank #paperResolution {
  display: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: #ffffff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  color: var(--accent);
  font-size: 30px;
  line-height: 1.1;
}

.empty-panel {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.rls-layout,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.person-list,
.request-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.person-list button,
.request-card {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.person-list button:hover,
.person-list button.active {
  border-color: var(--accent);
  background: rgba(7, 105, 168, 0.08);
}

.person-list span,
.request-card span,
.muted-line {
  color: var(--muted);
  font-size: 12px;
}

.dossier-card {
  min-height: 420px;
}

.dossier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.dossier-head h2 {
  margin-bottom: 8px;
}

.dossier-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dossier-edit[hidden] {
  display: none;
}

.dossier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 8px;
  border-bottom: 1px solid var(--border);
}

.dossier-tabs button {
  min-height: 34px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.dossier-tabs button.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--primary-dark);
}

.dossier-tab-body {
  min-height: 220px;
}

.dossier-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.dossier-section h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.personnel-order-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.personnel-order-link small {
  flex-basis: 100%;
  color: var(--danger, #b42318);
}

.personnel-order-link .btn {
  min-height: 30px;
  padding: 5px 9px;
}

.embedded-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.embedded-history-row > .btn.danger {
  min-height: 30px;
  padding: 5px 9px;
}

@media (max-width: 620px) {
  .embedded-history-row {
    grid-template-columns: 1fr;
  }

  .embedded-history-row > .btn.danger {
    justify-self: start;
  }
}

.cert {
  color: #075f9a;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
}

.signature-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
}

.signature-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.signature-card strong {
  display: block;
  margin-top: 2px;
}

.signature-card button {
  align-self: end;
}

.signature-card.compact {
  grid-template-columns: 220px minmax(0, 1fr);
}

.dossier-photo {
  width: 116px;
  height: 132px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #f4f8fb;
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 800;
  overflow: hidden;
}

.dossier-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rls-group {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.rls-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  text-transform: none;
}

.rls-group h3 span {
  color: var(--muted);
  font-size: 12px;
}

.dossier-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0 14px;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.dossier-fields div {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

.dossier-fields span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.dossier-fields strong {
  display: block;
  margin-top: 2px;
  color: #1f2d3d;
  font-size: 13px;
}

.dossier-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dossier-media-grid article {
  display: grid;
  gap: 6px;
  min-height: 150px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  padding: 10px;
}

.dossier-media-grid img,
.media-file {
  width: 100%;
  height: 92px;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
}

.media-file {
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  font-weight: 900;
}

.dossier-media-grid span {
  color: var(--muted);
  font-size: 12px;
}

.print-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.print-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  padding: 9px 10px;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item,
.signature-log div,
.admin-density-row,
.integrity-panel div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
}

.timeline-item span,
.signature-log span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.timeline-item strong,
.admin-density-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-item small,
.signature-log small {
  color: var(--muted);
  text-align: right;
}

.signature-log {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.signature-log h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sudis-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-density-row {
  grid-template-columns: minmax(0, 1fr) 52px;
  margin-bottom: 6px;
}

.admin-density-row span {
  justify-self: end;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.integrity-panel {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
}

.integrity-panel.is-ok {
  border-color: #61d28c;
  background: #f3fff8;
}

.integrity-panel.has-issues {
  border-color: #f0c05a;
  background: #fffaf0;
}

.integrity-panel div {
  grid-template-columns: max-content minmax(0, 1fr);
  background: transparent;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.rls-upload-grid {
  align-items: stretch;
}

.rls-upload-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

.rls-upload-card .btn {
  width: 100%;
}

.upload-box {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: 5px;
  background: var(--surface-2);
  padding: 12px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.upload-box input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.award-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) 150px 145px auto;
  gap: 8px;
}

.award-form input,
.award-form select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 7px 10px;
  background: #fff;
}

.dossier-award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.dossier-award-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fbfe;
  padding: 10px;
}

.dossier-award-image {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.dossier-award-image img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.dossier-award-card > div:last-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dossier-award-card strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.dossier-award-card span,
.dossier-award-card small {
  color: var(--muted);
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.app-footer {
  margin-left: 220px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--border);
  background: #f5f8fb;
  color: #8494a2;
  font-size: 11px;
  text-align: center;
}

/* Unified icon system */
.sidebar-icon,
.top-icon,
.icon,
.upload-icon,
.award-placeholder-icon {
  --icon-mask: var(--icon-file);
  color: #0b5fa5;
}

.sidebar-icon::before,
.top-icon::before,
.icon::before,
.upload-icon::before,
.award-placeholder-icon::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 50% auto auto 50% !important;
  width: var(--glyph-size, 22px) !important;
  height: var(--glyph-size, 22px) !important;
  transform: translate(-50%, -50%) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  clip-path: none !important;
  background: currentColor !important;
  -webkit-mask: var(--icon-mask) center / contain no-repeat !important;
  mask: var(--icon-mask) center / contain no-repeat !important;
}

.sidebar-icon::after,
.top-icon::after,
.icon::after,
.upload-icon::after,
.award-placeholder-icon::after {
  display: none !important;
  content: none !important;
}

.sidebar-link i,
.sidebar-link .sidebar-icon {
  width: 28px;
  height: 28px;
  border: 1px solid #d9e9f5;
  border-radius: 7px;
  background: #f3f8fc;
  color: #1268a8;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
  border-color: #b8d5e8;
  background: #ffffff;
  color: #07599b;
}

.sidebar-link[data-view="sudis"] .sidebar-icon,
.sidebar-link[data-view="admin"] .sidebar-icon {
  border-color: #cde7d6;
  background: #eef8f1;
  color: #177245;
}

.top-icon {
  --glyph-size: 19px;
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.icon {
  --glyph-size: 26px;
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid #d5e8f4;
  border-radius: 8px;
  background: #f2f8fc;
  color: #0b5fa5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.service-card:hover .icon {
  border-color: #aacbe2;
  background: #ffffff;
  color: #064c86;
}

.upload-icon {
  --glyph-size: 25px;
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid #d5e8f4;
  border-radius: 8px;
  background: #f2f8fc;
}

.award-placeholder-icon {
  --glyph-size: 28px;
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
}

.sidebar-icon.home { --icon-mask: var(--icon-home); }
.sidebar-icon.users { --icon-mask: var(--icon-users); }
.sidebar-icon.grid { --icon-mask: var(--icon-grid); }
.sidebar-icon.doc { --icon-mask: var(--icon-file-text); }
.sidebar-icon.chart { --icon-mask: var(--icon-chart); }
.sidebar-icon.gear { --icon-mask: var(--icon-settings); }

.top-icon.search,
.icon.search { --icon-mask: var(--icon-search); }
.top-icon.power { --icon-mask: var(--icon-power); }
.icon.mail { --icon-mask: var(--icon-mail); }
.icon.doc,
.icon.form { --icon-mask: var(--icon-file-text); }
.icon.lock { --icon-mask: var(--icon-lock); }
.icon.shield { --icon-mask: var(--icon-shield-check); }
.icon.pen { --icon-mask: var(--icon-pen); }
.icon.chart { --icon-mask: var(--icon-chart); }
.icon.helmet { --icon-mask: var(--icon-id-card); }
.icon.db { --icon-mask: var(--icon-database); }
.icon.hand { --icon-mask: var(--icon-fingerprint); }
.icon.car { --icon-mask: var(--icon-car); }
.upload-icon { --icon-mask: var(--icon-upload); }
.award-placeholder-icon { --icon-mask: var(--icon-award); }

:root {
  --icon-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3 11 9-8 9 8M5 10v10h14V10M10 20v-6h4v6'/%3E%3C/svg%3E");
  --icon-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  --icon-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z'/%3E%3C/svg%3E");
  --icon-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6'/%3E%3C/svg%3E");
  --icon-file-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M8 13h8M8 17h6M8 9h2'/%3E%3C/svg%3E");
  --icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6'/%3E%3C/svg%3E");
  --icon-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M7 11V7a5 5 0 0 1 10 0v4M5 11h14v10H5zM12 15v2'/%3E%3C/svg%3E");
  --icon-shield-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10zM9 12l2 2 4-5'/%3E%3C/svg%3E");
  --icon-pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E");
  --icon-id-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 5h18v14H3zM8 11a2 2 0 1 0 0-4 2 2 0 0 0 0 4M5.5 16a3 3 0 0 1 5 0M14 9h4M14 13h5M14 17h3'/%3E%3C/svg%3E");
  --icon-database: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 6c0-2 3.6-4 8-4s8 2 8 4-3.6 4-8 4-8-2-8-4zM4 6v6c0 2 3.6 4 8 4s8-2 8-4V6M4 12v6c0 2 3.6 4 8 4s8-2 8-4v-6'/%3E%3C/svg%3E");
  --icon-fingerprint: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' d='M2 12a10 10 0 0 1 18-6M5 19c.7-2.5 1-5 1-7a6 6 0 0 1 12 0c0 1-.1 2-.3 3M9 22c1-3.2 1.5-6.5 1.5-10a1.5 1.5 0 0 1 3 0c0 3.8-.6 7.1-1.8 10M14.5 21c.7-2.4 1-5.2 1-8.5M3.5 15c.3-1 .5-2 .5-3a8 8 0 0 1 13.7-5.6'/%3E%3C/svg%3E");
  --icon-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 3v18h18M7 16v-5M12 16V7M17 16v-8'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.6V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.6-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9l-.1-.1A2 2 0 1 1 7.1 4l.1.1A1.7 1.7 0 0 0 9 4.4a1.7 1.7 0 0 0 1-1.6V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.6 1.7 1.7 0 0 0 1.9-.3l.1-.1A2 2 0 1 1 19.8 7l-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1h.1a2 2 0 1 1 0 4H21a1.7 1.7 0 0 0-1.6 1z'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='m21 21-4.3-4.3M10.8 18a7.2 7.2 0 1 1 0-14.4 7.2 7.2 0 0 1 0 14.4z'/%3E%3C/svg%3E");
  --icon-power: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M12 2v10M18.4 6.6a9 9 0 1 1-12.8 0'/%3E%3C/svg%3E");
  --icon-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12'/%3E%3C/svg%3E");
  --icon-award: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' d='M12 15a6 6 0 1 0 0-12 6 6 0 0 0 0 12zM9 14l-2 8 5-3 5 3-2-8'/%3E%3C/svg%3E");
  --icon-car: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M5 17h14M6 17v3M18 17v3M4 13l2-6h12l2 6M3 13h18v4H3zM7 13h.01M17 13h.01'/%3E%3C/svg%3E");
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .sidebar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .sign-editor {
    grid-template-columns: 1fr;
  }

  .service-grid,
  .service-grid-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dir-layout {
    grid-template-columns: 1fr;
  }

  .adis-layout {
    grid-template-columns: 1fr;
  }

  .adis-list {
    position: static;
  }

  .finger-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .sudis-overview-grid {
    grid-template-columns: 1fr;
  }

  .award-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 72px;
  }

  .login-page {
    padding: 16px 10px;
  }

  .login-head,
  .header-inner {
    padding: 10px 12px;
  }

  .login-split {
    grid-template-columns: 1fr;
  }

  .login-col + .login-col {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .header-inner {
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 72px;
  }

  .header-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-tools {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .header-status {
    display: none;
  }

  .icon-btn-wide {
    min-width: 38px;
    padding: 0 10px;
  }

  .icon-btn-wide .icon-text {
    display: none;
  }

  .user-chip {
    display: none;
  }

  .header-subtitle {
    display: none;
    font-size: 11px;
  }

  .mobile-menu {
    display: block;
  }

  .workspace {
    display: block;
    width: 100%;
    min-height: calc(100vh - 72px);
    margin: 0;
  }

  .workspace-body {
    padding: 12px 10px 84px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 68px;
    display: flex;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: 0 -10px 26px rgba(32, 78, 119, 0.12);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar { display: none; }

  .sidebar-link {
    position: relative;
    flex: 0 0 76px;
    min-height: 54px;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: 10px;
    text-align: center;
    flex-direction: column;
    border-radius: 8px;
  }

  .sidebar-release-link { margin-top: 0; }
  .sidebar-release-badge { position: absolute; top: 3px; right: 3px; padding: 2px 4px; font-size: 7px; }

  .sidebar-link .sidebar-icon {
    width: 24px;
    height: 24px;
  }

  .sidebar-link.active {
    box-shadow: inset 0 -3px 0 #1678bf;
  }

  .system-banner,
  .toolbar,
  .page-view {
    max-width: none;
  }

  .page-view {
    padding: 12px;
  }

  .service-grid,
  .service-grid-bottom,
  .home-grid,
  .dashboard-grid,
  .dashboard-hero,
  .form-grid.two,
  .form-grid.three,
  .form-grid.five,
  .metrics,
  .rls-layout,
  .admin-grid,
  .dossier-fields,
  .material-grid,
  .award-form,
  .person-detail-grid,
  .person-subpanels,
  .orientation-detail,
  .orientation-grid,
  .adis-summary,
  .finger-grid,
  .sudis-overview-grid,
  .timeline-item,
  .signature-log div {
    grid-template-columns: 1fr;
  }

  .app-footer {
    margin-left: 0;
    padding: 6px 10px;
  }

  .timeline-item small,
  .signature-log small {
    text-align: left;
  }

  .dashboard-search,
  .global-search-box {
    flex-direction: column;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tabs-actions {
    width: 100%;
    margin-left: 0;
  }

  .tabs-actions .btn {
    flex: 1;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .service-grid-bottom {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 116px;
    padding: 14px 12px 12px;
  }

  .service-card strong {
    font-size: 14px;
  }

  .service-card small {
    max-width: none;
    font-size: 11px;
  }

  .icon {
    width: 34px;
    height: 34px;
  }

  .service-card::after {
    font-size: 22px;
  }

  .top-icon {
    width: 14px;
    height: 14px;
  }

  .icon-btn-search {
    min-width: 38px;
    padding: 0 10px;
  }

  .icon-btn-search .icon-text {
    display: none;
  }

  .paper-scroll {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .header-title {
    font-size: 13px;
  }

  .header-mark {
    width: 34px;
    height: 34px;
  }

  .service-grid,
  .service-grid-bottom {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 86px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .tabs,
  .filter-line,
  .backup-actions,
  .row-actions,
  .dir-actions {
    align-items: stretch;
  }

  .tabs .tab,
  .filter-line .btn,
  .backup-actions .btn,
  .dir-actions .btn {
    min-height: 40px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  body * {
    visibility: hidden;
  }

  .paper,
  .paper * {
    visibility: visible;
  }

  .paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 21cm;
    min-height: 29.7cm;
    box-shadow: none;
  }
}

.version-history {
  display: grid;
  gap: 10px;
}

.version-history summary {
  cursor: pointer;
}

.version-history pre {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #cbdce8;
  background: #f5f8fa;
  color: #17384d;
  font: 12px/1.45 Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

:where(button, input, select, textarea, a, [tabindex]):focus-visible {
  outline: 3px solid #f1b82d;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  html,
  body,
  .app-shell,
  .view,
  .panel {
    max-width: 100%;
  }

  .modal-panel {
    width: min(96vw, 720px);
    max-height: 92vh;
  }

  .table-wrap {
    max-width: calc(100vw - 24px);
  }
}

/* ------------------------------ */
/*   UX foundation — release 2.0  */
/* ------------------------------ */

@media (min-width: 980px) {
  .icon-btn-search {
    width: auto;
    min-width: 142px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
  }

  .icon-btn-search .icon-text {
    display: inline;
    font-size: 12px;
  }
}

.icon-btn-search kbd {
  min-width: 38px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font: 10px/1.2 var(--interface-font);
}

.panel,
.metric,
.service-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.panel:hover {
  border-color: var(--border-strong);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.table-wrap {
  max-height: min(68vh, 760px);
  background: var(--surface);
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--border);
}

.table-wrap tbody tr {
  transition: background-color 120ms ease;
}

.table-wrap tbody tr:hover {
  background: #f3f9fd;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 28px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 104px;
  padding: 18px;
}

.empty-state strong {
  color: var(--text);
  font-size: var(--font-size-lg);
}

.empty-state p {
  max-width: 520px;
  margin: 0;
}

.empty-state small {
  color: var(--dim);
}

.search-progress,
.inline-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.inline-warning {
  margin-top: 8px;
  background: #fff6df;
  color: #7d5700;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-rotate 700ms linear infinite;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

.deadline-card .dashboard-row.is-overdue {
  border-left: 3px solid var(--danger);
  background: #fff7f6;
}

.form-status:not(:empty) {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--accent);
  background: var(--surface-3);
  color: var(--text);
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn:not(:disabled):active,
.icon-btn:not(:disabled):active,
.quick-link:not(:disabled):active {
  transform: translateY(1px);
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  width: min(400px, calc(100vw - 32px));
}

.app-toast {
  padding: 12px 16px;
  border-left: 4px solid var(--info);
  border-radius: var(--radius-md);
  background: #15364f;
  color: #fff;
  box-shadow: var(--shadow-strong);
  animation: toast-slide-in 180ms ease-out;
}

.app-toast.success { border-left-color: #66d493; }
.app-toast.warning { border-left-color: #ffd166; }
.app-toast.error { border-left-color: #ff8075; }

.platform-workspace {
  display: grid;
  gap: 14px;
}

.platform-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 18%, rgba(16, 145, 196, 0.2), transparent 34%),
    linear-gradient(135deg, #f9fcff 0%, #edf7fc 100%);
}

.platform-hero h1 {
  margin: 4px 0 8px;
  color: var(--navy);
  font-size: clamp(26px, 3vw, 40px);
}

.platform-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.platform-context {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: min(420px, 100%);
}

.platform-context .field {
  flex: 1;
  margin: 0;
}

.platform-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}

.platform-content,
.platform-two-column {
  display: grid;
  gap: 14px;
}

.platform-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-title-row h2,
.panel-title-row p {
  margin-top: 0;
}

.widget-catalog,
.capability-grid,
.saved-view-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.widget-option,
.capability-card,
.saved-view-card {
  display: flex;
  gap: 10px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.widget-option {
  align-items: flex-start;
  cursor: pointer;
}

.widget-option input {
  margin-top: 3px;
}

.widget-option span,
.capability-card,
.saved-view-card {
  flex-direction: column;
}

.widget-option small,
.capability-card span,
.saved-view-card small,
.integration-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.capability-card {
  appearance: none;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}

.capability-card:hover,
.widget-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-3);
}

.saved-view-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.platform-details {
  display: grid;
  gap: 0;
  margin: 0;
}

.platform-details div,
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.platform-details div:last-child,
.integration-row:last-child {
  border-bottom: 0;
}

.platform-details dt {
  color: var(--muted);
}

.platform-details dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.integration-list {
  display: grid;
}

.integration-row > div {
  min-width: 0;
  flex: 1;
}

.api-key-secret {
  display: grid;
  gap: 12px;
}

.api-key-secret code {
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #eef7fb;
  color: var(--navy);
  font-size: 13px;
  user-select: all;
}

.time-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.platform-upgrade-state {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
}

.platform-upgrade-state h2 {
  margin: 14px 0 8px;
  color: var(--navy);
}

.platform-upgrade-state ol {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding-left: 22px;
  color: var(--muted);
}

.case-registry,
.case-journal,
.mail-thread,
.mail-directory-list,
.unit-tree {
  display: grid;
  gap: 10px;
}

.case-card,
.case-journal article,
.mail-thread article,
.mail-directory-list article,
.unit-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.case-card { padding: 16px; }
.case-card-head,
.case-card-meta,
.mail-directory-list article,
.unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.case-card-head h3 { margin: 6px 0 2px; }
.case-card-meta { margin-top: 12px; color: var(--muted); flex-wrap: wrap; }

.case-stage-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 4px;
  margin: 14px 0;
  overflow-x: auto;
}
.case-stage-track span { position: relative; display: grid; justify-items: center; gap: 5px; color: var(--muted); text-align: center; font-size: 11px; }
.case-stage-track span::after { content: ""; position: absolute; top: 14px; left: 55%; width: 90%; height: 2px; background: var(--border-strong); }
.case-stage-track span:last-child::after { display: none; }
.case-stage-track i { z-index: 1; display: grid; width: 28px; height: 28px; place-items: center; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); font-style: normal; font-weight: 800; }
.case-stage-track .done i,
.case-stage-track .active i { border-color: var(--accent); background: var(--accent); color: #fff; }
.case-stage-track .done::after { background: var(--accent); }
.case-stage-track .active b { color: var(--navy); }

.case-journal article { position: relative; padding: 12px 14px 12px 150px; }
.case-journal article > span { position: absolute; left: 14px; top: 12px; color: var(--muted); font-size: 12px; }
.case-journal article p { margin: 4px 0; }
.case-journal article small { color: var(--muted); }
.case-journal.compact { max-height: 320px; overflow: auto; }

.workflow-route-visual { display: grid; gap: 6px; }
.workflow-route-visual article { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px; border-left: 3px solid var(--border-strong); background: var(--surface-2); }
.workflow-route-visual article.active { border-left-color: var(--accent); }
.workflow-route-visual article.done { border-left-color: var(--success); }
.workflow-route-visual i { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--surface); font-style: normal; font-weight: 800; }
.workflow-route-visual span,
.workflow-route-visual small { display: block; color: var(--muted); }

.mail-thread article { padding: 12px; }
.mail-thread article.active { border-color: var(--accent); background: var(--surface-3); }
.mail-thread article > div { display: flex; justify-content: space-between; gap: 12px; }
.mail-thread article p { white-space: pre-wrap; }
.mail-directory-list article,
.unit-row { padding: 12px; }
.mail-directory-list article > div,
.unit-row > div { min-width: 0; }
.mail-directory-list small,
.unit-row small { display: block; margin-top: 3px; color: var(--muted); }
.unit-row.is-archived { opacity: .65; }

.ibd-graph { display: grid; gap: 28px; padding: 20px; overflow-x: auto; }
.ibd-graph-branches { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.ibd-graph-branches::before { content: ""; position: absolute; left: 50%; top: -28px; width: 2px; height: 28px; background: var(--border-strong); }
.ibd-graph-node { appearance: none; display: grid; gap: 5px; min-width: 180px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-align: left; }
.ibd-graph-node.root { justify-self: center; border-width: 2px; border-color: var(--accent); background: var(--surface-3); }
.ibd-graph-node.relation { cursor: pointer; }
.ibd-graph-node.vehicle { border-color: #7e9d71; }
.ibd-graph-node span,
.ibd-graph-node small { color: var(--muted); }

.table-link { appearance: none; padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; }

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .release-hero { grid-template-columns: 1fr; }
  .release-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .release-summary div { grid-template-columns: 1fr; justify-items: center; text-align: center; border-bottom: 0; border-right: 1px solid var(--border); }
  .release-summary div:last-child { border-right: 0; }
  .release-flow-panel { grid-template-columns: 1fr; }
  .release-change-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .icon-btn-search kbd,
  .icon-btn-search .icon-text {
    display: none;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    max-height: none;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    border-radius: var(--radius-lg);
    padding: 14px;
    max-height: calc(100dvh - 20px);
    width: calc(100vw - 20px);
  }

  .modal-body { overflow-x: hidden; }
  .modal-footer { position: sticky; bottom: -14px; z-index: 3; margin: 14px -14px -14px; padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); }
  .modal-footer .btn { flex: 1 1 140px; }

  .case-stage-track { grid-template-columns: repeat(6, 108px); padding-bottom: 8px; }
  .case-card-head,
  .mail-directory-list article,
  .unit-row { align-items: stretch; flex-direction: column; }
  .case-journal article { padding: 42px 12px 12px; }
  .case-journal article > span { top: 12px; }
  .orientation-detail { grid-template-columns: 1fr; }
  .orientation-actions-form { grid-template-columns: 1fr; }
  .ibd-graph { padding: 8px; }
  .ibd-graph-branches { grid-template-columns: 1fr; }
  .order-registry .table-wrap,
  .mail-table .table-wrap,
  .platform-structure .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .order-registry table,
  .mail-table table,
  .platform-structure table { min-width: 760px; }

  .platform-hero,
  .platform-context,
  .panel-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-context {
    min-width: 0;
  }

  .platform-two-column,
  .widget-catalog,
  .capability-grid,
  .saved-view-grid {
    grid-template-columns: 1fr;
  }

  .release-home-banner,
  .release-section-heading { align-items: stretch; flex-direction: column; }
  .release-home-banner .btn { width: 100%; }
  .release-hero { min-height: 0; padding: 24px 18px; border-radius: 10px; }
  .release-hero::after { right: -8px; bottom: -35px; font-size: 150px; }
  .release-hero h1 { font-size: 38px; }
  .release-hero-actions .btn { flex: 1 1 150px; }
  .release-summary { grid-template-columns: 1fr; }
  .release-summary div { grid-template-columns: 70px 1fr; justify-items: stretch; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); }
  .release-flow-panel { padding: 17px; }
  .release-flow { grid-template-columns: repeat(6, 104px); }
  .release-change-grid,
  .release-notes-grid { grid-template-columns: 1fr; }
  .release-change-card { min-height: 0; }
}

@media (max-width: 480px) {
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .toast-container {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

.fleet-workspace {
  display: grid;
  gap: 16px;
}

.fleet-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  background: linear-gradient(120deg, #f9fcff, #e7f3fb 65%, #dceef3);
}

.fleet-hero h1 {
  margin: 4px 0 6px;
  color: var(--navy);
  font-size: 34px;
}

.fleet-hero p { margin: 0; color: var(--muted); }
.fleet-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fleet-toolbar { display: grid; gap: 14px; margin-bottom: 14px; }
.fleet-tabs { overflow-x: auto; }
.fleet-search { grid-template-columns: minmax(260px, 1fr) minmax(220px, 360px); }
.fleet-table td { vertical-align: middle; }
.fleet-table td > small { display: block; margin-top: 5px; color: var(--muted); }

.fleet-vehicle-link {
  display: grid;
  grid-template-columns: 72px minmax(150px, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.fleet-vehicle-link img,
.fleet-car-placeholder {
  width: 72px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #eef4f7;
  object-fit: cover;
}

.fleet-car-placeholder { position: relative; display: block; }
.fleet-car-placeholder::before {
  content: "";
  position: absolute;
  inset: 10px 8px 12px;
  background: var(--icon-car) center / contain no-repeat;
  opacity: .45;
}

.fleet-car-placeholder.large { width: 100%; height: 210px; }
.fleet-vehicle-link span span { display: block; }
.fleet-vehicle-link small { display: block; margin-top: 5px; color: var(--muted); }
.fleet-plate { display: block; font-size: 15px; letter-spacing: .05em; }
.fleet-detail { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(320px, 1.28fr); gap: 24px; align-items: start; }
.fleet-detail-photo img { width: 100%; max-height: 300px; border: 1px solid var(--border); border-radius: 5px; object-fit: cover; }
.fleet-detail-notes { margin-top: 18px; padding: 16px; border: 1px solid var(--border); background: #f8fbfd; }
.fleet-detail-notes h3, .fleet-history h3 { margin: 0 0 10px; color: var(--navy); }
.fleet-detail-notes p { margin: 0; white-space: pre-wrap; }
.fleet-history { margin-top: 18px; }
.fleet-history article { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fleet-history article span, .fleet-history article small { color: var(--muted); }

@media (max-width: 900px) {
  .fleet-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-detail { grid-template-columns: 1fr; }
}

.staffing-schedule {
  display: grid;
  gap: 16px;
}

.staffing-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.staffing-table td {
  vertical-align: middle;
}

.staffing-table code {
  color: #0b5f97;
  font-weight: 800;
}

.staffing-vacant {
  display: inline-grid;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #16845b;
}

.staffing-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.attachment-row > div:first-child {
  flex: 1;
  min-width: 0;
}

@media (max-width: 760px) {
  .staffing-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staffing-table {
    min-width: 980px;
  }
}

@media (max-width: 620px) {
  .fleet-hero { align-items: stretch; flex-direction: column; padding: 20px; }
  .fleet-search { grid-template-columns: 1fr; }
  .fleet-table-wrap { overflow-x: auto; }
  .fleet-table { min-width: 1040px; }
  .fleet-history article { grid-template-columns: 1fr; gap: 3px; }
}

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

.confirmation-panel {
  width: min(480px, calc(100vw - 32px));
}

.confirmation-message {
  margin: 0;
  color: var(--text, #18344d);
  line-height: 1.55;
  white-space: normal;
}

.visual-builder {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border, #cbdbe7);
  border-radius: 8px;
  background: #f7fafc;
}

.visual-builder-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.visual-builder-row {
  display: grid;
  grid-template-columns: 32px minmax(180px, 1.4fr) minmax(130px, .7fr) minmax(170px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d2e0ea;
  border-radius: 7px;
  background: #fff;
}

.workflow-builder-row {
  grid-template-columns: 32px minmax(220px, 1.5fr) minmax(170px, 1fr) 110px auto;
}

.builder-handle {
  align-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #0a6da9;
  font-weight: 800;
}

.builder-required {
  align-self: center;
  white-space: nowrap;
}

.builder-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.builder-actions .btn {
  min-width: 36px;
  padding-inline: 9px;
}

@media (max-width: 900px) {
  .visual-builder-row,
  .workflow-builder-row {
    grid-template-columns: 32px 1fr;
  }

  .visual-builder-row > :not(.builder-handle) {
    grid-column: 2;
  }

  .builder-actions {
    flex-wrap: wrap;
  }
}
