:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e6ebf2;
  --line-soft: #eef2f7;
  --text: #101828;
  --muted: #667085;
  --muted-2: #98a2b3;
  --blue: #1f5cc4;
  --blue-dark: #143f91;
  --blue-soft: #edf4ff;
  --green: #15803d;
  --green-soft: #eaf7ef;
  --warning: #9a6200;
  --warning-soft: #fff4df;
  --shadow: 0 14px 34px rgba(16, 24, 40, 0.06);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 92, 196, 0.045), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 76px 1fr;
}

.topbar {
  grid-column: 1 / -1;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: #173d83;
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-button,
.profile-button {
  border: 0;
  background: transparent;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #172033;
  display: grid;
  place-items: center;
  position: relative;
}

.icon-button:hover,
.profile-button:hover {
  background: #f4f7fb;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  border: 2px solid #fff;
}

.profile-button {
  min-height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2f8;
  color: #8b95a5;
  display: grid;
  place-items: center;
}

.profile-name {
  font-weight: 650;
  white-space: nowrap;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.sidebar {
  grid-row: 2;
  background: rgba(255, 255, 255, 0.68);
  border-right: 1px solid var(--line);
  padding: 28px 12px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.nav-item {
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  color: #536278;
  font-weight: 520;
  transition: 0.18s ease;
}

.nav-item:hover {
  background: #f2f6fc;
  color: var(--blue-dark);
}

.nav-item.active {
  background: linear-gradient(180deg, #eef5ff 0%, #eaf1fb 100%);
  color: var(--blue-dark);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #6a7890;
  flex: 0 0 auto;
}

.nav-item.active .nav-icon {
  color: var(--blue);
}

.nav-icon svg {
  width: 21px;
  height: 21px;
}

.accreditation {
  padding: 0 20px;
  color: #718096;
  font-size: 12px;
  line-height: 1.45;
}

.shield {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: #5272a3;
}

.shield svg {
  width: 28px;
  height: 28px;
}

.content {
  grid-column: 2;
  grid-row: 2;
  padding: 26px 30px 46px;
  outline: none;
}

.dashboard {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 30px;
  align-items: start;
}

.main-col,
.side-col {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.card {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 26px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero {
  padding: 34px 30px 18px;
}

.hero-top {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 26px;
  align-items: start;
}

.hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #edf2fa;
  color: var(--blue-dark);
  display: grid;
  place-items: center;
}

.hero-icon svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.55;
}

.hero-title {
  margin: 0;
  font-size: 31px;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: #0f172a;
  font-weight: 750;
}

.hero-company {
  margin-top: 8px;
  color: #29364a;
  font-size: 18px;
  font-weight: 520;
}

.stepper {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
  gap: 0;
}

.stepper::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 18px;
  height: 2px;
  background: var(--line);
}

.stepper::after {
  content: "";
  position: absolute;
  left: 7%;
  width: 21%;
  top: 18px;
  height: 2px;
  background: var(--blue);
}

.step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #111827;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 14px;
  box-shadow: 0 0 0 8px #fff;
}

.step.done .step-circle,
.step.current .step-circle {
  background: var(--blue);
  color: #fff;
}

.step-label {
  margin-top: 13px;
  font-size: 13px;
  color: #374151;
  line-height: 1.25;
  font-weight: 520;
}

.step.current .step-label {
  color: var(--blue);
  font-weight: 680;
}

.step-date {
  margin-top: 6px;
  color: #7a8495;
  font-size: 12px;
}

.hero-strip {
  margin-top: 22px;
  border-radius: 10px;
  background: #eef4ff;
  color: var(--blue-dark);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
}

.strip-left,
.strip-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.section-title {
  margin: 0 0 12px;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #111827;
  font-weight: 740;
}

.doc-card,
.works-card,
.table-card {
  overflow: hidden;
}

.doc-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) 140px 130px 96px;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
}

.doc-row:last-of-type {
  border-bottom: 0;
}

.doc-name {
  font-weight: 630;
  color: #1f2937;
}

.doc-date {
  color: #596579;
  font-size: 13px;
}

.doc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.small-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #596579;
}

.small-icon.doc {
  color: #44546a;
}

.round-btn {
  width: 40px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2937;
  display: grid;
  place-items: center;
  transition: 0.16s ease;
}

.round-btn:hover {
  border-color: #cfd8e6;
  background: #f8fafc;
  color: var(--blue);
}

.round-btn.disabled {
  opacity: 0.35;
  cursor: default;
}

.pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.pill.green {
  color: var(--green);
  background: var(--green-soft);
}

.pill.gray {
  color: #596579;
  background: #eef2f7;
}

.pill.blue {
  color: var(--blue);
  background: #eaf1ff;
}

.pill.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.card-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--blue);
  font-weight: 630;
  padding: 0 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
}

.work-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 38px minmax(250px, 1fr) 260px 104px 24px;
  gap: 14px;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
}

.work-row:last-of-type {
  border-bottom: 0;
}

.work-id {
  color: #1f2937;
  font-weight: 730;
  font-size: 14px;
}

.work-sub {
  margin-top: 5px;
  color: #7b8496;
  font-size: 13px;
}

.mini-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mini-line {
  width: 16px;
  height: 1px;
  background: var(--line);
}

.mini-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #485465;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 760;
}

.mini-circle.done {
  background: #365d96;
  color: #fff;
}

.mini-circle.current {
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
}

.expected {
  text-align: right;
  color: #778295;
  font-size: 13px;
  line-height: 1.25;
}

.arrow {
  color: var(--blue);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}

.side-card {
  padding: 26px 26px 22px;
}

.side-title {
  margin: 0 0 22px;
  color: #111827;
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 740;
}

.status-wrap {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 52%, transparent 53%),
    conic-gradient(var(--blue) 0 108deg, #d9dde5 108deg 360deg);
}

.donut-inner {
  text-align: center;
  line-height: 1.16;
}

.donut-number {
  color: var(--blue);
  font-size: 31px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.donut-label {
  margin-top: 2px;
  color: #344054;
  font-size: 13px;
  font-weight: 620;
}

.legend {
  display: grid;
  gap: 13px;
  font-size: 13px;
  color: #485465;
}

.legend-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 9px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d9dde5;
}

.dot.blue {
  background: var(--blue);
}

.dot.light {
  background: #98b7ee;
}

.legend-total {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: #526070;
  font-weight: 520;
}

.legend-total strong {
  color: #111827;
  font-size: 17px;
}

.recent-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.recent-item {
  display: grid;
  grid-template-columns: 34px 1fr 42px;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line-soft);
}

.recent-title {
  font-weight: 660;
  font-size: 14px;
  color: #1f2937;
  line-height: 1.25;
}

.recent-sub {
  margin-top: 7px;
  color: #5272a3;
  font-size: 13px;
  font-weight: 540;
}

.recent-date {
  margin-top: 3px;
  color: #8a95a6;
  font-size: 12px;
  text-align: right;
}

.contact-list {
  display: grid;
  gap: 22px;
  color: #1f2937;
  font-weight: 540;
}

.contact-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
}

.hours {
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  color: #7b8496;
  font-size: 14px;
  font-weight: 520;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 16px;
  outline: none;
}

.search-field:focus {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  background: #fff;
  color: #243244;
  border-color: var(--line);
}

.secondary-button:hover {
  background: #f8fafc;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
}

.simple-table th,
.simple-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.simple-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 760;
}

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

.empty-state {
  padding: 54px 26px;
  text-align: center;
  color: var(--muted);
}

.message-list {
  display: grid;
  gap: 14px;
}

.message-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.message-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 9px;
}

.message-card strong {
  color: #182235;
}

.message-card p {
  margin: 0;
  color: #344054;
  line-height: 1.55;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.profile-field {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.profile-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.profile-value {
  font-weight: 700;
  color: #1f2937;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-layout {
  width: min(440px, calc(100vw - 32px));
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 36px;
}

.login-brand {
  display: inline-block;
  margin-bottom: 38px;
}

.login-heading h1 {
  margin: 0;
  font-size: 31px;
  letter-spacing: -0.045em;
}

.login-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 650;
  font-size: 14px;
}

.login-form input {
  min-height: 48px;
  border-radius: 13px;
  border: 1px solid var(--line);
  padding: 0 15px;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
}

.login-footer {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 9px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 620;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 86px 1fr;
  }

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

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item span:last-child,
  .accreditation {
    display: none;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

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

  .status-wrap {
    grid-template-columns: 120px 1fr;
  }

  .donut {
    width: 116px;
    height: 116px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .topbar {
    height: 68px;
    padding: 0 18px;
  }

  .brand {
    font-size: 24px;
  }

  .profile-name {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 18px 14px 32px;
  }

  .dashboard,
  .side-col,
  .profile-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-header {
    display: block;
  }

  .hero-top {
    grid-template-columns: 1fr;
  }

  .hero-icon {
    display: none;
  }

  .hero-title {
    font-size: 25px;
  }

  .hero-strip {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .stepper {
    overflow-x: auto;
    grid-template-columns: repeat(5, 120px);
    padding-bottom: 4px;
  }

  .doc-row {
    grid-template-columns: 30px 1fr;
    padding: 16px;
    gap: 8px 12px;
  }

  .doc-row .pill,
  .doc-row .doc-date,
  .doc-row .doc-actions {
    grid-column: 2;
  }

  .doc-actions {
    justify-content: flex-start;
  }

  .work-row {
    grid-template-columns: 36px 1fr 20px;
    padding: 16px;
  }

  .mini-steps,
  .expected {
    grid-column: 2;
    justify-content: flex-start;
    text-align: left;
  }

  .arrow {
    grid-column: 3;
    grid-row: 1 / span 3;
  }

  .filter-row {
    display: grid;
  }

  .simple-table {
    min-width: 720px;
  }

  .table-card {
    overflow-x: auto;
  }
}


/* Login v2: визуально отличается от прежней центральной карточки */
.login-page-v2 {
  background:
    radial-gradient(circle at 18% 12%, rgba(31, 92, 196, 0.11), transparent 28%),
    linear-gradient(135deg, #f7f9fc 0%, #ffffff 48%, #eef3fa 100%);
}

.login-v2 {
  width: min(1120px, calc(100vw - 42px));
  min-height: 660px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border: 1px solid var(--line);
  border-radius: 34px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.10);
}

.login-v2-aside {
  position: relative;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(23, 61, 131, 0.06), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 20% 20%, rgba(31, 92, 196, 0.14), transparent 28%);
}

.login-v2-aside::after {
  content: "";
  position: absolute;
  right: 42px;
  bottom: 42px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 1px solid rgba(31, 92, 196, 0.12);
  pointer-events: none;
}

.login-v2-brand {
  width: max-content;
}

.login-v2-copy {
  max-width: 560px;
  position: relative;
  z-index: 1;
}

.login-v2-kicker {
  margin: 0 0 18px;
  color: var(--blue);
  font-weight: 760;
  font-size: 14px;
}

.login-v2-copy h1 {
  margin: 0;
  max-width: 590px;
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: -0.065em;
  color: #111827;
}

.login-v2-copy p:not(.login-v2-kicker) {
  margin: 22px 0 0;
  max-width: 470px;
  color: #5f6b7d;
  font-size: 17px;
  line-height: 1.65;
}

.login-v2-mini {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.login-v2-mini div {
  min-height: 94px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(230, 235, 242, 0.9);
}

.login-v2-mini strong {
  display: block;
  color: #173d83;
  font-size: 25px;
  letter-spacing: -0.045em;
  margin-bottom: 8px;
}

.login-v2-mini span {
  color: var(--muted);
  font-size: 13px;
}

.login-v2-note {
  position: relative;
  z-index: 1;
  color: #718096;
  font-size: 13px;
}

.login-v2-form-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px;
  background: rgba(255, 255, 255, 0.94);
  border-left: 1px solid var(--line);
}

.login-v2-form-head h2 {
  margin: 0;
  color: #111827;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.login-v2-form-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-v2-links {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 650;
}

/* Раздел документов: группировка по работам */
.documents-groups {
  display: grid;
  gap: 18px;
}

.work-doc-group {
  overflow: hidden;
}

.work-doc-head {
  min-height: 82px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

.work-doc-number {
  color: #111827;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.work-doc-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.work-doc-state {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.work-doc-list {
  display: grid;
}

.work-doc-row {
  min-height: 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) 140px 96px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.work-doc-row:last-child {
  border-bottom: 0;
}

@media (max-width: 860px) {
  .login-v2 {
    width: min(100vw - 28px, 520px);
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
  }

  .login-v2-aside {
    padding: 28px;
    gap: 34px;
  }

  .login-v2-copy h1 {
    font-size: 34px;
  }

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

  .login-v2-form-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 30px;
  }

  .work-doc-head {
    display: grid;
  }

  .work-doc-state {
    justify-content: flex-start;
  }

  .work-doc-row {
    grid-template-columns: 30px 1fr;
    padding: 14px 18px;
  }

  .work-doc-row .pill,
  .work-doc-row .doc-actions {
    grid-column: 2;
  }

  .work-doc-row .doc-actions {
    justify-content: flex-start;
  }
}


/* Staff/admin prototype. Не связан с клиентским меню и должен жить на отдельном закрытом адресе. */
.staff-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
  background:
    radial-gradient(circle at top left, rgba(31, 92, 196, 0.05), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
}

.staff-sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.staff-brand {
  display: inline-block;
  margin: 0 0 34px 14px;
}

.staff-nav {
  display: grid;
  gap: 8px;
}

.staff-nav-item {
  min-height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #536278;
  font-weight: 650;
}

.staff-nav-item:hover,
.staff-nav-item.active {
  background: #eef5ff;
  color: var(--blue-dark);
}

.staff-role-card {
  margin: 24px 12px 0;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.staff-role-card span,
.staff-role-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.staff-role-card strong {
  display: block;
  margin: 6px 0;
  color: #111827;
  font-size: 18px;
}

.staff-main {
  padding: 28px 34px 48px;
}

.staff-topbar {
  max-width: 1500px;
  margin: 0 auto 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.staff-topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.staff-topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.staff-actions {
  display: flex;
  gap: 10px;
}

#staffContent {
  max-width: 1500px;
  margin: 0 auto;
}

.staff-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.staff-kpi {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.staff-kpi span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.staff-kpi strong {
  color: #111827;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.staff-filter-bar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto auto auto;
  gap: 12px;
  margin-bottom: 18px;
}

.staff-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 16px;
  align-items: start;
}

.staff-board-column {
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.76);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.staff-board-column header {
  min-height: 82px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.staff-board-column h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.staff-board-column p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.staff-board-column header > span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef5ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.staff-board-list {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.staff-work-card {
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
}

.staff-work-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.staff-work-top strong {
  color: #111827;
  font-size: 16px;
}

.staff-work-customer {
  margin-top: 10px;
  color: #1f2937;
  font-weight: 700;
}

.staff-work-object {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.staff-work-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.staff-flags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-flags span {
  border-radius: 999px;
  background: #fff4df;
  color: #9a6200;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 760;
}

.staff-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 18px;
  text-align: center;
}

.staff-table td {
  line-height: 1.35;
}

.staff-small-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
}

.staff-finance-note {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #eef5ff;
  color: #173d83;
  border: 1px solid #dbeafe;
}

.staff-upload-layout {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
}

.staff-upload-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.staff-muted {
  color: var(--muted);
  line-height: 1.65;
}

.staff-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.staff-access-wizard {
  margin-top: 18px;
}

@media (max-width: 1200px) {
  .staff-shell {
    grid-template-columns: 1fr;
  }

  .staff-sidebar {
    min-height: auto;
    display: block;
  }

  .staff-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .staff-role-card {
    display: none;
  }

  .staff-board,
  .staff-kpi-grid,
  .staff-role-grid,
  .staff-upload-layout {
    grid-template-columns: 1fr;
  }

  .staff-filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .staff-main {
    padding: 20px 14px 34px;
  }

  .staff-topbar {
    display: block;
  }

  .staff-actions {
    margin-top: 18px;
  }

  .staff-nav {
    grid-template-columns: 1fr;
  }

  .staff-filter-bar {
    grid-template-columns: 1fr;
  }
}


/* v6: элементы реального API-интерфейса staff.html */
.staff-card-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.staff-pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
}

.staff-pagination button:disabled {
  opacity: .45;
  cursor: default;
}

.staff-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
  align-items: start;
}

.staff-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.staff-list {
  display: grid;
  gap: 10px;
}

.staff-list-row {
  min-height: 58px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.staff-list-row strong,
.staff-list-row span {
  display: block;
}

.staff-list-row span:not(.pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.staff-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344054;
  font-weight: 650;
}

.staff-checkbox input {
  width: 18px;
  height: 18px;
}

@media (max-width: 1000px) {
  .staff-detail-grid {
    grid-template-columns: 1fr;
  }
}


/* v6.2: фиксируем служебное меню и добавляем удобные фильтры по полям */
.staff-shell {
  align-items: start;
}

.staff-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.staff-main {
  min-width: 0;
}

.staff-filter-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.staff-filter-main {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 170px 190px auto auto;
  gap: 12px;
}

.staff-quick-filters {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.staff-quick-filters summary {
  min-height: 44px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #173d83;
  font-weight: 760;
  list-style: none;
}

.staff-quick-filters summary::-webkit-details-marker {
  display: none;
}

.staff-quick-grid {
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

.staff-quick-grid label {
  display: grid;
  gap: 6px;
}

.staff-quick-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.staff-quick-grid .search-field {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
}

.staff-board-column {
  max-height: calc(100vh - 330px);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.staff-board-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 10px;
}

.staff-board-column header {
  flex: 0 0 auto;
}

@media (max-width: 1200px) {
  .staff-sidebar {
    position: static;
    height: auto;
  }

  .staff-filter-main {
    grid-template-columns: 1fr 1fr;
  }

  .staff-quick-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .staff-board-column {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .staff-filter-main,
  .staff-quick-grid {
    grid-template-columns: 1fr;
  }
}


/* v6.3: компактный журнал работ в стиле рабочей таблицы */
.works-table-toolbar {
  margin: 0 0 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.works-table-toolbar strong {
  display: block;
  color: #111827;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.works-table-toolbar span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.works-table-hint {
  font-size: 13px;
  color: #7b8496;
}

.works-table-card {
  overflow: hidden;
}

.works-table-scroll {
  width: 100%;
  max-height: calc(100vh - 360px);
  min-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.works-grid-table {
  min-width: 2480px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.works-grid-table th,
.works-grid-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.works-grid-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  padding: 8px 8px 9px;
  color: #475467;
  text-align: left;
  font-weight: 780;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--line);
}

.works-grid-table th:first-child,
.works-grid-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.works-grid-table th:first-child {
  z-index: 4;
  background: #f1f6ff;
}

.works-grid-table td:first-child {
  background: #fbfdff;
  box-shadow: 1px 0 0 var(--line-soft);
}

.works-grid-table td {
  max-width: 150px;
  padding: 7px 8px;
  color: #344054;
  line-height: 1.28;
  white-space: normal;
  background: #fff;
}

.works-grid-table tr:hover td {
  background: #f8fbff;
}

.works-grid-table tr.row-review td {
  background: #fffdf7;
}

.works-grid-table tr.row-review:hover td {
  background: #fff9ec;
}

.works-grid-table .wide-col {
  min-width: 220px;
  max-width: 260px;
}

.column-title {
  min-height: 16px;
  margin-bottom: 6px;
}

.column-filter-input {
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  outline: none;
  font-size: 12px;
  font-weight: 520;
}

.column-filter-input:focus {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 92, 196, 0.08);
}

.column-filter-spacer {
  height: 28px;
}

.work-number-link {
  color: var(--blue);
  font-weight: 820;
  text-decoration: none;
}

.work-number-link:hover {
  text-decoration: underline;
}

.works-grid-table .pill {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .works-table-toolbar {
    display: block;
  }

  .works-table-hint {
    margin-top: 8px;
  }

  .works-table-scroll {
    max-height: none;
    min-height: 420px;
  }
}


/* v6.4: полноценная карточка работы */
.work-detail-actions {
  max-width: 1500px;
  margin: 0 auto 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.work-detail-layout {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 18px;
  align-items: start;
}

.work-detail-main-card {
  min-width: 0;
}

.work-side-stack {
  display: grid;
  gap: 18px;
}

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

.work-form-grid label,
.invoice-form-grid label {
  display: grid;
  gap: 6px;
}

.work-form-grid label span,
.invoice-form-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.work-form-grid .wide {
  grid-column: span 2;
}

.textarea-field {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

.work-form-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.work-block-note {
  margin: -4px 0 16px;
}

.invoice-list,
.document-list,
.access-list,
.audit-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.invoice-form {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
}

.new-invoice-form {
  margin-top: 16px;
  background: #f8fafc;
}

.new-invoice-form h3,
.staff-upload-form h3 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 16px;
}

.invoice-save-button {
  align-self: end;
  min-height: 38px;
}

.document-row {
  min-height: 68px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.document-row strong,
.document-row span,
.document-row small {
  display: block;
}

.document-row span,
.document-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.document-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-row {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
}

.audit-row strong,
.audit-row span {
  display: block;
}

.audit-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .work-detail-layout {
    grid-template-columns: 1fr;
  }

  .work-form-grid,
  .invoice-form-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .work-form-grid,
  .invoice-form-grid {
    grid-template-columns: 1fr;
  }

  .work-form-grid .wide {
    grid-column: auto;
  }

  .document-row {
    display: grid;
  }

  .document-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}


/* v7.1: авторизация сотрудников */
.staff-user-panel {
  margin: 18px 12px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.staff-user-panel strong,
.staff-user-panel span {
  display: block;
}

.staff-user-panel strong {
  color: #111827;
  font-size: 14px;
}

.staff-user-panel span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.staff-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(31, 92, 196, 0.10), transparent 28%),
    linear-gradient(135deg, #f7f9fc 0%, #ffffff 52%, #eef3fa 100%);
}

.staff-login-card {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.10);
  padding: 36px;
}

.staff-login-brand {
  display: inline-block;
  margin-bottom: 34px;
}

.staff-login-heading p {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 780;
}

.staff-login-heading h1 {
  margin: 0;
  color: #111827;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.staff-login-heading span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.staff-login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.staff-login-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 650;
  font-size: 14px;
}

.staff-login-form input {
  min-height: 48px;
  border-radius: 13px;
  border: 1px solid var(--line);
  padding: 0 15px;
  outline: none;
}

.staff-login-form input:focus {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
}

.staff-login-error {
  min-height: 20px;
  color: #9a3412;
  font-size: 14px;
  font-weight: 650;
}

.staff-login-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}


/* v7.2: служебное меню всегда сверху, без вертикального центрирования */
.staff-sidebar {
  justify-content: flex-start !important;
  gap: 18px;
}

.staff-brand {
  margin-bottom: 18px;
}

.staff-nav {
  margin-bottom: 0;
}

.staff-user-panel {
  margin: 12px 0 0;
}

.staff-role-card {
  display: none;
}


/* v7.8: аварийный локальный dev-вход */
.local-dev-login {
  min-height: 44px;
  justify-content: center;
}


/* v7.12: fast compact work journal */
.staff-main {
  padding-top: 34px;
}

.staff-filter-panel.compact-filter-panel {
  margin-bottom: 10px;
}

.compact-filter-panel .staff-filter-main {
  grid-template-columns: minmax(260px, 1fr) 145px 150px auto auto;
  gap: 8px;
}

.compact-filter-panel .search-field,
.compact-filter-panel .secondary-button {
  min-height: 36px;
  border-radius: 10px;
  font-size: 13px;
}

.compact-filter-panel .staff-quick-filters {
  box-shadow: none;
  border-radius: 12px;
}

.compact-filter-panel .staff-quick-filters summary {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.compact-filter-panel .staff-quick-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  padding: 0 12px 12px;
  gap: 8px;
}

.compact-filter-panel .staff-quick-grid label span {
  font-size: 11px;
}

.works-table-toolbar.compact-table-toolbar {
  margin-bottom: 6px;
}

.works-table-toolbar.compact-table-toolbar strong {
  font-size: 16px;
}

.works-table-toolbar.compact-table-toolbar span,
.works-table-hint {
  font-size: 12px;
}

.fast-works-table-card {
  border-radius: 14px;
}

.fast-works-table-scroll {
  max-height: calc(100vh - 310px);
  min-height: 470px;
}

.fast-works-grid-table {
  min-width: 1680px;
  font-size: 11px;
}

.fast-works-grid-table th {
  padding: 5px 6px 6px;
}

.fast-works-grid-table td {
  padding: 5px 6px;
  line-height: 1.22;
  max-width: 128px;
}

.fast-works-grid-table .wide-col {
  min-width: 210px;
  max-width: 240px;
}

.fast-works-grid-table .column-title {
  margin-bottom: 4px;
  min-height: 14px;
}

.fast-works-grid-table .column-filter-input {
  height: 24px;
  border-radius: 7px;
  font-size: 11px;
  padding: 0 6px;
}

.fast-works-grid-table .column-filter-spacer {
  height: 24px;
}

.fast-works-grid-table .pill {
  min-height: 18px;
  padding: 0 6px;
  font-size: 10px;
}

.compact-pagination {
  margin-top: 8px;
}

.compact-pagination .secondary-button {
  min-height: 34px;
}

@media (max-width: 1200px) {
  .compact-filter-panel .staff-filter-main {
    grid-template-columns: 1fr 1fr;
  }
  .compact-filter-panel .staff-quick-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}


/* v7.13: stable table updates, page-size selector, less flicker */
.table-toolbar-right {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.page-size-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.page-size-label .search-field {
  width: 92px;
  min-height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

#worksTableRegion {
  min-height: 560px;
}

.fast-works-table-scroll {
  scroll-behavior: auto;
}

.fast-works-grid-table tbody {
  contain: content;
}

@media (max-width: 900px) {
  .table-toolbar-right {
    justify-content: flex-start;
    margin-top: 8px;
  }
}


/* v7.14: modern stable journal, fixed column widths, manual search */
.modern-journal-region {
  min-height: calc(100vh - 190px);
}

.modern-journal {
  display: grid;
  gap: 10px;
}

.journal-topbar {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.journal-search-line {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px 150px auto auto;
  gap: 8px;
}

.journal-search-line .search-field,
.journal-search-line .primary-button,
.journal-search-line .secondary-button {
  min-height: 36px;
  border-radius: 10px;
  font-size: 13px;
}

.journal-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.journal-meta-line strong {
  display: block;
  color: #111827;
  font-size: 15px;
}

.journal-meta-line span {
  display: block;
  margin-top: 2px;
}

.modern-journal-table-wrap {
  height: calc(100vh - 315px);
  min-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}

.modern-journal-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 1924px;
  min-width: 1924px;
  font-size: 11px;
}

.modern-journal-table th,
.modern-journal-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  box-sizing: border-box;
}

.modern-journal-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  padding: 5px 6px;
  vertical-align: top;
  text-align: left;
}

.modern-journal-table th:first-child,
.modern-journal-table td:first-child {
  position: sticky;
  left: 0;
}

.modern-journal-table th:first-child {
  z-index: 5;
  background: #eef5ff;
}

.modern-journal-table td:first-child {
  z-index: 2;
  background: #fbfdff;
  box-shadow: 1px 0 0 var(--line-soft);
}

.modern-journal-table td {
  height: 42px;
  max-height: 42px;
  padding: 5px 6px;
  line-height: 1.22;
  vertical-align: top;
  background: #fff;
  overflow: hidden;
}

.modern-journal-table tr:hover td {
  background: #f8fbff;
}

.modern-journal-table tr.row-review td {
  background: #fffdf7;
}

.journal-sort-button {
  width: 100%;
  padding: 0;
  margin: 0 0 4px;
  border: 0;
  background: transparent;
  color: #475467;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.journal-filter-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 3px;
}

.journal-filter-cell input {
  width: 100%;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 6px;
  font-size: 11px;
  outline: none;
  box-sizing: border-box;
}

.journal-filter-cell input:focus {
  border-color: rgba(31, 92, 196, 0.50);
  box-shadow: 0 0 0 2px rgba(31, 92, 196, 0.08);
}

.journal-filter-cell button {
  width: 22px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #667085;
  cursor: pointer;
  padding: 0;
}

.journal-filter-spacer {
  height: 24px;
}

.journal-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.journal-pagination .secondary-button {
  min-height: 34px;
}

.modern-journal-table .pill {
  min-height: 18px;
  padding: 0 6px;
  font-size: 10px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .journal-search-line {
    grid-template-columns: 1fr 1fr;
  }

  .journal-meta-line {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v7.16: one journal instead of duplicated works/invoices + quick filters */
.journal-quick-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.journal-quick-chips button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.journal-quick-chips button:hover {
  border-color: rgba(31, 92, 196, 0.35);
  background: #f6f9ff;
  color: var(--blue);
}

.journal-filter-cell input[list]::-webkit-calendar-picker-indicator {
  opacity: .65;
  cursor: pointer;
}

.modern-journal-table td {
  word-break: normal;
}

.work-detail-actions .secondary-button[href="#works"]::after {
  content: "";
}


/* v7.18: polished work card buttons, file dropzone, money words, date inputs */
.work-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.work-detail-actions .secondary-button,
.work-detail-actions a.secondary-button,
.back-to-journal-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px !important;
  border-radius: 12px;
  white-space: nowrap;
  line-height: 1 !important;
  text-decoration: none;
  box-sizing: border-box;
  width: auto !important;
  max-width: none !important;
}

.date-field { display: grid; gap: 7px; }

.date-field-box {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}

.date-field-box:focus-within {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
}

.date-field-box .date-text-input {
  min-height: 46px;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 12px !important;
  outline: none;
}

.date-picker-button {
  border: 0;
  border-left: 1px solid var(--line);
  background: #f8fafc;
  color: #1f5cc4;
  cursor: pointer;
  font-weight: 900;
  font-size: 17px;
}
.date-picker-button:hover { background: #eef5ff; }

.date-hidden-input {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.money-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}
.money-field:focus-within {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
}
.money-field input {
  min-height: 46px;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 12px !important;
  outline: none;
}
.money-currency {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  background: #f8fafc;
  color: #475467;
  font-weight: 900;
}
.money-words {
  display: block;
  margin-top: 7px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.file-dropzone {
  border: 1.5px dashed rgba(31, 92, 196, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.file-dropzone:hover,
.file-dropzone.is-dragover {
  border-color: rgba(31, 92, 196, 0.62);
  background: #eef5ff;
}
.file-dropzone.is-dragover { transform: translateY(-1px); }
.file-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-dropzone-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #1f5cc4;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  flex: 0 0 auto;
}
.file-dropzone strong { display: block; color: #101828; font-size: 14px; }
.file-dropzone span { display: block; margin-top: 4px; color: #667085; font-size: 12px; line-height: 1.35; }


/* v7.19: premium-minimal accounting block */
.accounting-card {
  overflow: hidden;
}

.accounting-card .work-block-note {
  max-width: 880px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.accounting-card .invoice-list {
  gap: 8px;
  margin: 12px 0;
}

.accounting-card .premium-invoice-form {
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.035);
}

.accounting-card .premium-new-invoice-form {
  margin-top: 14px;
  background: #f8fafc;
}

.accounting-card .premium-new-invoice-form h3 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.accounting-card .premium-invoice-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 146px minmax(170px, 1.05fr) 168px 142px;
  gap: 10px;
  align-items: start;
}

.accounting-card .premium-invoice-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.accounting-card .premium-invoice-grid label span {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.accounting-card .premium-invoice-grid .search-field,
.accounting-card .premium-invoice-grid select,
.accounting-card .premium-invoice-grid input {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
}

.accounting-card .premium-invoice-grid .date-field-box,
.accounting-card .premium-invoice-grid .money-field {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
}

.accounting-card .premium-invoice-grid .date-field-box .date-text-input,
.accounting-card .premium-invoice-grid .money-field input {
  min-height: 38px !important;
  height: 38px;
  font-size: 13px;
}

.accounting-card .premium-invoice-grid .date-picker-button,
.accounting-card .premium-invoice-grid .money-currency {
  width: 38px;
  font-size: 13px;
}

.accounting-card .invoice-save-button {
  align-self: end;
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
  white-space: nowrap;
}

.accounting-card .compact-money-words {
  display: block;
  margin-top: 5px;
  min-height: 15px;
  max-width: 100%;
  color: #667085;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-card .payment-select {
  cursor: pointer;
  background-color: #fff;
}

.accounting-card .premium-invoice-form:hover {
  border-color: rgba(31, 92, 196, 0.20);
}

@media (max-width: 1350px) {
  .accounting-card .premium-invoice-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .accounting-card .invoice-save-button {
    justify-self: start;
    min-width: 160px;
  }
}

@media (max-width: 760px) {
  .accounting-card .premium-invoice-grid {
    grid-template-columns: 1fr;
  }
}


/* v7.20: premium controls — custom calendar, calmer select, readable amount proof */
.accounting-card .premium-invoice-grid {
  grid-template-columns: minmax(120px, 1fr) 150px minmax(245px, 1.3fr) 176px 132px;
  align-items: start;
}

.premium-date-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  min-height: 40px;
}

.premium-date-box:focus-within {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
}

.premium-date-box input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 38px !important;
  height: 38px;
  padding: 0 12px !important;
  outline: none;
  font-size: 13px;
  background: #fff;
}

.premium-calendar-button {
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8ff 100%);
  color: #1f5cc4;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.premium-calendar-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.premium-calendar-button:hover {
  background: #eef5ff;
  color: #174ca8;
}

.premium-calendar-popover {
  position: absolute;
  z-index: 50000;
  width: 292px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.18);
  padding: 14px;
  backdrop-filter: blur(8px);
}

.premium-calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.premium-calendar-head strong {
  text-align: center;
  color: #101828;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.premium-calendar-head button,
.premium-calendar-foot button {
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  border-radius: 11px;
  min-height: 34px;
  cursor: pointer;
  font-weight: 800;
}

.premium-calendar-head button:hover,
.premium-calendar-foot button:hover {
  border-color: rgba(31, 92, 196, 0.32);
  background: #f6f9ff;
  color: #1f5cc4;
}

.premium-calendar-weekdays,
.premium-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.premium-calendar-weekdays {
  margin-bottom: 6px;
}

.premium-calendar-weekdays span {
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.premium-calendar-days button {
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #344054;
  cursor: pointer;
  font-weight: 760;
}

.premium-calendar-days button:hover {
  background: #eef5ff;
  color: #1f5cc4;
}

.premium-calendar-days button.muted {
  color: #c2c8d0;
}

.premium-calendar-days button.today {
  box-shadow: inset 0 0 0 1px rgba(31, 92, 196, 0.38);
}

.premium-calendar-days button.selected {
  background: #1f5cc4;
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 92, 196, 0.22);
}

.premium-calendar-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.premium-calendar-foot button {
  flex: 1;
  font-size: 12px;
}

.accounting-card .payment-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%),
    linear-gradient(180deg, #fff 0%, #fbfcff 100%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 13px) 17px,
    0 0;
  background-size:
    5px 5px,
    5px 5px,
    100% 100%;
  background-repeat: no-repeat;
  padding-right: 34px;
  border-color: rgba(226, 232, 240, 0.98);
  font-weight: 760;
}

.accounting-card .payment-select:focus {
  border-color: rgba(31, 92, 196, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 92, 196, 0.08);
  outline: none;
}

.money-proof {
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: #f8fafc;
  color: #667085;
  line-height: 1.35;
}

.money-proof span {
  display: block;
  margin-bottom: 2px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.money-proof strong {
  display: block;
  color: #344054;
  font-size: 11px;
  font-weight: 760;
}

.accounting-card .compact-money-words {
  display: none;
}

@media (max-width: 1350px) {
  .accounting-card .premium-invoice-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}


/* v7.21: obvious per-work documents section */
.documents-card {
  overflow: hidden;
}

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

.documents-card-head .section-title {
  margin-bottom: 6px;
}

.documents-count-badge {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1f5cc4;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(31, 92, 196, 0.08);
}

.premium-document-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.premium-document-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.035);
}

.latest-document-card {
  border-color: rgba(31, 92, 196, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.document-file-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eef5ff;
  color: #1f5cc4;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 16px;
}

.document-file-main {
  min-width: 0;
}

.document-file-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.document-file-title-row strong {
  min-width: 0;
  color: #101828;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-document-badge {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf8ef;
  color: #15803d;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.document-file-main span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.document-file-main small {
  display: block;
  margin-top: 6px;
  color: #98a2b3;
  font-size: 11px;
  line-height: 1.35;
}

.document-file-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 56px;
}

.document-download-link {
  text-decoration: none;
}

.documents-empty-state {
  border: 1px dashed rgba(31, 92, 196, 0.26);
  border-radius: 18px;
  background: #fbfdff;
  padding: 18px;
  display: grid;
  gap: 8px;
  justify-items: start;
}

.documents-empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #eef5ff;
  color: #1f5cc4;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
}

.documents-empty-state strong {
  color: #101828;
  font-size: 15px;
}

.documents-empty-state span {
  color: #667085;
  line-height: 1.5;
  font-size: 13px;
}

.premium-upload-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.upload-form-head h3 {
  margin-bottom: 4px;
}

.upload-form-head p {
  margin: 0 0 12px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.document-type-label {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.document-type-label span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.upload-status-line {
  min-height: 20px;
  margin-top: 10px;
  color: #1f5cc4;
  font-size: 13px;
  font-weight: 760;
}

@media (max-width: 760px) {
  .document-file-actions {
    padding-left: 0;
  }

  .premium-document-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }
}


/* v7.22: preview/download actions for attached documents */
.document-file-actions {
  align-items: center;
}

.document-open-link,
.document-download-link {
  text-decoration: none;
}

.document-file-actions .primary-button.staff-small-button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: 12px;
  box-shadow: 0 10px 18px rgba(31, 92, 196, 0.14);
}

.document-preview-note {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.premium-document-card {
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.premium-document-card:hover {
  border-color: rgba(31, 92, 196, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.07);
}

.document-file-main small {
  max-width: 760px;
}


/* v7.23: roles, quick actions and readable audit */
.role-notice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.045);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.role-notice-card strong {
  display: block;
  color: #101828;
  font-size: 14px;
  margin-bottom: 3px;
}

.role-notice-card span {
  color: #667085;
  font-size: 13px;
}

.quick-actions-panel {
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 18px;
  background: #fbfdff;
  padding: 12px;
  margin: 14px 0;
}

.quick-actions-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quick-actions-head strong {
  color: #101828;
  font-size: 14px;
}

.quick-actions-head span {
  color: #667085;
  font-size: 12px;
}

.quick-actions-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-action-button {
  min-height: 34px;
  border-radius: 999px;
  font-size: 12px;
  padding: 0 12px;
}

.quick-action-button:not(:disabled):hover {
  border-color: rgba(31, 92, 196, .35);
  color: #1f5cc4;
  background: #f6f9ff;
}

.is-readonly-block {
  opacity: .72;
  position: relative;
}

.is-readonly-block::after {
  content: "только просмотр";
  position: absolute;
  right: 12px;
  top: 10px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  pointer-events: none;
}

.premium-audit-list {
  display: grid;
  gap: 10px;
}

.premium-audit-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 16px;
  background: #fff;
  padding: 11px 12px;
}

.premium-audit-row strong {
  display: block;
  color: #101828;
  font-size: 13px;
  margin-bottom: 4px;
}

.premium-audit-row span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.premium-audit-row small {
  color: #98a2b3;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .role-notice-card,
  .quick-actions-head,
  .premium-audit-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v7.24: accounting button overflow fix + users architecture note */
.accounting-card .premium-invoice-grid {
  grid-template-columns: minmax(112px, 1fr) 150px minmax(230px, 1.25fr) 176px 138px;
  align-items: end;
}

.accounting-card .invoice-save-button,
.accounting-card .premium-invoice-grid button[type="submit"],
.accounting-card .premium-new-invoice-form .primary-button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-card .premium-invoice-form,
.accounting-card .premium-new-invoice-form {
  overflow: hidden;
}

.accounting-card .premium-new-invoice-form .premium-invoice-grid {
  align-items: end;
}

.staff-users-architecture-note {
  margin-bottom: 16px;
}

.staff-users-architecture-note p {
  color: #667085;
  line-height: 1.55;
  margin: 8px 0;
  max-width: 980px;
}

.staff-users-architecture-note strong {
  color: #101828;
}

@media (max-width: 1350px) {
  .accounting-card .premium-invoice-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .accounting-card .premium-invoice-grid button[type="submit"] {
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .accounting-card .premium-invoice-grid {
    grid-template-columns: 1fr;
  }
}


/* v7.25: staff/customer split + stronger accounting button fix */
.accounting-card .premium-invoice-grid {
  grid-template-columns: minmax(112px, 1fr) 150px minmax(230px, 1.25fr) 176px minmax(132px, 138px);
  align-items: end;
}

.accounting-card .invoice-save-button,
.accounting-card .premium-invoice-grid button[type="submit"],
.accounting-card .premium-new-invoice-form .primary-button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-card .premium-invoice-form,
.accounting-card .premium-new-invoice-form {
  overflow: hidden;
}

.staff-users-architecture-note {
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.staff-users-architecture-note p {
  color: #667085;
  line-height: 1.55;
  margin: 8px 0;
  max-width: 1040px;
}

.staff-users-architecture-note strong {
  color: #101828;
}

@media (max-width: 1350px) {
  .accounting-card .premium-invoice-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .accounting-card .premium-invoice-grid button[type="submit"] {
    justify-self: stretch;
  }
}


/* v7.26: staff account management */
.staff-user-panel {
  display: grid;
  gap: 12px;
}

.staff-user-caption {
  display: block;
  margin-bottom: 4px;
  color: #98a2b3 !important;
  font-size: 10px !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.staff-current-user-chip {
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  display: grid;
  justify-items: end;
  line-height: 1.1;
}

.staff-current-user-chip span {
  color: #98a2b3;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.staff-current-user-chip strong {
  color: #101828;
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-users-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
  align-items: start;
}

.staff-users-side-panel {
  display: grid;
  gap: 18px;
}

.premium-staff-list {
  gap: 10px;
}

.premium-staff-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.035);
}

.staff-user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.staff-form-subtitle {
  margin: 8px 0 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}

.staff-edit-user-card.is-empty {
  background: #fbfdff;
}

.staff-edit-user-card form label:not(.staff-checkbox) {
  display: grid;
  gap: 7px;
}

.staff-edit-user-card form label:not(.staff-checkbox) span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.staff-user-management-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.danger-outline-button {
  border-color: rgba(180, 35, 24, .25) !important;
  color: #b42318 !important;
}

.danger-outline-button:hover {
  background: #fff4f3 !important;
  border-color: rgba(180, 35, 24, .45) !important;
}

@media (max-width: 1200px) {
  .staff-users-management-layout {
    grid-template-columns: 1fr;
  }

  .staff-current-user-chip {
    display: none;
  }
}

@media (max-width: 760px) {
  .premium-staff-user-row,
  .staff-user-management-actions {
    grid-template-columns: 1fr;
  }

  .staff-user-row-actions {
    justify-content: flex-start;
  }
}


/* v7.27: staff identity privacy + reliable edit panel */
.staff-user-panel strong,
.staff-current-user-chip strong {
  max-width: 100%;
}

.staff-user-panel span:not(.staff-user-caption) {
  color: #667085;
}

.premium-staff-user-row {
  cursor: default;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.premium-staff-user-row:hover {
  border-color: rgba(31, 92, 196, .26);
  background: #fbfdff;
}

.premium-staff-user-row.is-selected {
  border-color: rgba(31, 92, 196, .48);
  background: #f7faff;
  box-shadow: 0 18px 44px rgba(31, 92, 196, .10);
}

.edit-user-button {
  cursor: pointer;
  font-weight: 850;
}

#editUserPanel.is-active-editor .staff-edit-user-card {
  border-color: rgba(31, 92, 196, .36);
  box-shadow: 0 20px 54px rgba(31, 92, 196, .13);
}

.staff-edit-user-card {
  scroll-margin-top: 24px;
}

.staff-edit-user-card .section-title::after {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: #1f5cc4;
}


/* v7.28: modal employee editor + login fix */
.users-modal-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.staff-create-user-card {
  position: sticky;
  top: 24px;
}

.staff-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(15, 23, 42, .36);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: staffModalFade .14s ease-out;
}

.staff-modal-card {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, .94);
  border-radius: 26px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 34px 100px rgba(15, 23, 42, .28);
  animation: staffModalSlide .16s ease-out;
}

.staff-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 20px 22px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.staff-modal-head h2 {
  margin: 0;
  color: #101828;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.staff-modal-head p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
}

.staff-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #667085;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.staff-modal-close:hover {
  background: #f8fafc;
  color: #101828;
}

.staff-modal-body {
  padding: 18px 22px;
  display: grid;
  gap: 12px;
}

.staff-modal-body label:not(.staff-checkbox) {
  display: grid;
  gap: 7px;
}

.staff-modal-body label:not(.staff-checkbox) span {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.staff-modal-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.staff-modal-status {
  min-height: 20px;
}

.staff-modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  padding: 16px 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.staff-modal-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes staffModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes staffModalSlide {
  from { transform: translateY(10px) scale(.985); opacity: .5; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 1100px) {
  .users-modal-layout {
    grid-template-columns: 1fr;
  }

  .staff-create-user-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .staff-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-modal-actions-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .staff-modal-actions button {
    width: 100%;
  }
}


/* v7.29: access scope by site */
.access-scope-notice {
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(31, 92, 196, .14);
  border-radius: 12px;
  background: #f7faff;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.access-scope-notice strong {
  color: #1f5cc4;
}


/* v7.30: customer access preview */
.customer-access-card {
  overflow: hidden;
}

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

.customer-visible-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid rgba(31, 92, 196, .12);
  border-radius: 16px;
  background: #f7faff;
  padding: 10px;
  margin-bottom: 14px;
  color: #667085;
  font-size: 12px;
}

.customer-visible-summary strong {
  color: #101828;
}

.customer-visible-summary span {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  color: #344054;
  font-weight: 760;
}

.customer-access-candidates {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.customer-access-candidate-card {
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .035);
}

.customer-access-email-main strong {
  display: block;
  color: #101828;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-access-email-main span,
.customer-access-email-main small {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.customer-access-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-manual-access-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.customer-manual-access-form h3 {
  margin-bottom: 4px;
}

.customer-manual-access-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 170px 150px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

@media (max-width: 1200px) {
  .customer-manual-access-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .customer-access-head,
  .customer-manual-access-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}


/* v7.32: customer access review page */
.access-review-toolbar {
  margin-bottom: 16px;
}

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

.access-review-stats,
.access-review-bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.access-review-stats span {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.access-review-stats strong {
  color: #1f5cc4;
}

.access-review-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(190px, .95fr) 190px 190px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.access-review-list {
  overflow: hidden;
}

.access-review-list-head,
.access-review-row {
  display: grid;
  grid-template-columns: 58px minmax(250px, 1.25fr) minmax(220px, 1fr) 125px 250px;
  gap: 12px;
  align-items: center;
}

.access-review-list-head {
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.access-review-row {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background .15s ease, box-shadow .15s ease;
}

.access-review-row:hover {
  background: #fbfdff;
}

.access-review-row.is-selected {
  background: #f7faff;
  box-shadow: inset 3px 0 0 #1f5cc4;
}

.access-review-check {
  display: grid;
  place-items: center;
}

.access-review-work a {
  text-decoration: none;
  color: #0f3f94;
}

.access-review-work strong,
.access-review-email strong {
  display: block;
  color: #101828;
  margin-bottom: 4px;
}

.access-review-work span,
.access-review-email span,
.access-review-docs span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.access-review-work small,
.access-review-email small,
.access-review-docs small {
  display: block;
  margin-top: 3px;
  color: #98a2b3;
  font-size: 11px;
  line-height: 1.35;
}

.danger-text {
  color: #b42318 !important;
}

.access-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.access-review-select-all {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 1380px) {
  .access-review-filters {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .access-review-list {
    overflow-x: auto;
  }

  .access-review-list-head,
  .access-review-row {
    min-width: 1120px;
  }
}

@media (max-width: 760px) {
  .access-review-head,
  .access-review-filters {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}


/* v7.33: customer access synchronization */
.access-sync-panel {
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.access-sync-warning {
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 16px;
  background: #fffaf0;
  color: #92400e;
  padding: 11px 12px;
  margin: 12px 0 14px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 760;
}

.access-sync-form-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) minmax(210px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.access-sync-stats,
.access-sync-bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.access-sync-stats span {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #667085;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.access-sync-stats strong {
  color: #1f5cc4;
}

.access-sync-results {
  margin-top: 14px;
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.access-sync-empty {
  padding: 18px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.access-sync-results-head,
.access-sync-row {
  display: grid;
  grid-template-columns: 74px minmax(260px, 1.35fr) minmax(130px, .6fr) minmax(160px, .65fr);
  gap: 12px;
  align-items: center;
}

.access-sync-results-head {
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.access-sync-row {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.access-sync-row:last-child {
  border-bottom: 0;
}

.access-sync-row.is-selected {
  background: #f7faff;
}

.access-review-target-email {
  width: 260px;
  min-width: 220px;
}

@media (max-width: 1200px) {
  .access-sync-form-grid,
  .access-sync-results-head,
  .access-sync-row {
    grid-template-columns: 1fr;
  }

  .access-review-target-email {
    width: 100%;
  }
}


/* v7.34: customer access directory */
.customer-directory-panel {
  margin-bottom: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.customer-directory-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(190px, .85fr) 170px 170px auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

.customer-directory-layout {
  display: grid;
  grid-template-columns: minmax(310px, .82fr) minmax(0, 1.35fr);
  gap: 14px;
  align-items: start;
}

.customer-directory-list,
.customer-directory-detail {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  min-height: 180px;
}

.customer-directory-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.customer-directory-card:last-child {
  border-bottom: 0;
}

.customer-directory-card:hover,
.customer-directory-card.is-active {
  background: #f7faff;
}

.customer-directory-card-main strong,
.customer-directory-detail-head strong {
  display: block;
  color: #101828;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-directory-card-main span,
.customer-directory-card-main small,
.customer-directory-detail-head span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.customer-directory-card-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-directory-card-stats span {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1f5cc4;
  font-size: 12px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
}

.customer-directory-card-actions,
.customer-directory-detail-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-directory-empty {
  padding: 18px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.customer-directory-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.customer-directory-detail-controls {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.customer-directory-target-email {
  width: 260px;
  min-width: 220px;
}

.danger-soft-button {
  border-color: rgba(220, 38, 38, .2) !important;
  color: #b42318 !important;
  background: #fff7f7 !important;
}

.customer-directory-detail-list {
  display: grid;
}

.customer-directory-detail-row {
  display: grid;
  grid-template-columns: 58px minmax(220px, 1.2fr) minmax(130px, .48fr) minmax(240px, 1.2fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.customer-directory-detail-row:last-child {
  border-bottom: 0;
}

.customer-directory-detail-row.is-selected {
  background: #f7faff;
}

.customer-directory-work-main strong {
  color: #101828;
}

.customer-directory-work-main span,
.customer-directory-work-main small,
.customer-directory-work-status small {
  display: block;
  color: #667085;
  margin-top: 4px;
  font-size: 12px;
}

.customer-directory-work-docs {
  display: grid;
  gap: 6px;
}

.customer-directory-doc {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 12px;
  background: #fff;
  padding: 7px;
}

.customer-directory-doc span {
  color: #1f5cc4;
  font-weight: 850;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-directory-doc strong {
  font-size: 12px;
  color: #101828;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-directory-doc a {
  color: #1f5cc4;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 1280px) {
  .customer-directory-layout,
  .customer-directory-filters,
  .customer-directory-detail-row {
    grid-template-columns: 1fr;
  }

  .customer-directory-card {
    grid-template-columns: 1fr;
  }

  .customer-directory-card-stats,
  .customer-directory-card-actions,
  .customer-directory-detail-actions {
    justify-content: flex-start;
  }

  .customer-directory-target-email {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .customer-directory-detail-head,
  .customer-directory-detail-controls,
  .customer-directory-doc {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}


/* v7.34.2: access UX fix */
.access-review-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.access-sync-panel {
  margin-top: 0;
  border-color: rgba(31, 92, 196, .16);
}

@media (max-width: 760px) {
  .access-review-head-actions {
    justify-content: flex-start;
  }
}


/* v7.35: Access Directory UX Refactor */
.customer-directory-panel {
  padding-bottom: 18px;
}

.customer-directory-main-head {
  margin-bottom: 10px;
}

.customer-directory-kpi-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.customer-directory-kpi-row span {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 999px;
  background: #fff;
  color: #667085;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 850;
}

.customer-directory-kpi-row strong {
  color: #1f5cc4;
}

.customer-directory-filters-compact {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) 160px 165px auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0 12px;
}

.customer-directory-filters-compact .search-field,
.customer-directory-filters-compact .secondary-button {
  min-height: 38px;
  height: 38px;
  border-radius: 13px;
  font-size: 13px;
}

.customer-directory-table-zone {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.customer-directory-table-wrap {
  overflow: auto;
  max-height: 470px;
}

.customer-directory-table,
.customer-directory-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.customer-directory-table thead th,
.customer-directory-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: #667085;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 10px;
  font-weight: 950;
}

.customer-directory-table tbody td,
.customer-directory-detail-table tbody td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
}

.customer-directory-table tbody tr:last-child td,
.customer-directory-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.customer-directory-table-row {
  cursor: pointer;
}

.customer-directory-table-row:hover,
.customer-directory-table-row.is-active {
  background: #f7faff;
}

.customer-directory-table th:nth-child(1),
.customer-directory-table td:nth-child(1) {
  width: 34%;
}

.customer-directory-table th:nth-child(2),
.customer-directory-table td:nth-child(2) {
  width: 86px;
}

.customer-directory-table th:nth-child(3),
.customer-directory-table td:nth-child(3) {
  width: 82px;
}

.customer-directory-table th:nth-child(4),
.customer-directory-table td:nth-child(4) {
  width: 118px;
}

.customer-directory-table th:nth-child(5),
.customer-directory-table td:nth-child(5) {
  width: 130px;
}

.customer-directory-table th:nth-child(6),
.customer-directory-table td:nth-child(6) {
  width: 178px;
}

.customer-directory-email-line,
.customer-directory-company-line,
.customer-directory-site-cell,
.customer-directory-last-cell strong,
.customer-directory-last-cell span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.customer-directory-email-line {
  color: #101828;
  font-weight: 900;
}

.customer-directory-company-line,
.customer-directory-last-cell span,
.customer-directory-number-cell span {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.customer-directory-number-cell strong {
  color: #1f5cc4;
  font-size: 15px;
  line-height: 1;
}

.customer-directory-site-cell {
  color: #344054;
  font-weight: 760;
}

.customer-directory-actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.customer-directory-actions-cell .staff-small-button {
  min-height: 30px;
  padding-inline: 10px;
}

.customer-directory-empty-compact,
.customer-directory-detail-placeholder {
  padding: 14px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.customer-directory-detail-placeholder {
  margin-top: 10px;
  border: 1px dashed rgba(31, 92, 196, .20);
  border-radius: 16px;
  background: #fbfdff;
}

.customer-directory-detail-placeholder strong {
  display: block;
  color: #101828;
  margin-bottom: 3px;
}

.customer-directory-detail-zone {
  margin-top: 12px;
}

.customer-directory-detail-panel {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.customer-directory-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.customer-directory-detail-head strong {
  display: block;
  color: #101828;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-directory-detail-head span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.customer-directory-detail-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-directory-detail-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.customer-directory-target-email {
  width: 250px;
  min-width: 210px;
  min-height: 36px;
  height: 36px;
}

.customer-directory-detail-table-wrap {
  overflow: auto;
  max-height: 390px;
}

.customer-directory-detail-table th:nth-child(1),
.customer-directory-detail-table td:nth-child(1) {
  width: 48px;
  text-align: center;
}

.customer-directory-detail-table th:nth-child(2),
.customer-directory-detail-table td:nth-child(2) {
  width: 42%;
}

.customer-directory-detail-table th:nth-child(3),
.customer-directory-detail-table td:nth-child(3) {
  width: 150px;
}

.customer-directory-detail-table th:nth-child(4),
.customer-directory-detail-table td:nth-child(4) {
  width: auto;
}

.customer-directory-detail-row.is-selected {
  background: #f7faff;
}

.customer-directory-work-cell strong {
  color: #101828;
}

.customer-directory-work-cell span,
.customer-directory-work-cell small,
.customer-directory-status-cell small {
  display: block;
  color: #667085;
  margin-top: 3px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-directory-docs-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.customer-directory-doc-chip {
  max-width: 210px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(31, 92, 196, .14);
  border-radius: 999px;
  background: #f7faff;
  color: #1f5cc4;
  text-decoration: none;
  padding: 0 9px;
}

.customer-directory-doc-chip span {
  flex: 0 0 auto;
  color: #1f5cc4;
  font-size: 11px;
  font-weight: 900;
}

.customer-directory-doc-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #344054;
  font-size: 12px;
}

.customer-directory-no-docs {
  color: #98a2b3;
  font-size: 12px;
}

.danger-soft-button {
  border-color: rgba(220, 38, 38, .2) !important;
  color: #b42318 !important;
  background: #fff7f7 !important;
}

@media (max-width: 1180px) {
  .customer-directory-filters-compact {
    grid-template-columns: 1fr 1fr;
  }

  .customer-directory-table-wrap,
  .customer-directory-detail-table-wrap {
    max-height: none;
  }

  .customer-directory-table,
  .customer-directory-detail-table {
    min-width: 900px;
  }
}

@media (max-width: 760px) {
  .customer-directory-filters-compact {
    grid-template-columns: 1fr;
  }

  .customer-directory-detail-head,
  .customer-directory-detail-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-directory-detail-actions,
  .customer-directory-actions-cell {
    justify-content: flex-start;
  }

  .customer-directory-target-email {
    width: 100%;
  }
}


/* v7.36: Analytics MVP */
.analytics-filters-card {
  margin-bottom: 14px;
}

.analytics-filters-head,
.analytics-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.analytics-year-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.analytics-filter-grid {
  display: grid;
  grid-template-columns: 145px 145px 175px 160px minmax(240px, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.analytics-filter-grid .search-field,
.analytics-filter-grid .primary-button {
  min-height: 38px;
  height: 38px;
  border-radius: 13px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-kpi-card {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16,24,40,.055);
  padding: 14px;
  min-height: 128px;
}

.analytics-kpi-card span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 8px;
}

.analytics-kpi-card strong {
  display: block;
  color: #101828;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.analytics-kpi-card small {
  display: block;
  color: #667085;
  font-size: 12px;
  margin-top: 7px;
}

.analytics-kpi-card em,
.analytics-compare-list em {
  display: inline-flex;
  margin-top: 8px;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.analytics-kpi-card em.positive,
.analytics-compare-list em.positive {
  background: #ecfdf3;
  color: #027a48;
}

.analytics-kpi-card em.negative,
.analytics-compare-list em.negative {
  background: #fff1f3;
  color: #b42318;
}

.analytics-kpi-card em.neutral,
.analytics-compare-list em.neutral {
  background: #f2f4f7;
  color: #667085;
}

.analytics-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .72fr);
  gap: 14px;
  margin-bottom: 14px;
}

.analytics-side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.analytics-chart-card,
.analytics-side-card,
.analytics-table-card {
  margin-bottom: 14px;
}

.analytics-monthly-list {
  display: grid;
  gap: 9px;
}

.analytics-month-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 15px;
  background: #fbfdff;
}

.analytics-month-label strong,
.analytics-compact-bar-row strong {
  display: block;
  color: #101828;
  font-size: 13px;
}

.analytics-month-label span,
.analytics-compact-bar-row span {
  display: block;
  color: #667085;
  font-size: 12px;
  margin-top: 2px;
}

.analytics-bar-wrap {
  position: relative;
  height: 28px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.analytics-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.analytics-bar-total {
  background: #dbeafe;
}

.analytics-bar-paid {
  background: #b7e4ca;
}

.analytics-bar-unpaid {
  background: rgba(251, 113, 133, .48);
}

.analytics-month-amount {
  color: #101828;
  font-weight: 900;
  text-align: right;
}

.analytics-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: #667085;
  font-size: 12px;
  font-weight: 760;
}

.analytics-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.analytics-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-total { background: #dbeafe; }
.legend-paid { background: #b7e4ca; }
.legend-unpaid { background: rgba(251, 113, 133, .62); }

.analytics-compact-bars,
.analytics-compare-list {
  display: grid;
  gap: 10px;
}

.analytics-compact-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 15px;
  background: #fbfdff;
}

.analytics-small-bar {
  height: 9px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.analytics-small-bar i {
  height: 100%;
  display: block;
  border-radius: 999px;
  background: #1f5cc4;
}

.analytics-compact-bar-row b {
  color: #101828;
  font-size: 13px;
}

.analytics-compare-list div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 15px;
  background: #fbfdff;
  padding: 10px;
}

.analytics-compare-list span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.analytics-compare-list strong {
  display: block;
  color: #101828;
  font-size: 18px;
  margin-top: 5px;
}

.analytics-table-wrap {
  overflow: auto;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fff;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 860px;
  font-size: 13px;
}

.analytics-table th {
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.analytics-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

.analytics-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-table small {
  color: #667085;
}

.analytics-empty {
  border: 1px dashed rgba(31,92,196,.22);
  border-radius: 16px;
  background: #fbfdff;
  color: #667085;
  padding: 14px;
  font-size: 13px;
}

@media (max-width: 1320px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-main-grid {
    grid-template-columns: 1fr;
  }

  .analytics-filter-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .analytics-filters-head,
  .analytics-card-head {
    flex-direction: column;
  }

  .analytics-year-buttons {
    justify-content: flex-start;
  }

  .analytics-kpi-grid,
  .analytics-filter-grid,
  .analytics-month-row {
    grid-template-columns: 1fr;
  }

  .analytics-month-amount {
    text-align: left;
  }
}


/* v7.37: Analytics drilldown and quick periods */
.analytics-kpi-card {
  text-align: left;
  font-family: inherit;
  cursor: default;
}

.analytics-kpi-card.is-clickable {
  cursor: pointer;
}

.analytics-kpi-card.is-clickable:hover {
  border-color: rgba(31,92,196,.26);
  box-shadow: 0 22px 58px rgba(31,92,196,.10);
  transform: translateY(-1px);
}

.analytics-year-buttons {
  max-width: 720px;
}

.analytics-period-button,
.analytics-year-button {
  white-space: nowrap;
}

.analytics-month-row {
  width: 100%;
  border: 1px solid rgba(226,232,240,.96);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.analytics-month-row:hover {
  border-color: rgba(31,92,196,.24);
  background: #f7faff;
}

.analytics-customer-row {
  cursor: pointer;
}

.analytics-customer-row:hover {
  background: #f7faff;
}

.analytics-drilldown-card {
  margin-bottom: 14px;
  border-color: rgba(31,92,196,.16);
}

.analytics-drilldown-table th:nth-child(1),
.analytics-drilldown-table td:nth-child(1) {
  width: 140px;
}

.analytics-drilldown-table th:nth-child(2),
.analytics-drilldown-table td:nth-child(2) {
  width: 110px;
}

.analytics-drilldown-table th:nth-child(3),
.analytics-drilldown-table td:nth-child(3) {
  width: 220px;
}

.analytics-drilldown-table th:nth-child(4),
.analytics-drilldown-table td:nth-child(4) {
  width: auto;
}

.analytics-drilldown-table th:nth-child(5),
.analytics-drilldown-table td:nth-child(5) {
  width: 100px;
}

.analytics-drilldown-table th:nth-child(6),
.analytics-drilldown-table td:nth-child(6) {
  width: 120px;
}

.analytics-drilldown-table th:nth-child(7),
.analytics-drilldown-table td:nth-child(7) {
  width: 125px;
  text-align: right;
}

.analytics-drilldown-table td:nth-child(4),
.analytics-drilldown-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .analytics-year-buttons {
    justify-content: flex-start;
    max-width: none;
  }
}


/* v7.38: Customer financial card */
.analytics-top-customers-table th:nth-child(1),
.analytics-top-customers-table td:nth-child(1) {
  width: 30%;
}

.analytics-top-customers-table th:nth-child(7),
.analytics-top-customers-table td:nth-child(7) {
  width: 170px;
}

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

.customer-financial-card {
  margin-bottom: 14px;
  border-color: rgba(31,92,196,.16);
}

.customer-financial-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

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

.customer-financial-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.customer-financial-kpis div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fbfdff;
  padding: 11px;
}

.customer-financial-kpis span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 6px;
}

.customer-financial-kpis strong {
  color: #101828;
  font-size: 19px;
  letter-spacing: -.03em;
}

.customer-financial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .7fr);
  gap: 12px;
  margin-bottom: 14px;
}

.customer-financial-grid section,
.customer-financial-tables section {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
}

.customer-financial-grid h3,
.customer-financial-tables h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -.02em;
}

.customer-card-month-bars {
  display: flex;
  gap: 8px;
  align-items: end;
  min-height: 150px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.customer-card-month-bar {
  width: 72px;
  min-width: 72px;
  display: grid;
  grid-template-rows: auto 92px auto;
  gap: 6px;
  align-items: end;
}

.customer-card-month-bar span {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.customer-card-month-bar i {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 92px;
  border-radius: 12px;
  background: #eef2f7;
  overflow: hidden;
}

.customer-card-month-bar b {
  display: block;
  width: 100%;
  border-radius: 12px 12px 0 0;
  background: #1f5cc4;
}

.customer-card-month-bar strong {
  color: #344054;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.customer-card-access-list {
  display: grid;
  gap: 8px;
}

.customer-card-access-list div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 14px;
  background: #fbfdff;
  padding: 9px;
}

.customer-card-access-list strong {
  display: block;
  color: #101828;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-card-access-list span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.customer-financial-tables {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.customer-financial-table {
  min-width: 960px;
}

.customer-financial-table td:nth-child(4),
.customer-financial-table td:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .customer-financial-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-financial-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .customer-financial-head {
    flex-direction: column;
  }

  .customer-financial-actions {
    justify-content: flex-start;
  }

  .customer-financial-kpis {
    grid-template-columns: 1fr 1fr;
  }
}


/* v7.39: Diagnostics and quick navigation */
.quick-scroll-controls {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 8px;
}

.quick-scroll-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  color: #1f5cc4;
  box-shadow: 0 18px 45px rgba(16,24,40,.14);
  font-weight: 950;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.quick-scroll-controls button:hover {
  background: #eef5ff;
  border-color: rgba(31,92,196,.25);
  transform: translateY(-1px);
}

.diagnostics-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.diagnostics-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.diagnostics-filter-row .search-field {
  min-width: 180px;
  min-height: 38px;
  height: 38px;
}

.diagnostics-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.diagnostics-kpi-row div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16,24,40,.055);
  padding: 14px;
}

.diagnostics-kpi-row span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 8px;
}

.diagnostics-kpi-row strong {
  display: block;
  color: #101828;
  font-size: 24px;
  letter-spacing: -.035em;
}

.diagnostics-groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.diagnostics-group-card {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  min-height: 116px;
}

.diagnostics-group-card:hover,
.diagnostics-group-card.is-active {
  border-color: rgba(31,92,196,.26);
  background: #f7faff;
  box-shadow: 0 18px 48px rgba(31,92,196,.08);
}

.diagnostics-group-card span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 8px;
}

.diagnostics-group-card.danger span {
  background: #fff1f3;
  color: #b42318;
}

.diagnostics-group-card.warning span {
  background: #fff7e8;
  color: #b54708;
}

.diagnostics-group-card.info span {
  background: #eef5ff;
  color: #1f5cc4;
}

.diagnostics-group-card strong {
  display: block;
  min-height: 38px;
  color: #101828;
  font-size: 14px;
  line-height: 1.25;
}

.diagnostics-group-card em {
  display: block;
  margin-top: 10px;
  color: #1f5cc4;
  font-size: 24px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.diagnostics-group-card small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.diagnostics-details-card {
  margin-bottom: 14px;
}

.diagnostics-detail-amount {
  color: #101828;
  font-size: 20px;
}

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

.diagnostics-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fbfdff;
  padding: 10px;
}

.diagnostics-item strong {
  color: #101828;
}

.diagnostics-item span,
.diagnostics-item small {
  display: block;
  color: #667085;
  margin-top: 3px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .diagnostics-kpi-row,
  .diagnostics-groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .diagnostics-hero,
  .diagnostics-item {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .diagnostics-filter-row {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .diagnostics-kpi-row,
  .diagnostics-groups-grid {
    grid-template-columns: 1fr;
  }

  .quick-scroll-controls {
    right: 12px;
    bottom: 12px;
  }
}


/* v7.39.1: duplicate protection note */
.analytics-dedupe-note {
  border: 1px solid rgba(245, 158, 11, .28);
  background: #fffaf0;
  color: #92400e;
  border-radius: 16px;
  padding: 11px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
}


/* v7.39.2: diagnostics smooth scroll feedback */
.diagnostics-details-card {
  scroll-margin-top: 22px;
}

.diagnostics-details-pulse {
  animation: diagnosticsDetailsPulse .9s ease-out;
}

@keyframes diagnosticsDetailsPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 92, 196, .28), 0 18px 48px rgba(16,24,40,.055);
    border-color: rgba(31, 92, 196, .35);
  }
  100% {
    box-shadow: 0 18px 48px rgba(16,24,40,.055);
  }
}


/* v7.41: MVP work creation + documents overview */
.create-work-button {
  white-space: nowrap;
}

.create-work-modal-card {
  max-width: 880px;
  width: min(880px, calc(100vw - 28px));
}

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

.create-work-grid .wide {
  grid-column: 1 / -1;
}

.create-work-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.documents-overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.documents-overview-note {
  border: 1px solid rgba(226,232,240,.96);
  background: #fbfdff;
  border-radius: 16px;
  padding: 12px;
}

.documents-overview-note strong {
  display: block;
  color: #101828;
  margin-bottom: 4px;
}

.documents-overview-note span {
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.documents-overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.documents-overview-kpis div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16,24,40,.055);
  padding: 14px;
}

.documents-overview-kpis span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 8px;
}

.documents-overview-kpis strong {
  display: block;
  color: #101828;
  font-size: 24px;
  letter-spacing: -.035em;
}

.documents-overview-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 170px 190px auto;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.documents-overview-table {
  min-width: 1120px;
}

.documents-overview-table th:nth-child(1),
.documents-overview-table td:nth-child(1) {
  width: 270px;
}

.documents-overview-table th:nth-child(4),
.documents-overview-table td:nth-child(4) {
  width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.documents-overview-table th:nth-child(6),
.documents-overview-table td:nth-child(6) {
  width: 220px;
}

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

@media (max-width: 1280px) {
  .documents-overview-hero,
  .documents-overview-filters {
    grid-template-columns: 1fr;
  }

  .documents-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .create-work-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .documents-overview-kpis,
  .create-work-grid {
    grid-template-columns: 1fr;
  }
}


/* v7.41.2: create-work helpers */
.create-work-number-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(226,232,240,.96);
  background: #fbfdff;
  border-radius: 16px;
  padding: 10px;
}

.create-work-number-helper {
  display: grid;
  gap: 3px;
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
}

.create-work-number-helper strong {
  color: #101828;
  font-size: 13px;
}

.create-work-number-helper b {
  color: #1f5cc4;
}

.create-work-number-helper em {
  color: #b42318;
  font-style: normal;
  font-weight: 850;
}

.create-work-number-helper.is-error {
  color: #b42318;
}

.create-work-files {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(226,232,240,.96);
  background: #fff;
  border-radius: 18px;
  padding: 12px;
}

.create-work-files h3 {
  margin: 0 0 4px;
  color: #101828;
  font-size: 15px;
  letter-spacing: -.01em;
}

.create-work-files p {
  margin: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.create-work-files input[type="file"] {
  padding: 11px 12px;
  height: auto;
}

.create-work-visible-checkbox {
  margin-top: 2px;
}

@media (max-width: 760px) {
  .create-work-number-box {
    grid-template-columns: 1fr;
  }
}


/* v7.41.4: modern file inputs */
.modern-file-picker {
  display: grid;
  gap: 7px;
}

.modern-file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.modern-file-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

.modern-file-control:hover {
  border-color: rgba(31, 92, 196, .28);
  background: #f7faff;
  box-shadow: 0 16px 38px rgba(31, 92, 196, .08);
  transform: translateY(-1px);
}

.modern-file-control strong {
  display: block;
  color: #1f5cc4;
  font-size: 13px;
  font-weight: 950;
  margin-bottom: 3px;
}

.modern-file-control em {
  display: block;
  color: #667085;
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modern-file-control em.has-files {
  color: #101828;
  font-weight: 800;
}

.modern-file-control b {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1f5cc4;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.modern-file-input:focus + .modern-file-control {
  outline: 3px solid rgba(31, 92, 196, .14);
  border-color: rgba(31, 92, 196, .38);
}


/* v7.42: scoped audit log */
.audit-page-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.audit-page-counter {
  min-width: 120px;
  border: 1px solid rgba(226,232,240,.96);
  background: #fbfdff;
  border-radius: 16px;
  padding: 12px;
  text-align: right;
}

.audit-page-counter span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.audit-page-counter strong {
  display: block;
  color: #101828;
  font-size: 24px;
  letter-spacing: -.035em;
}

.audit-page-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 170px 210px 170px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

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

.audit-page-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(226,232,240,.96);
  background: #fbfdff;
  border-radius: 16px;
  padding: 11px 12px;
}

.audit-page-main strong {
  display: block;
  color: #101828;
}

.audit-page-main span {
  display: block;
  color: #475467;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.35;
}

.audit-page-main small {
  display: block;
  color: #667085;
  margin-top: 4px;
  font-size: 12px;
}

.audit-page-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  text-align: right;
}

.audit-page-meta small {
  width: 100%;
  color: #667085;
  font-size: 12px;
}

.audit-work-link {
  color: #1f5cc4;
  font-weight: 850;
  text-decoration: none;
}

.audit-work-link:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .audit-page-filters,
  .audit-page-row {
    grid-template-columns: 1fr;
  }

  .audit-page-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .audit-page-hero {
    flex-direction: column;
  }

  .audit-page-counter {
    width: 100%;
    text-align: left;
  }
}


/* v7.43: Application Draft Model */
.applications-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

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

.applications-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 170px 190px auto;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.applications-table {
  min-width: 1040px;
}

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

.staff-small-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.application-upload-card {
  max-width: 620px;
  width: min(620px, calc(100vw - 28px));
}

.application-editor-card {
  width: min(1120px, calc(100vw - 28px));
  max-width: 1120px;
}

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

.application-editor-section {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: #fff;
  padding: 13px;
}

.application-editor-section h3,
.application-section-head h3 {
  margin: 0 0 10px;
  color: #101828;
  font-size: 16px;
  letter-spacing: -.02em;
}

.application-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.application-editor-grid {
  display: grid;
  gap: 10px;
}

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

.application-editor-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.application-editor-grid .wide {
  grid-column: 1 / -1;
}

.application-editor-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.raw-textarea {
  min-height: 110px !important;
}

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

.application-purpose-item {
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 14px;
  background: #fbfdff;
  padding: 9px 10px;
  font-weight: 800;
  color: #344054;
}

.application-purpose-item input {
  width: 16px;
  height: 16px;
}

#applicationIndicatorsList {
  display: grid;
  gap: 10px;
}

.application-indicator-row {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fbfdff;
  padding: 10px;
}

.application-indicator-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.application-indicator-row-head strong {
  color: #101828;
}

.application-indicator-grid {
  display: grid;
  grid-template-columns: 70px minmax(160px, .9fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 8px;
}

.application-create-work-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .75fr);
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, #fff, #f7faff);
  border-color: rgba(31,92,196,.18);
}

.application-create-work-section p {
  margin: 4px 0 0;
}

.application-create-work-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1280px) {
  .applications-hero,
  .application-create-work-section {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .applications-filters,
  .application-editor-grid.two,
  .application-editor-grid.three,
  .application-purpose-grid,
  .application-indicator-grid,
  .application-create-work-grid {
    grid-template-columns: 1fr;
  }

  .applications-hero-actions {
    justify-content: flex-start;
  }
}


/* v7.43.1: application as source inside work card */
.work-application-card {
  border-color: rgba(31,92,196,.16);
}

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

.work-application-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.work-application-summary div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fbfdff;
  padding: 10px;
}

.work-application-summary span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 5px;
}

.work-application-summary strong {
  color: #101828;
}

.work-application-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr);
  gap: 12px;
  margin-bottom: 12px;
}

.work-application-grid section,
.work-application-section {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.work-application-grid h3,
.work-application-section h3 {
  margin: 0 0 8px;
  color: #101828;
  font-size: 15px;
  letter-spacing: -.01em;
}

.work-application-grid p {
  margin: 0 0 6px;
}

.work-application-purpose-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.work-application-indicators {
  display: grid;
  gap: 8px;
}

.work-application-indicators div {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 14px;
  background: #fbfdff;
  padding: 9px 10px;
}

.work-application-indicators strong,
.work-application-indicators span,
.work-application-indicators small {
  display: block;
}

.work-application-indicators strong {
  color: #101828;
}

.work-application-indicators span,
.work-application-indicators small {
  color: #667085;
  margin-top: 3px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .work-application-summary,
  .work-application-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .work-application-summary,
  .work-application-grid {
    grid-template-columns: 1fr;
  }

  .work-application-actions {
    justify-content: flex-start;
  }
}


/* v7.44: Workbench + requires attention */
.workbench-hero,
.workbench-filter-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.workbench-hero {
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff, #f7faff);
  border-color: rgba(31, 92, 196, .16);
}

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

.workbench-filter-card {
  margin-bottom: 12px;
}

.workbench-filter-row label {
  display: grid;
  gap: 6px;
  min-width: 260px;
}

.workbench-filter-row label span {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.workbench-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.workbench-kpi {
  border: 1px solid rgba(226,232,240,.96);
  background: #fff;
  border-radius: 18px;
  padding: 13px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .045);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.workbench-kpi:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 92, 196, .26);
  box-shadow: 0 18px 42px rgba(31, 92, 196, .08);
}

.workbench-kpi span,
.workbench-kpi em {
  display: block;
  color: #667085;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.workbench-kpi strong {
  display: block;
  color: #101828;
  font-size: 28px;
  letter-spacing: -.045em;
  margin: 5px 0 3px;
}

.workbench-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.workbench-section {
  border: 1px solid rgba(226,232,240,.96);
  background: #fff;
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,.04);
  scroll-margin-top: 18px;
}

.workbench-section.attention-highlight {
  outline: 4px solid rgba(31, 92, 196, .14);
}

.workbench-section header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.workbench-section header h2 {
  margin: 0;
  color: #101828;
  font-size: 16px;
  letter-spacing: -.02em;
}

.workbench-section header p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.workbench-section header > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1f5cc4;
  font-weight: 950;
}

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

.workbench-item {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 16px;
  background: #fbfdff;
  padding: 10px;
}

.application-attention-item {
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.workbench-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.workbench-item-head strong {
  color: #101828;
  font-size: 14px;
}

.workbench-item-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.workbench-item-main {
  color: #344054;
  font-weight: 850;
  font-size: 13px;
  line-height: 1.35;
}

.workbench-item-sub {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workbench-item-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.workbench-item-dates {
  display: grid;
  gap: 3px;
  color: #667085;
  font-size: 12px;
  margin-top: 7px;
}

@media (max-width: 1380px) {
  .workbench-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .workbench-hero,
  .workbench-filter-row {
    flex-direction: column;
  }

  .workbench-hero-actions {
    justify-content: flex-start;
  }

  .workbench-filter-row label,
  .workbench-filter-row button {
    width: 100%;
  }

  .workbench-kpi-grid,
  .workbench-layout {
    grid-template-columns: 1fr;
  }
}


/* v7.45: Status workflow + smart checks */
.readiness-panel {
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 12px;
  margin-top: 12px;
}

.readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.readiness-head strong,
.quick-actions-head strong {
  display: block;
  color: #101828;
}

.readiness-head span,
.quick-actions-head span {
  display: block;
  color: #667085;
  font-size: 12px;
  margin-top: 3px;
}

.readiness-score {
  text-align: right;
  min-width: 72px;
}

.readiness-score b {
  display: block;
  color: #101828;
  font-size: 18px;
  letter-spacing: -.03em;
}

.readiness-score small {
  color: #667085;
  font-weight: 850;
}

.readiness-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
  margin-bottom: 10px;
}

.readiness-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f5cc4, #4f8cff);
}

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

.readiness-check {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 14px;
  background: #fff;
  padding: 9px;
}

.readiness-check i {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-style: normal;
  font-weight: 950;
}

.readiness-check.ok i {
  background: #e8f8ef;
  color: #18794e;
}

.readiness-check.warning i {
  background: #fff4e5;
  color: #b54708;
}

.readiness-check.info i {
  background: #eef5ff;
  color: #1f5cc4;
}

.readiness-check strong {
  display: block;
  color: #101828;
  font-size: 13px;
}

.readiness-check span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.workflow-actions-list .quick-action-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.workflow-actions-list .quick-action-button b {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff4e5;
  color: #b54708;
  font-size: 11px;
  font-weight: 950;
}

.quick-action-warning-box {
  border: 1px solid rgba(245, 158, 11, .3);
  background: #fffaf0;
  border-radius: 14px;
  padding: 10px;
  color: #7a2e0e;
}

.quick-action-warning-box strong {
  color: #7a2e0e;
}

.quick-action-warning-box ul {
  margin: 8px 0;
  padding-left: 18px;
}

.quick-action-warning-box li {
  margin: 3px 0;
}

.quick-action-warning-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pill.danger {
  background: #fff1f3;
  color: #b42318;
}

@media (max-width: 980px) {
  .readiness-checks {
    grid-template-columns: 1fr;
  }

  .readiness-head {
    flex-direction: column;
  }

  .readiness-score {
    text-align: left;
  }
}


/* v7.46: DOCX application parser */
.application-parser-notice {
  border: 1px solid rgba(31, 92, 196, .16);
  background: #f7faff;
  border-radius: 16px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.application-parser-notice strong {
  color: #101828;
  font-size: 13px;
}

.application-parser-notice span {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

/* v0.7.5: application upload that does not depend on Windows chooser filtering */
.application-file-field {
  display: grid;
  gap: 7px;
}

.application-file-field-label {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.application-picker-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.application-file-dropzone {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 13px;
  border: 1px dashed rgba(31, 92, 196, .38);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.application-file-dropzone:hover,
.application-file-dropzone:focus-visible,
.application-file-dropzone.is-dragover {
  border-color: rgba(31, 92, 196, .72);
  background: #eef5ff;
  box-shadow: 0 14px 34px rgba(31, 92, 196, .10);
}

.application-file-dropzone.is-dragover {
  transform: translateY(-1px);
}

.application-file-dropzone.has-file {
  border-style: solid;
  border-color: rgba(22, 163, 74, .35);
  background: #f8fffb;
}

.application-file-drop-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #1f5cc4;
  color: #fff;
  font-size: 21px;
  font-weight: 950;
}

.application-file-dropzone.has-file .application-file-drop-icon {
  background: #16803d;
}

.application-file-drop-copy {
  min-width: 0;
}

.application-file-drop-copy strong,
.application-file-drop-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-file-drop-copy strong {
  color: #101828;
  font-size: 13px;
  font-weight: 950;
}

.application-file-drop-copy span {
  margin-top: 4px;
  color: #667085;
  font-size: 11px;
}

.application-file-drop-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-button {
  min-height: 34px !important;
  padding: 0 11px !important;
  font-size: 11px !important;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(208, 218, 232, .95);
  border-radius: 11px;
  background: #fff;
  color: #344054;
  padding: 0 13px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.ghost-button:hover {
  border-color: rgba(31, 92, 196, .28);
  color: #1f5cc4;
  background: #f8fbff;
}

.application-file-fallback-hint {
  margin: 0;
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .application-file-dropzone {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .application-file-drop-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* v0.7.10 — protection against concurrent editing of the same work */
.work-edit-meta {
  display: flex;
  align-items: center;
  min-height: 30px;
  margin: -4px 0 14px;
  padding: 6px 10px;
  border: 1px solid rgba(16, 43, 78, 0.10);
  border-radius: 9px;
  background: rgba(16, 43, 78, 0.035);
  color: #637083;
  font-size: 12px;
  line-height: 1.35;
}

.work-conflict-backdrop {
  z-index: 1200;
}

.work-conflict-card {
  width: min(620px, calc(100vw - 32px));
}

.work-conflict-body {
  display: grid;
  gap: 16px;
}

.work-conflict-message {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(177, 92, 27, 0.22);
  border-radius: 10px;
  background: rgba(255, 246, 234, 0.82);
}

.work-conflict-message strong {
  color: #6e3b13;
  font-size: 14px;
}

.work-conflict-message span {
  color: #755f4d;
  font-size: 13px;
  line-height: 1.45;
}

.work-conflict-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.work-conflict-facts > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(16, 43, 78, 0.09);
  border-radius: 9px;
  background: #f8fafc;
}

.work-conflict-facts span {
  color: #7b8796;
  font-size: 11px;
}

.work-conflict-facts strong {
  overflow-wrap: anywhere;
  color: #1c2f45;
  font-size: 13px;
}

@media (max-width: 640px) {
  .work-conflict-facts {
    grid-template-columns: 1fr;
  }

  .work-edit-meta {
    align-items: flex-start;
  }
}
