:root {
  --bg: #F8FAFC;
  --surface: #ffffff;
  --surface-soft: #F1F5F9;
  --text: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --brand: #B3CEE2;
  --brand-dark: #116ACC;
  --brand-contrast: #182233;
  --blue: #116ACC;
  --danger: #EB5757;
  --warning: #E2B93B;
  --success: #27AE60;
  --sidebar: #ffffff;
  --sidebar-soft: #F8FAFC;
  --shadow: 0 12px 30px rgba(25, 42, 70, .06);
  --shadow-soft: 0 4px 16px rgba(25, 42, 70, .05);
  --app-font: "Google Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --control-height: 38px;
  --control-radius: 9px;
  --gap: 12px;
  --checkbox-accent: #116ACC;
}

/* Profile dashboard */
.profile-titlebar {
  align-items: flex-end;
}

.profile-overview-panel {
  overflow: hidden;
}

.profile-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-avatar-frame {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e8f7f3, #f8fbff);
  border: 1px solid rgba(22, 160, 133, 0.24);
  color: var(--brand-dark);
  font-size: 34px;
  font-weight: 800;
}

.profile-avatar-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-avatar-frame--small {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
  font-size: 22px;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-kicker {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-identity-copy h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.profile-identity-copy p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-company-badge {
  max-width: min(100%, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}

.profile-metric {
  display: grid;
  gap: 8px;
  min-height: 116px;
}

.profile-metric span,
.profile-storage-row,
.profile-storage-foot,
.profile-recent-item span {
  color: var(--muted);
}

.profile-metric strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.profile-metric small {
  color: var(--muted);
}

.profile-metric-title {
  min-width: 0;
}

.profile-metric-title--workspace {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(22px, 2vw, 24px);
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-metric-copy--workspace {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.2;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: var(--gap);
  margin-top: var(--gap);
  align-items: start;
}

.profile-settings-form {
  display: grid;
  gap: 20px;
}

.profile-avatar-control {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.profile-avatar-tools {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.profile-avatar-tools label {
  color: var(--text);
  font-weight: 700;
}

.profile-avatar-tools input[type="file"] {
  max-width: 100%;
}

.profile-avatar-tools small {
  color: var(--muted);
}

.profile-remove-avatar {
  align-self: start;
}

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

.profile-security-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  background: #fff;
}

.profile-security-box h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.profile-security-box p {
  margin: 0;
}
.mfa-security-box {
  margin-top: 20px;
  scroll-margin-top: 90px;
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--brand) 4%, #fff));
}
.mfa-security-head,
.mfa-enabled-summary,
.mfa-inline-form {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mfa-security-head {
  justify-content: space-between;
}
.mfa-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr);
  gap: 18px;
  align-items: start;
}
.mfa-setup-steps {
  display: grid;
  gap: 10px;
}
.mfa-setup-steps > div {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 10px;
}
.mfa-setup-steps > div > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in srgb, var(--brand) 14%, #fff);
}
.mfa-secret-card,
.mfa-recovery-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}
.mfa-secret-card code {
  padding: 10px;
  overflow-wrap: anywhere;
  border-radius: 8px;
  color: var(--brand-dark);
  background: var(--surface-soft);
}
/* MFA setup v2 */
.mfa-setup-v2 {
  display: grid;
  gap: 0;
}
.mfa-setup-left {
  display: grid;
  gap: 28px;
  align-content: start;
}
.mfa-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.mfa-step-head--center {
  justify-content: center;
  text-align: center;
}
.mfa-step-num {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.mfa-step-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}
.mfa-step-text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.mfa-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mfa-app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.mfa-app-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--brand-dark);
}
.mfa-scan-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.mfa-scan-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.mfa-scan-panel .mfa-step-head {
  width: 100%;
  margin-bottom: 0;
}
.mfa-qr-frame {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.mfa-qr-canvas {
  display: block;
  width: 176px;
  height: 176px;
}
.mfa-secret-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}
.mfa-secret-key-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.mfa-secret-key-text small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mfa-secret-key-text code {
  overflow-wrap: anywhere;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--brand-dark);
}
.mfa-copy-btn {
  flex: 0 0 auto;
  padding: 8px 10px;
}
.mfa-copy-btn .icon {
  width: 18px;
  height: 18px;
}
.mfa-verify {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.mfa-verify .mfa-step-head {
  margin-bottom: 18px;
}
.mfa-otp-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.mfa-otp-input {
  width: 56px;
  height: 64px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: #fff;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-dark);
}
.mfa-otp-input:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-dark) 18%, transparent);
}
.mfa-verify-actions {
  display: flex;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.mfa-verify-submit {
  flex: 2 1 0;
  justify-content: center;
}
.mfa-verify-back {
  flex: 1 1 0;
  justify-content: center;
}
@media (max-width: 640px) {
  .mfa-otp-input {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }
  .mfa-verify-actions {
    flex-direction: column;
  }
}
.mfa-inline-form {
  align-items: end;
  flex-wrap: wrap;
}
.mfa-inline-form .field {
  min-width: 220px;
  flex: 1;
}
.mfa-enabled-summary {
  padding: 16px;
  border-radius: var(--control-radius);
  color: var(--success);
  background: color-mix(in srgb, var(--success) 8%, #fff);
}
.mfa-enabled-summary .icon {
  width: 28px;
  height: 28px;
}
.mfa-enabled-summary strong,
.mfa-enabled-summary span {
  display: block;
}
.mfa-enabled-summary span {
  margin-top: 3px;
  color: var(--muted);
}
.mfa-recovery-panel {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
  background: color-mix(in srgb, var(--warning) 6%, #fff);
}
.mfa-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mfa-recovery-grid code {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255,255,255,.78);
}
.mfa-policy-choice {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-soft);
}
.mfa-policy-choice span,
.mfa-policy-choice strong,
.mfa-policy-choice small {
  display: block;
}
.mfa-policy-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}
.user-mfa-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--brand) 4%, #fff);
}
.user-mfa-status,
.user-mfa-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-mfa-status > div > strong,
.user-mfa-status > div > span {
  display: block;
}
.user-mfa-status > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.user-mfa-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 13%, #fff);
}
@media (max-width: 720px) {
  .user-mfa-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .user-mfa-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 720px) {
  .mfa-setup-grid {
    grid-template-columns: 1fr;
  }
  .mfa-security-head {
    align-items: flex-start;
  }
  .mfa-recovery-grid {
    grid-template-columns: 1fr;
  }
}

.profile-form-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-side-stack {
  display: grid;
  gap: var(--gap);
}

.profile-storage-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.profile-storage-row span {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.profile-storage-row strong {
  color: var(--muted);
  font-size: 13px;
}

.profile-storage-track {
  height: 10px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.profile-storage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}

.profile-storage-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.profile-recent-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.profile-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.profile-recent-item:hover {
  border-color: rgba(22, 160, 133, 0.36);
  background: #f8fafc;
}

.profile-recent-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-recent-item strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .profile-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .profile-overview,
  .profile-identity,
  .profile-avatar-control {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-avatar-frame {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
  }

  .profile-avatar-frame--small {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .profile-metric-grid,
  .profile-form-fields {
    grid-template-columns: 1fr;
  }

  .profile-company-badge {
    max-width: 100%;
  }

  .profile-form-actions,
  .profile-form-actions .btn,
  .profile-quick-actions,
  .profile-quick-actions .inline-form,
  .profile-quick-actions .btn {
    width: 100%;
  }

  .profile-form-actions .btn,
  .profile-quick-actions .btn {
    justify-content: center;
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--app-font);
  font-optical-sizing: auto;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "GRAD" 0;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .18s ease;
}
.shell.is-sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 16px;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.96)),
    var(--sidebar);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 28px rgba(25, 42, 70, .035);
}

.brand, .auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  min-height: 58px;
  margin-bottom: 18px;
  padding: 7px 8px;
  border: 1px dashed color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 14px;
  background: rgba(255,255,255,.52);
}
.brand-copy {
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 42, 70, .08);
  overflow: hidden;
}
.brand-logo { display: block; width: 30px; height: 30px; object-fit: contain; }
.brand-name { color: var(--text); font-size: 17px; font-weight: 700; }
.brand-subtitle { color: var(--muted); font-size: 12px; }
.sidebar-toggle {
  display: inline-grid;
  place-items: center;
  position: absolute;
  top: 94px;
  right: -17px;
  z-index: 12;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(25, 42, 70, .12);
}
.sidebar-toggle:hover {
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand-dark) 28%, var(--line));
  background: #f8fbff;
}
.mobile-nav-toggle,
.mobile-sidebar-close,
.mobile-sidebar-backdrop {
  display: none;
}

.nav {
  display: grid;
  gap: 3px;
  align-content: start;
  grid-auto-rows: max-content;
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent;
  scrollbar-gutter: stable;
}
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 28%, transparent);
}
.nav-section {
  margin: 18px 12px 7px;
  color: #a0aec0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.icon,
svg.lucide,
i[data-lucide] {
  flex: 0 0 auto;
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.icon-lg,
svg.lucide.icon-lg,
i[data-lucide].icon-lg {
  width: 22px;
  height: 22px;
}
svg.lucide {
  stroke-width: 2;
}
.nav {
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
}
.nav-group {
  display: grid;
  gap: 4px;
}
.nav-group-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.nav-group-summary::-webkit-details-marker {
  display: none;
}
.nav-group-summary:hover {
  color: var(--brand-dark);
  background: rgba(15, 23, 42, .035);
}
.nav-group-summary .icon {
  display: none;
}
.nav-group-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-chevron {
  color: currentColor;
  font-size: 10px;
  transition: transform .16s ease;
}
.nav-group[open] .nav-chevron {
  transform: rotate(180deg);
}
.nav-group-links {
  display: grid;
  gap: 2px;
  padding-left: 6px;
}
.nav-link, .logout {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  color: #334155;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-link .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 0;
  color: #64748b;
  background: transparent;
  font-size: 13px;
}
.nav-link span,
.nav-link small {
  grid-column: 2;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-link span {
  align-self: end;
  color: inherit;
  font-weight: 650;
  line-height: 1.05;
}
.nav-link small {
  align-self: start;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}
.nav-link:hover, .logout:hover {
  color: var(--brand-dark);
  background: rgba(22, 160, 133, .065);
}
.nav-link.is-active,
.nav-link.is-hash-active {
  color: var(--brand-dark);
  background: transparent;
  box-shadow: none;
}
.nav-link.is-active .icon,
.nav-link.is-hash-active .icon {
  color: var(--brand-dark);
  background: transparent;
}
.nav-group.has-hash-active .nav-link.is-active:not(.is-hash-active) {
  color: var(--muted);
}
.nav-group.has-hash-active .nav-link.is-active:not(.is-hash-active) .icon {
  color: var(--muted);
}
.anchor-target {
  scroll-margin-top: 86px;
}
.nav-link-accent { margin-top: 6px; }

.sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 16%, white);
  font-weight: 700;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { max-width: 170px; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--muted); font-size: 12px; }
.logout {
  display: flex;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
}

.sidebar-help-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sidebar-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--brand-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sidebar-help-link:hover {
  border-color: color-mix(in srgb, var(--brand-dark) 24%, #d8e0ea);
  background: #f8fbff;
}
.sidebar-help-link .icon {
  width: 16px;
}
.notification-menu.has-unread summary .icon {
  animation: notification-bell-nudge 2.2s ease-in-out infinite;
  transform-origin: center;
  display: inline-block;
}
.notification-menu.has-unread summary:hover .icon,
.notification-menu.has-unread[open] summary .icon {
  animation-play-state: paused;
}
@keyframes notification-bell-nudge {
  0%, 100% { transform: rotate(0deg); }
  8% { transform: rotate(0deg); }
  14% { transform: rotate(-12deg); }
  20% { transform: rotate(10deg); }
  26% { transform: rotate(-8deg); }
  32% { transform: rotate(6deg); }
  38% { transform: rotate(0deg); }
}
.notifications-feed {
  max-height: min(56vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.legal {
  display: grid;
  gap: 2px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.legal strong {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 11px;
  font-weight: 600;
}
.legal span { display: block; }

.shell.is-sidebar-collapsed .sidebar {
  align-items: center;
  padding-inline: 12px;
}
.shell.is-sidebar-collapsed .brand {
  justify-content: center;
  width: 100%;
  padding-inline: 6px;
}
.shell.is-sidebar-collapsed .brand-copy,
.shell.is-sidebar-collapsed .nav-group-summary span,
.shell.is-sidebar-collapsed .nav-chevron,
.shell.is-sidebar-collapsed .nav-link span,
.shell.is-sidebar-collapsed .nav-link small,
.shell.is-sidebar-collapsed .logout span,
.shell.is-sidebar-collapsed .legal {
  display: none;
}
.shell.is-sidebar-collapsed .sidebar-toggle {
  right: -17px;
  width: 34px;
}
.shell.is-sidebar-collapsed .nav,
.shell.is-sidebar-collapsed .sidebar-nav,
.shell.is-sidebar-collapsed .nav-group,
.shell.is-sidebar-collapsed .nav-group-links,
.shell.is-sidebar-collapsed .sidebar-footer,
.shell.is-sidebar-collapsed .sidebar-footer form {
  width: 100%;
}
.shell.is-sidebar-collapsed .nav-group-summary,
.shell.is-sidebar-collapsed .nav-link,
.shell.is-sidebar-collapsed .logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 42px;
  margin-inline: auto;
  padding: 0;
}
.shell.is-sidebar-collapsed .nav-group-links {
  padding-left: 0;
}
.shell.is-sidebar-collapsed .nav-link .icon,
.shell.is-sidebar-collapsed .nav-group-summary .icon {
  width: 18px;
  height: 18px;
}
.shell.is-sidebar-collapsed .sidebar-footer {
  align-items: center;
  padding-top: 12px;
}

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}
.topbar-title {
  min-width: 0;
}
.topbar strong { display: block; font-size: 18px; }
.topbar-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notification-menu {
  position: relative;
}
.notification-menu summary {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-soft);
}
.notification-menu summary::-webkit-details-marker { display: none; }
.notification-menu summary:hover {
  border-color: color-mix(in srgb, var(--brand-dark) 32%, var(--line));
  color: var(--brand-dark);
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #ef4444;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(440px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 24%, var(--line));
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 22px 52px rgba(25, 42, 70, .16);
}
.notification-panel::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 16%, transparent);
  border-radius: 16px;
  pointer-events: none;
  opacity: .55;
}
.notification-panel-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 12px;
}
.notification-panel-hero-copy {
  min-width: 0;
}
.notification-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: color-mix(in srgb, var(--brand-dark) 78%, var(--muted));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.notification-panel-hero-copy strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
}
.notification-panel-hero-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.notification-panel-hero-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex-shrink: 0;
}
.notification-panel-hero-actions form { margin: 0; }
.notification-panel-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 28%, var(--line));
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 7%, #fff);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.notification-panel-mark-read {
  border: 1px solid color-mix(in srgb, var(--brand-dark) 18%, var(--line));
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--brand-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.notification-panel-mark-read:hover {
  border-color: color-mix(in srgb, var(--brand-dark) 30%, var(--line));
  background: #f8fbff;
}
.notification-summary-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 0 12px;
}
.notification-section-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 8px;
}
.notification-section-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.notification-section-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.notification-summary-list { display: none; }
.notification-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 18%, #d7deea);
  border-radius: 8px;
  color: #475569;
  background: #fff;
}
.notification-summary-card:hover {
  border-color: color-mix(in srgb, var(--brand-dark) 26%, #cfd8e6);
  background: #f8fbff;
}
.notification-summary-copy {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.notification-summary-copy .icon {
  width: 18px;
  color: var(--brand-dark);
}
.notification-summary-copy span {
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}
.notification-summary-card strong {
  color: var(--brand-dark);
  font-size: 14px;
  line-height: 1;
}
.notification-summary-card.is-active {
  border-color: color-mix(in srgb, var(--brand-dark) 24%, #d7deea);
  background: color-mix(in srgb, var(--brand-dark) 5%, #fff);
}
.notification-summary-card.is-danger {
  border-color: color-mix(in srgb, var(--danger) 24%, #d7deea);
  background: color-mix(in srgb, var(--danger) 5%, #fff);
}
.notification-summary-card.is-danger .icon,
.notification-summary-card.is-danger strong {
  color: var(--danger);
}
.notification-list {
  position: relative;
  z-index: 1;
  display: grid;
  max-height: 300px;
  overflow: auto;
}
.notification-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: #f8fbff; }
.notification-item.is-unread {
  background: color-mix(in srgb, var(--brand-dark) 6%, #fff);
}
.notification-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 11%, #fff);
}
.notification-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.notification-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
}
.notification-item span span {
  display: block;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}
.notification-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.notification-empty {
  padding: 22px 18px;
  color: var(--muted);
  text-align: center;
}
.notification-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--brand-dark) 18%, var(--line));
  border-radius: 12px;
  color: var(--brand-dark);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}
.notification-footer:hover {
  border-color: color-mix(in srgb, var(--brand-dark) 32%, var(--line));
  background: #eef5ff;
}
.notifications-page {
  display: grid;
  gap: 16px;
}
.notifications-page-summary {
  border: 1px solid var(--line);
  border-radius: 16px;
}
.notifications-feed {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.language-menu {
  position: relative;
  display: inline-block;
  color: var(--muted);
}
.language-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-soft);
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary .icon { width: 16px; color: var(--muted); }
.language-menu summary span {
  min-width: 22px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.language-chevron {
  color: var(--muted);
  font-size: 10px;
  transition: transform .18s ease;
}
.language-menu[open] .language-chevron { transform: rotate(180deg); }
.language-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 25;
  display: grid;
  gap: 4px;
  min-width: 176px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.language-menu-panel a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  transition: all 0.15s ease;
}
.language-menu-panel a strong {
  color: var(--muted);
  font-size: 12px;
  transition: color 0.15s ease;
}
.language-menu-panel a span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.language-menu-panel a:hover {
  border-color: color-mix(in srgb, var(--brand-dark) 14%, var(--line));
  background: var(--surface-soft);
}
.language-menu-panel a.is-active {
  border-color: color-mix(in srgb, var(--brand) 20%, transparent);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface-soft));
  position: relative;
  padding-right: 28px;
}
.language-menu-panel a:hover strong {
  color: var(--brand-dark);
}
.language-menu-panel a.is-active strong {
  color: var(--brand-dark);
}
.language-menu-panel a:hover span {
  color: var(--brand-dark);
}
.language-menu-panel a.is-active span {
  color: var(--text);
  font-weight: 500;
}
.language-menu-panel a.is-active::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  font-size: 11px;
  color: var(--brand);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.mobile-language-switch {
  display: none;
}
.user-menu {
  position: relative;
}
.user-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height);
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  cursor: pointer;
  list-style: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.user-menu-identity {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}
.user-menu-identity strong {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-identity span {
  max-width: 140px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  width: 300px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.metric {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-soft);
}
.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.metric strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.page {
  width: 100%;
  padding: 24px 26px 40px;
}
.page--dictionary {
  padding-right: clamp(18px, 1.8vw, 34px);
}
/* titlebar: fluid, long filenames must not overflow */
.titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.title-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: 0; overflow-wrap: anywhere; }
h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}
.titlebar > div:first-child { min-width: 200px; flex: 1 1 auto; }
.page-subtitle { margin-top: 4px; color: var(--muted); word-break: break-all; overflow-wrap: anywhere; }

.grid { display: grid; gap: var(--gap); }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  margin-bottom: 14px;
}
.dashboard-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.card, .panel {
  background: var(--surface);
  border: 1px solid rgba(226, 233, 243, .88);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.card { padding: 18px; }
.report-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.report-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 86px;
  gap: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, #fff), #fff 58%);
}
.report-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.report-stat .stat-value {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  margin-top: 0;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 22px;
}
.panel { padding: 18px; margin-bottom: 16px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stat-value { margin-top: 8px; font-size: 24px; font-weight: 700; }
.stat-hint { margin-top: 6px; color: var(--muted); font-size: 12px; }
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 16%, white);
}
.stats > .card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96)),
    var(--surface);
}
.stats > .card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 82px;
  height: 54px;
  border-radius: 54px 0 0 0;
  background: color-mix(in srgb, var(--brand-dark) 7%, transparent);
  pointer-events: none;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.toolbar > .btn,
.toolbar > button,
.toolbar > .inline-form {
  align-self: end;
}
.toolbar > .btn,
.toolbar > button {
  width: 100%;
}
.toolbar > .inline-form .btn { width: 100%; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
label { color: var(--muted); font-size: 12px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}
select[multiple] { min-height: 92px; padding: 7px 10px; }
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.ocr-terminal-field,
.terminal-field {
  gap: 10px;
}
.ocr-terminal,
.terminal-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: #202124;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 18px 46px rgba(15, 23, 42, .16);
}
.ocr-terminal-head,
.terminal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .72);
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
}
.ocr-terminal-method,
.terminal-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px;
  color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .05);
  font-weight: 800;
  letter-spacing: .04em;
}
.ocr-terminal-route,
.terminal-route {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ocr-terminal-body,
.terminal-body {
  padding: 16px;
}
.ocr-terminal textarea,
.terminal-panel textarea {
  min-height: 240px;
  border: none !important;
  border-radius: 10px;
  background: #28292c;
  color: rgba(255, 255, 255, .86);
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}
.ocr-terminal textarea::placeholder,
.terminal-panel textarea::placeholder {
  color: rgba(255, 255, 255, .42);
}
.ocr-terminal textarea:focus,
.terminal-panel textarea:focus {
  border: none !important;
  box-shadow: none !important;
}
.terminal-help {
  margin-top: 10px;
  color: rgba(255, 255, 255, .6);
  font-size: 12px;
  line-height: 1.55;
}
.terminal-help-label {
  display: block;
  margin-bottom: 6px;
}
.terminal-help-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.terminal-help-vars--described {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.terminal-help-vars--described span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}
.terminal-help-vars--described em {
  min-width: 0;
  color: rgba(255, 255, 255, .58);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-help code {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 7px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .86);
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 12px;
}
input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: auto;
}
input[type="color"] {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 4px;
  background: #fff;
  cursor: pointer;
}
input[type="file"] {
  min-height: var(--control-height);
  padding: 4px;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #fff; }
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
}
.checkbox-label:hover {
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #fff;
  color: var(--checkbox-accent);
  cursor: pointer;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.checkbox-label input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--checkbox-accent);
  transform: scale(0);
  transform-origin: center;
  transition: transform .12s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M6.2 11.3 2.8 7.9l1.4-1.4 2 2 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M6.2 11.3 2.8 7.9l1.4-1.4 2 2 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.checkbox-label input[type="checkbox"]:hover {
  border-color: #64748b;
}
.checkbox-label input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--checkbox-accent) 18%, transparent);
}
.checkbox-label input[type="checkbox"]:checked {
  border-color: #94a3b8;
  background: #fff;
  box-shadow: none;
}
.checkbox-label input[type="checkbox"]:checked::before {
  transform: scale(1);
}
.checkbox-label:has(input[type="checkbox"]:checked) {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  color: var(--text);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover {
  border-color: #94a3b8;
  background: var(--surface-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.btn.primary {
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand-dark) 34%, var(--line-strong));
  background: #fff;
}
.btn.primary:hover {
  color: var(--brand-dark);
  border-color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 7%, #fff);
}
.btn.blue {
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand-dark) 30%, var(--line-strong));
  background: #fff;
}
.btn.blue:hover {
  color: var(--brand-dark);
  border-color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 7%, #fff);
}
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn.danger:hover { background: #fff5f5; }

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
}
table { width: 100%; min-width: 880px; border-collapse: collapse; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f8faff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
tr:hover td { background: #f9fbff; }
tr:last-child td { border-bottom: 0; }
.cell-title strong { display: block; margin-bottom: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #3730a3;
  background: #eef2ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.badge.success { color: var(--success); background: #dcfce7; }
.badge.warning { color: var(--warning); background: #fef3c7; }
.badge.danger { color: var(--danger); background: #fee4e2; }
.badge.gray { color: #475569; background: #eef2f7; }
.badge.tag-colored {
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 13%, white);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.documents-list-table {
  min-width: 1040px;
}
.documents-list-table td {
  vertical-align: middle;
}
.documents-list-table .tag-list {
  align-items: center;
}
.documents-list-table th:nth-child(5),
.documents-list-table td:nth-child(5),
.documents-list-table th:nth-child(6),
.documents-list-table td:nth-child(6),
.documents-list-table th:nth-child(7),
.documents-list-table td:nth-child(7),
.documents-list-table th:nth-child(8),
.documents-list-table td:nth-child(8) {
  white-space: nowrap;
}
.dashboard-section {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dashboard-section-head h2 {
  margin-bottom: 4px;
}
.recent-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.activity-file-card {
  overflow: hidden;
  border: 1px solid rgba(226, 233, 243, .88);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.activity-file-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: 156px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .03), rgba(22, 160, 133, .08)),
    var(--surface-soft);
}
.activity-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.activity-file-fallback {
  display: none;
  color: var(--muted);
  font-size: 26px;
}
.activity-file-preview.is-empty .activity-file-fallback {
  display: grid;
}
.activity-file-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.activity-file-meta a {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}
.activity-file-meta a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-file-meta .icon {
  color: var(--muted);
  flex: 0 0 auto;
}
.activity-file-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.dashboard-files-panel {
  display: grid;
  gap: 14px;
}
.dashboard-file-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) minmax(180px, .8fr);
  gap: 12px;
}
.filter-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.filter-control .icon {
  position: absolute;
  left: 13px;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}
.filter-control input,
.filter-control select {
  width: 100%;
  padding-left: 40px;
  background-color: #fff;
}
.dashboard-files-wrap {
  background: #fff;
  border-color: var(--line);
}
.dashboard-files-table {
  min-width: 980px;
}
.dashboard-files-table th,
.dashboard-files-table td {
  vertical-align: middle;
}
.dashboard-files-table .cell-title a {
  display: grid;
  gap: 2px;
}
.dashboard-files-table .cell-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.dashboard-filter-empty {
  padding: 14px;
}
.empty-state {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 600;
}
.muted { color: var(--muted); }
.flash {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  background: #fff;
  font-weight: 700;
}
.flash.success { color: var(--success); border-color: #a7f3d0; background: #ecfdf5; }
.flash.error { color: var(--danger); border-color: #fecaca; background: #fff5f5; }

.settings-hub {
  display: grid;
  gap: 24px;
  margin-bottom: 18px;
}
.settings-hub section {
  display: grid;
  gap: 12px;
}
.settings-hub h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0;
}
.settings-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.settings-hub-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px 12px;
  min-height: 116px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: none;
}
.settings-hub-card:hover {
  border-color: var(--line);
  transform: none;
  box-shadow: var(--shadow-soft);
}
.settings-hub-card .icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--brand-dark);
  background: transparent;
}
.settings-hub-card strong {
  display: block;
  color: var(--brand-dark);
  font-size: 14px;
  line-height: 1.2;
}
.settings-hub-card span {
  grid-column: 2;
  color: #475569;
  font-size: 13px;
  line-height: 1.42;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.full { grid-column: 1 / -1; }
.template-active-field {
  align-self: end;
}
.branding-grid {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.color-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.color-card {
  display: grid;
  grid-template-columns: 1fr 34px;
  grid-template-areas:
    "label picker"
    "hex picker";
  align-items: center;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.color-card span {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.color-card input { grid-area: picker; }
.color-card input[type="color"] {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.color-card input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border: 0;
}
.color-card input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 9px;
}
.color-card input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 9px;
}
.color-card code {
  grid-area: hex;
  color: var(--text);
  font-family: var(--app-font);
  font-size: 13px;
  font-weight: 500;
}
.color-card:hover { background: color-mix(in srgb, var(--brand-dark) 7%, white); }
.brand-preview {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-color: #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.brand-preview img { max-width: 88px; max-height: 88px; object-fit: contain; }
.settings-preview {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, white), #fff 64%);
}
.settings-preview strong { color: var(--text); font-size: 20px; }
.settings-preview span { color: var(--muted); }
.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.integration-card {
  display: grid;
  gap: 12px;
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.integration-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.integration-card h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 15px;
}
.config-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.config-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.config-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.config-list dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.cron-code {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: normal;
}
.integration-note { margin: 14px 0 0; }
.storage-box-card {
  min-height: 260px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 14%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 30%),
    linear-gradient(135deg, #fff 0%, color-mix(in srgb, var(--surface-soft) 72%, white) 100%);
}
.storage-box-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.storage-box-metrics div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}
.storage-box-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.storage-box-metrics strong {
  color: var(--text);
  font-size: 20px;
}
.storage-admin-card {
  grid-column: 1 / -1;
}
.storage-admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.storage-admin-layout .config-list {
  align-content: start;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 62%, white);
}
.storage-admin-layout .config-list div {
  grid-template-columns: minmax(112px, .34fr) minmax(0, 1fr);
  min-width: 0;
}
.storage-admin-layout .config-list dd {
  line-height: 1.45;
  word-break: break-word;
}
.storage-ping-chart {
  position: relative;
  min-height: 156px;
  padding: 14px 14px 12px;
  overflow: hidden;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.storage-chart-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.storage-chart-head strong {
  color: #116ACC;
  font-size: 20px;
  letter-spacing: 0;
  text-transform: none;
}
.storage-ping-chart svg[hidden],
.storage-ping-empty[hidden] {
  display: none !important;
}
.storage-ping-chart svg {
  display: block;
  width: 100%;
  height: 118px;
  margin-top: 10px;
  overflow: hidden;
}
.storage-chart-area {
  fill: rgba(53, 122, 233, .28);
}
.storage-chart-line {
  fill: none;
  stroke: #357AE9;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 10px rgba(53, 122, 233, .20));
  vector-effect: non-scaling-stroke;
}
.storage-ping-chart.is-offline .storage-chart-area {
  fill: rgba(253, 78, 93, .18);
}
.storage-ping-chart.is-offline .storage-chart-line {
  stroke: #FD4E5D;
}
.storage-health-panel {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border-top: 0;
}
.storage-ping-chart--compact {
  min-height: 150px;
}
.storage-ping-chart--compact svg {
  height: 104px;
}
.storage-ping-empty {
  display: grid;
  min-height: 94px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}
.storage-box-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .62);
}
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.preview-button-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--brand-contrast);
  background: var(--brand);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}
.preview-button-sample.is-hover {
  color: #fff;
  background: var(--brand-dark);
}
.preview-kicker {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--surface-soft); overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
.detail-item label { display: block; margin-bottom: 5px; }
.payment-detail-item {
  grid-column: span 2;
  min-width: 0;
  position: relative;
  overflow: visible;
  z-index: 2;
}

.payment-detail-item:has(.cd-select.is-open) {
  z-index: 30;
}
.payment-status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, max-content);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  max-width: 100%;
}
.payment-status-form select {
  min-width: 0;
  width: 100%;
  height: 40px;
  border-color: #cbd5e1;
  background-color: #fff;
  color: var(--text);
}
.payment-status-form .btn {
  justify-content: center;
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.document-relations-grid {
  grid-template-columns: minmax(0, 1fr);
}
.document-workflow-grid {
  align-items: start;
}
@media (min-width: 821px) {
  .document-workflow-grid {
    grid-template-areas:
      "assignments approvals"
      "signatures signatures"
      "movement templates";
  }
  .document-workflow-grid > .workflow-column {
    display: contents;
  }
  .document-workflow-grid > .workflow-column:first-child > .panel:nth-child(1) { grid-area: assignments; }
  .document-workflow-grid > .workflow-column:first-child > .panel:nth-child(2) { grid-area: movement; }
  .document-workflow-grid > .workflow-column:nth-child(2) > .panel:nth-child(1) { grid-area: signatures; }
  .document-workflow-grid > .workflow-column:nth-child(2) > .panel:nth-child(2) { grid-area: approvals; }
  .document-workflow-grid > .workflow-column:nth-child(2) > .panel:nth-child(3) { grid-area: templates; }
}
.workflow-column {
  display: grid;
  gap: var(--gap);
  align-content: start;
  min-width: 0;
}
.report-workflow-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.report-panel {
  display: flex;
  flex-direction: column;
  min-height: 188px;
}
.report-panel h2 {
  flex: 0 0 auto;
  margin-bottom: 14px;
}
.report-panel-wide {
  grid-column: 1 / -1;
  grid-row: auto;
  min-height: 220px;
}
.report-panel-wide .table-wrap { flex: 1 1 auto; }
.report-panel-wide table { min-width: 720px; }
.workflow-list {
  display: grid;
  gap: 9px;
  align-content: start;
  flex: 1 1 auto;
}
.workflow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}
.workflow-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}
.workflow-item div span {
  color: var(--muted);
  font-size: 12px;
}
.workflow-item form {
  display: flex;
  align-items: center;
  gap: 14px;
}
.workflow-item form .cd-select {
  min-width: 130px;
}
.workflow-item form .btn {
  height: 42px;
  min-width: 64px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .workflow-item {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .workflow-item form {
    width: 100%;
    justify-content: space-between;
  }
  .workflow-item form .cd-select {
    flex: 1;
  }
}
.workflow-item-stack {
  display: grid;
  align-items: stretch;
}
.workflow-route-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.approval-steps {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.approval-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
}
.approval-step.is-current {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
}
.approval-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--brand-contrast);
  background: var(--brand);
  font-size: 12px;
}
.approval-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-top: 8px;
}
.signature-signer-card {
  min-width: 0;
}
.signature-signer-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.signature-signer-copy strong {
  color: var(--text);
}
.signature-signer-status,
.signature-signer-reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.signature-signer-reason {
  color: var(--danger);
}
.signature-approval-actions {
  grid-column: 2 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.signature-approval-actions .btn {
  width: 100%;
  justify-content: center;
}
.signature-reject-form {
  grid-column: 2 / -1;
}
.signature-reject-form input,
.signature-reject-form .btn {
  grid-column: 1 / -1;
}
.compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.compact-form textarea,
.compact-form .btn {
  grid-column: 1 / -1;
}
.compact-form .field-hint {
  color: var(--muted);
  font-size: 12px;
}
.content-box { max-height: 430px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; }
.ai-quality-panel {
  display: grid;
  gap: 14px;
}
.ai-quality-score {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}
.ai-quality-score.is-good {
  color: #047857;
  background: #d1fae5;
}
.ai-quality-score.is-warn {
  color: #92400e;
  background: #fef3c7;
}
.ai-quality-score.is-danger {
  color: #991b1b;
  background: #fee2e2;
}
.ai-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.ai-quality-item {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.ai-quality-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}
.ai-quality-item strong {
  color: var(--brand-dark);
  font-size: 14px;
}
.ai-quality-item small {
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-quality-item.is-review {
  border-color: color-mix(in srgb, var(--danger) 18%, var(--line));
  background: color-mix(in srgb, var(--danger) 4%, #fff);
}
.ai-quality-item.is-review strong {
  color: var(--danger);
}
.document-comments-panel .panel-head-row {
  margin-bottom: 12px;
}
.comments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .42fr);
  gap: 14px;
  align-items: start;
}
.comment-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-height: 252px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.comment-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}
.comment-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 800;
}
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comment-body {
  min-width: 0;
}
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.comment-meta strong {
  color: var(--text);
}
.comment-meta span {
  color: var(--muted);
  font-size: 12px;
}
.comment-body p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.comment-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  background: #f8fafc;
}
.comment-empty .icon {
  width: auto;
  color: var(--brand-dark);
  font-size: 20px;
}
.comment-empty strong {
  color: var(--text);
}
.comment-form {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.comment-form textarea {
  min-height: 156px;
}
.mention-tools {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.mention-tools > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.mention-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mention-chip {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  color: #334155;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mention-chip:hover,
.mention-chip.is-selected {
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand-dark) 25%, #d8e0ea);
  background: #eef6ff;
}
.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comment-form-actions span {
  color: var(--muted);
  font-size: 12px;
}
.comment-form-actions .btn {
  flex: 0 0 auto;
}
.viewer-frame, .viewer-image { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.viewer-frame { height: 720px; }
.viewer-image { max-width: 100%; }
.viewer-lazy {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--control-radius);
  background: #f8fafc;
}
.viewer-lazy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.linked-documents-form {
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, .8fr) minmax(180px, 1fr) auto;
  align-items: end;
}
.linked-documents-form .btn {
  grid-column: 1;
  width: auto;
  min-width: 112px;
  justify-self: start;
  white-space: nowrap;
}
.workflow-grid > .panel > .compact-form:not(.linked-documents-form) .field-hint {
  grid-column: 1 / -1;
}
.workflow-grid > .panel > .compact-form:not(.linked-documents-form) .btn.primary,
.workflow-action-form .btn.primary {
  grid-column: 1;
  width: auto;
  min-width: 112px;
  justify-self: start;
  white-space: nowrap;
}
.signature-request-form > .field {
  min-width: 0;
}
.signature-request-form .signature-note-field,
.signature-request-form .signature-signers-field {
  display: grid;
  grid-template-rows: auto 96px auto;
  align-self: start;
  gap: 6px;
}
.signature-request-form .signature-note-field {
  grid-template-rows: auto auto auto;
}
.signature-request-form .signature-note-field textarea,
.signature-request-form .signature-signers-field select[multiple] {
  width: 100%;
  height: 96px;
  min-height: 96px;
}
.signature-request-form .signature-note-field textarea {
  max-height: 220px;
  resize: vertical;
  overflow: auto;
}
.signature-request-form .signature-note-field .field-hint,
.signature-request-form .signature-signers-field .field-hint {
  margin: 0;
}
.signature-request-form .signature-signers-field .field-hint {
  margin-top: 4px;
}

.auth-page {
  min-height: 100vh;
  padding: 0;
  background: #eef3f1;
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr);
  min-height: 100vh;
}
.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  padding: 42px;
  color: #fff;
  background: #0d322d;
  overflow: hidden;
}
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(13, 50, 45, .50), rgba(13, 50, 45, .12)),
    linear-gradient(180deg, transparent 42%, rgba(13, 50, 45, .74));
  pointer-events: none;
}
.auth-visual-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (prefers-reduced-motion: reduce) {
  .auth-visual-video {
    display: none;
  }
}
.auth-visual-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  max-width: 520px;
}
.auth-visual-content .preview-kicker { color: color-mix(in srgb, var(--brand) 72%, white); }
.auth-visual-content > strong {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.04;
}
.auth-visual-content > span {
  max-width: 440px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
}
.auth-visual-legal {
  width: fit-content;
  margin-top: 4px;
  padding: 0;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  line-height: 1.35;
}
.auth-visual-legal strong {
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}
.auth-visual-legal span {
  color: rgba(255,255,255,.58);
  font-size: 10px;
}
.auth-card {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 420px;
  margin: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .13);
}
.auth-brand { margin-bottom: 22px; }
.auth-brand .brand-name { color: var(--text); }
.auth-brand .brand-subtitle { color: var(--muted); }
.auth-card h1 { font-size: 24px; }
.auth-form { margin-top: 18px; }
.turnstile-field {
  min-height: 65px;
  display: flex;
  align-items: center;
}
.turnstile-field iframe {
  max-width: 100%;
}
.auth-language {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}
.inline-form { display: inline; }
.dropzone {
  border: 1px dashed #94a3b8;
  border-radius: var(--control-radius);
  background: #f8fafc;
  padding: 14px;
  transition: border-color .15s, background .15s;
}
.dropzone.is-dragging {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, white);
}
.dropzone input { margin-top: 10px; }
.upload-drop-head,
.upload-progress-top,
.upload-progress-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.upload-drop-head { margin-bottom: 5px; }
.upload-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 13%, white);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.upload-progress-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}
.upload-progress-card[hidden] { display: none; }
.upload-progress-top strong {
  display: block;
  max-width: min(560px, 68vw);
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-progress-top span,
.upload-progress-bottom {
  color: var(--muted);
  font-size: 12px;
}
.upload-progress-top b {
  min-width: 52px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 12%, white);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.upload-track {
  position: relative;
  height: 8px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}
.upload-track span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  transition: width .18s ease;
  overflow: hidden;
}
.upload-progress-card.is-uploading .upload-track span {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 0 16px color-mix(in srgb, var(--brand) 38%, transparent);
}
.upload-progress-card.is-uploading .upload-track span::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, .55) 50%,
    rgba(255, 255, 255, 0) 75%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: upload-shimmer 1.1s linear infinite;
  pointer-events: none;
}
.upload-progress-card.is-uploading .upload-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    transparent 0,
    transparent 8px,
    rgba(255, 255, 255, .35) 8px,
    rgba(255, 255, 255, .35) 16px
  );
  background-size: 22px 22px;
  animation: upload-stripes 0.8s linear infinite;
  opacity: .25;
  pointer-events: none;
  border-radius: inherit;
}
@keyframes upload-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes upload-stripes {
  from { background-position: 0 0; }
  to { background-position: 22px 0; }
}
.upload-progress-card.is-complete .upload-track span { background: linear-gradient(90deg, #16a085, #22c55e); }
.upload-progress-card.is-error .upload-track span { background: linear-gradient(90deg, #ef4444, #f97316); }
.upload-progress-card.is-error .upload-progress-top b {
  color: #b91c1c;
  background: #fee2e2;
}
.inline-panel { box-shadow: none; margin: 0; background: var(--surface-soft); }

.browser-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.browser-tree {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 16px;
}
.tree-head, .browser-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.tree-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tree-node-group {
  display: flex;
  flex-direction: column;
}
.tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.tree-node:hover {
  background: var(--surface-soft);
}
.tree-node.is-active {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 14%, white);
  font-weight: 700;
}
.tree-node.is-active strong {
  color: var(--brand-dark);
}
.tree-node-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tree-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 13.5px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-label i, .tree-label svg {
  color: var(--muted);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.tree-node.is-active .tree-label i, 
.tree-node.is-active .tree-label svg {
  color: var(--brand-dark);
}
.tree-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s ease;
}
.tree-chevron:hover {
  color: var(--text);
}
.tree-chevron i {
  font-size: 11px;
  transition: transform 0.2s ease;
}
.tree-chevron-placeholder {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.tree-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  background: var(--surface);
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
}
.tree-checkbox:hover {
  border-color: var(--brand-dark);
}
/* Checked state */
.tree-checkbox.checked {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.tree-checkbox.checked::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 7px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  top: 2px;
  left: 5px;
}
/* Indeterminate state */
.tree-checkbox.indeterminate {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.tree-checkbox.indeterminate::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: white;
  border-radius: 1px;
  top: 6px;
  left: 3px;
}
.tree-node strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
}
.tree-node.is-active strong {
  background: color-mix(in srgb, var(--brand-dark) 10%, white);
}
.tree-subnodes {
  position: relative;
  margin-left: 9px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 2px;
}
.tree-node-group.is-collapsed > .tree-subnodes {
  display: none;
}
.tree-node-group.is-collapsed > .tree-node .tree-chevron i {
  transform: rotate(0deg);
}
.tree-node-group.is-expanded > .tree-node .tree-chevron i {
  transform: rotate(90deg);
}
/* Drag and Drop styles */
.draggable-doc {
  cursor: grab;
}
.draggable-doc:active {
  cursor: grabbing;
}
.draggable-doc.is-dragging {
  opacity: 0.4;
  background: var(--surface-soft);
}
.tree-node.drag-hover {
  background: color-mix(in srgb, var(--brand-dark) 12%, white) !important;
  box-shadow: inset 0 0 0 2px var(--brand-dark);
}
.browser-documents { min-width: 0; }
.dictionary-table {
  min-width: 780px;
  table-layout: fixed;
}
.dictionary-table th:nth-child(1),
.dictionary-table td:nth-child(1) { width: 52px; }
.dictionary-table th:nth-child(2),
.dictionary-table td:nth-child(2) { width: auto; }
.dictionary-table th:nth-child(3),
.dictionary-table td:nth-child(3) { display: none; }
.dictionary-table th:nth-child(4),
.dictionary-table td:nth-child(4) { width: 150px; }
.dictionary-edit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
}
.dictionary-edit input,
.dictionary-edit select { max-width: 100%; }
.dictionary-edit input[type="color"] {
  width: 46px;
  min-width: 46px;
  padding: 4px;
  justify-self: start;
}
.color-field {
  max-width: 86px;
}
.color-field input[type="color"] {
  width: 54px;
  min-width: 54px;
}
.dictionary-table-tags {
  min-width: 1080px;
}
.dictionary-table-tags th:nth-child(1),
.dictionary-table-tags td:nth-child(1) { width: 52px; }
.dictionary-table-tags th:nth-child(4),
.dictionary-table-tags td:nth-child(4) { width: 152px; }
.dictionary-table-tags .dictionary-edit {
  grid-template-columns: minmax(180px, 1fr) 48px minmax(180px, 1fr) 180px 150px;
  gap: 8px;
  align-items: center;
}
.dictionary-table-tags .dictionary-edit input[type="color"] {
  justify-self: center;
}
.dictionary-table-tags .dictionary-edit .checkbox-label {
  justify-self: start;
  white-space: nowrap;
}
.dictionary-edit .checkbox-label {
  min-height: var(--control-height);
}
.dictionary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.dictionary-actions .btn {
  min-width: 0;
  padding-inline: 10px;
}
.dictionary-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  margin-bottom: 14px;
}
.dictionary-list-head h2 {
  margin-bottom: 4px;
}
.dictionary-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(320px, 100%);
}
.dictionary-search .icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}
.dictionary-search input {
  padding-left: 36px;
}
.dictionary-table-saas {
  min-width: 850px;
  table-layout: fixed;
}
.dictionary-table-saas th,
.dictionary-table-saas td {
  vertical-align: middle;
}
.dictionary-table-saas th:nth-child(1),
.dictionary-table-saas td:nth-child(1) {
  display: table-cell;
  width: 58px;
}
.dictionary-table-saas th:nth-child(2),
.dictionary-table-saas td:nth-child(2) {
  width: 20%;
}
.dictionary-table-saas th:nth-child(3),
.dictionary-table-saas td:nth-child(3) {
  display: table-cell;
  width: 22%;
}
.dictionary-table-saas th:nth-child(4),
.dictionary-table-saas td:nth-child(4) {
  width: 136px;
}
.dictionary-table-saas th:nth-child(5),
.dictionary-table-saas td:nth-child(5) {
  width: 150px;
}
.dictionary-table-saas th:last-child,
.dictionary-table-saas td:last-child {
  width: 212px;
}
.dictionary-table-saas.dictionary-table-tags {
  min-width: 1160px;
}
.dictionary-table-saas.dictionary-table-tags th:nth-child(3),
.dictionary-table-saas.dictionary-table-tags td:nth-child(3) {
  width: 78px;
  text-align: center;
}
.dictionary-table-saas.dictionary-table-tags th:nth-child(4),
.dictionary-table-saas.dictionary-table-tags td:nth-child(4) {
  width: 20%;
}
.dictionary-table-saas.dictionary-table-tags th:nth-child(5),
.dictionary-table-saas.dictionary-table-tags td:nth-child(5) {
  width: 220px;
}
.dictionary-table-saas.dictionary-table-tags th:nth-child(6),
.dictionary-table-saas.dictionary-table-tags td:nth-child(6) {
  width: 170px;
}
.dictionary-table-saas.dictionary-table-tags th:last-child,
.dictionary-table-saas.dictionary-table-tags td:last-child {
  width: 244px;
}
.dictionary-table-saas input[type="color"] {
  width: 48px;
  min-width: 48px;
  margin-inline: auto;
}
.dictionary-id {
  color: var(--muted);
  font-weight: 700;
}
.dictionary-checkbox {
  white-space: nowrap;
}
.dictionary-table-saas .dictionary-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 232px;
}
.dictionary-table-saas .dictionary-actions .btn {
  width: 112px;
  min-width: 112px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  flex: 0 0 112px;
}
.dictionary-table-saas .dictionary-actions .btn.blue {
  color: var(--brand-dark);
  border-color: rgba(22, 160, 133, .24);
  background: #fff;
}
.dictionary-table-saas .dictionary-actions .btn.blue:hover {
  color: var(--brand-dark);
  border-color: var(--brand-dark);
  background: rgba(22, 160, 133, .07);
}
.dictionary-table-saas .dictionary-actions .btn.danger {
  color: #7f1d1d;
  border-color: #eef2f7;
  background: #fff;
}
.dictionary-table-saas .dictionary-actions .btn.danger .icon {
  color: #dc2626;
}
.dictionary-table-saas .dictionary-actions .btn.danger:hover {
  color: #991b1b;
  border-color: rgba(239, 68, 68, .28);
  background: rgba(239, 68, 68, .07);
}
.dictionary-table-saas .dictionary-actions .inline-form {
  display: flex;
  align-items: center;
  flex: 0 0 112px;
  margin: 0;
}
.dictionary-table-saas .dictionary-actions .inline-form .btn {
  width: 100%;
}
.custom-field-list { margin-top: 8px; }
.document-type-list {
  display: grid;
  gap: 14px;
}
.document-type-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(252,254,255,.98)),
    #fff;
}
.document-type-card-head {
  display: grid;
  grid-template-columns: 52px minmax(150px, 220px) minmax(320px, 1fr) minmax(220px, auto);
  gap: 12px;
  align-items: end;
}
.document-type-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 12px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, white);
}
.document-type-title {
  display: grid;
  gap: 3px;
  align-self: center;
  min-width: 0;
}
.document-type-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.document-type-title strong {
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-type-edit-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 180px);
  gap: 10px;
}
.document-type-edit-fields label {
  display: grid;
  gap: 5px;
}
.document-type-edit-fields label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.document-type-actions {
  align-self: end;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-height: var(--control-height);
}
.document-type-fields-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.document-type-fields-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.document-type-fields-head strong {
  color: var(--brand-dark);
}
.document-type-fields-head span,
.document-type-empty {
  color: var(--muted);
  font-size: 12px;
}
.document-type-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}
.custom-field-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.custom-field-chip .btn {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.document-type-field-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) 120px minmax(150px, auto);
  gap: 10px;
  align-items: end;
}
.document-type-field-form .btn {
  width: 100%;
  white-space: nowrap;
}
.user-list {
  display: grid;
  gap: var(--gap);
}
.org-structure {
  display: grid;
  gap: 16px;
}
.access-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.access-guide-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--shadow-soft);
}
.access-guide-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 10%, white);
  font-size: 11px;
  font-weight: 800;
}
.access-guide-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 14px;
}
.access-guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.org-create-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.org-create-card h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 15px;
}
.panel-head-row,
.org-card-head,
.department-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head-row h2,
.department-head strong {
  margin: 0;
}
.org-create-form,
.org-title-form,
.department-title-form,
.department-create-form {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.org-create-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  width: 100%;
}
.org-title-form {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  width: 100%;
}
.org-meta-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.org-users-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 10%, white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.department-title-form,
.department-create-form {
  display: flex;
  align-items: center;
}
.org-create-form input,
.department-create-form input,
.department-title-form input,
.org-title-form input {
  min-width: 0;
}
.org-create-form input[name="address"],
.org-title-form input[name="address"] {
  grid-column: span 2;
}
.org-title-form input[name="name"] {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-dark);
}
.org-list,
.department-list {
  display: grid;
  gap: 14px;
}
.department-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.org-card,
.department-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.org-card {
  padding: 16px;
}
.org-section-title,
.org-subsection-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
.org-section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding-top: 2px;
}
.org-section-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.org-section-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.org-section-title .icon,
.org-subsection-title .icon {
  color: var(--brand-dark);
}
.department-card {
  padding: 12px;
  align-content: start;
}
.department-head {
  min-height: 38px;
}
.department-head > div {
  min-width: 0;
}
.department-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}
.department-head > span {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--surface-soft);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.department-title-form {
  flex: 1 1 auto;
}
.department-title-form .department-kicker {
  flex: 0 0 104px;
  margin: 0;
}
.department-title-form input[name="name"] {
  max-width: 220px;
  font-weight: 700;
}
.department-title-form input[name="description"] {
  flex: 1 1 240px;
}
.department-create-form {
  justify-content: flex-start;
  padding-top: 2px;
}
.department-create-form input[name="name"] {
  flex: 0 1 260px;
}
.department-create-form input[name="description"] {
  flex: 1 1 320px;
}
.department-create-form .btn {
  flex: 0 0 auto;
  min-width: 220px;
  padding-inline: 16px;
  white-space: nowrap;
}
.structure-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.structure-table {
  min-width: 760px;
  width: 100%;
}
.structure-table th,
.structure-table td {
  vertical-align: middle;
}
.structure-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.structure-user strong,
.structure-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.structure-user strong {
  color: var(--text);
}
.structure-user span {
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
}
.avatar-preview-sm {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
}
.btn.compact {
  min-height: 32px;
  padding: 6px 10px;
}
.user-create-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  padding-top: 4px;
}
.user-create-form > .field {
  align-content: start;
}
.user-create-form .create-user-avatar input[type="file"] {
  max-width: 260px;
}
.user-create-form .create-user-roles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
}
.user-create-form .create-user-roles > label {
  grid-column: 1 / -1;
}
.user-create-form .create-user-roles select {
  min-height: 72px;
}
.user-create-form .create-user-roles .role-guide {
  align-self: start;
  padding-top: 0;
}
.user-create-form .create-user-submit {
  grid-column: 4;
  align-self: start;
  justify-self: end;
  width: 100%;
  max-width: 200px;
  margin-top: 8px;
}
.user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.user-edit { display: grid; gap: var(--gap); min-width: 0; }
.user-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.user-card-head > div:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-top: 6px;
}
.avatar-control {
  display: grid;
  gap: 6px;
  justify-items: center;
  flex: 0 0 auto;
}
.avatar-picker {
  display: grid;
  gap: 6px;
  justify-items: center;
  cursor: pointer;
  user-select: none;
}
.avatar-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 12%, white);
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker:hover .avatar-preview,
.avatar-picker:focus-within .avatar-preview {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 14%, transparent);
}
.avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.user-card-head > div:last-child strong,
.user-card-head > div:last-child span {
  display: block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-head > div:last-child strong { color: var(--text); font-size: 15px; }
.user-card-head > div:last-child span { color: var(--muted); font-size: 12px; }
.user-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: var(--gap);
  align-items: start;
}
.user-fields label {
  display: grid;
  gap: 5px;
}
.user-fields label.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.user-fields .field-hint {
  display: block;
  max-width: 100%;
}
.user-role-field {
  grid-column: span 1;
}
.avatar-remove-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 2px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.avatar-remove-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.avatar-remove-option span {
  border-bottom: 1px solid transparent;
}
.avatar-remove-option:hover span {
  border-bottom-color: currentColor;
}
.avatar-remove-option:has(input:checked) {
  padding: 4px 8px;
  border-radius: 999px;
  color: #7f1d1d;
  background: rgba(239, 68, 68, .08);
}
.user-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
}
.user-card-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
}
.user-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.role-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 8px;
  margin-top: 8px;
}
.role-guide > span {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475569;
  background: color-mix(in srgb, var(--brand-dark) 4%, #fff);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.role-guide b {
  display: block;
  min-width: 0;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.plan-panel {
  display: grid;
  gap: 14px;
}
.plan-panel-head,
.plan-usage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan-panel-head h2 {
  margin-bottom: 4px;
}
.plan-usage {
  display: grid;
  gap: 9px;
}
.plan-usage-line strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}
.plan-usage-line span,
.plan-usage-line b,
.plan-note {
  color: var(--muted);
  font-size: 13px;
}

.billing-sections {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.billing-storage-panel,
.billing-tariffs-panel {
  display: grid;
  gap: 14px;
}
.billing-storage-overview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow-soft);
}

.storage-usage-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, auto) auto;
  align-items: end;
  gap: 18px;
}

.storage-usage-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.storage-usage-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.storage-usage-summary strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
}

.storage-usage-summary > div:nth-child(2) {
  text-align: right;
}

.storage-usage-summary b {
  justify-self: end;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}
.billing-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.billing-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.billing-status-item div {
  min-width: 0;
}
.billing-status-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.billing-status-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.billing-status-item b {
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}
.billing-plan-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: 14px;
}
.billing-plan-summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.billing-plan-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.billing-plan-summary-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}
.billing-plan-summary-card small {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 720px) {
  .billing-plan-summary {
    grid-template-columns: 1fr;
  }
}

.billing-storage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: stretch;
  gap: var(--gap);
  margin-bottom: 14px;
}
.billing-storage-summary > div,
.billing-storage-summary > b {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.billing-storage-summary > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.billing-storage-summary > div strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}
.billing-storage-summary > b {
  align-items: center;
  justify-content: center;
  min-width: 84px;
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.billing-storage-summary[data-fill-tier="mid"] > b { color: #d97706; }
.billing-storage-summary[data-fill-tier="high"] > b { color: var(--danger); }
@media (max-width: 720px) {
  .billing-storage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .billing-storage-summary > b { grid-column: 1 / -1; }
}

.quota-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}
.quota-track span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  transition: width .35s ease;
}
.quota-track[data-fill-tier="low"] span { background: linear-gradient(90deg, #16a085, #22c55e); }
.quota-track[data-fill-tier="mid"] span { background: linear-gradient(90deg, #f59e0b, #f97316); }
.quota-track[data-fill-tier="high"] span { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.storage-cloud-panel {
  overflow: hidden;
  border-color: rgba(214, 225, 240, .95);
  background:
    radial-gradient(circle at 94% 18%, color-mix(in srgb, var(--brand-dark) 10%, transparent), transparent 26%),
    linear-gradient(180deg, #fff, #fbfdff);
}
.storage-cloud-panel .plan-panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.storage-cloud-panel .plan-usage {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow-soft);
}
.storage-cloud-panel .plan-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-dark) 6%, white);
}
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.billing-plan-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(251,253,255,.98));
  box-shadow: var(--shadow-soft);
}
.billing-plan-card.is-current {
  border-color: color-mix(in srgb, var(--brand-dark) 24%, var(--line));
  background: color-mix(in srgb, var(--brand-dark) 5%, white);
}
.billing-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.billing-plan-head strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}
.billing-plan-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.billing-plan-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.billing-plan-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.user-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(252,254,255,.98)),
    #fff;
}
.user-card-meta span:nth-child(5) {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 10%, white);
}
.user-quota-track {
  height: 7px;
  margin-top: 2px;
}

@media (min-width: 821px) and (max-width: 1280px) {
  .shell,
  .shell.is-sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(320px, calc(100vw - 58px));
    height: 100dvh;
    padding: 16px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 44px rgba(25, 42, 70, .16);
  }
  .mobile-sidebar-close {
    display: inline-grid;
    place-items: center;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
  }
  .mobile-sidebar-close:hover,
  .mobile-sidebar-close:focus-visible {
    color: var(--brand-dark);
    border-color: color-mix(in srgb, var(--brand-dark) 28%, var(--line));
  }
  .topbar-tools > .topbar-language-menu {
    display: none;
  }
  .mobile-language-switch {
    display: block;
    width: 100%;
    margin: 0 0 14px;
  }
  .mobile-language-switch summary {
    justify-content: center;
    width: 100%;
    border-style: dashed;
  }
  .mobile-language-switch .language-menu-panel {
    position: static;
    margin-top: 8px;
    box-shadow: none;
  }
  .shell.is-mobile-nav-open .sidebar {
    transform: translateX(0);
  }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, .28);
    cursor: pointer;
  }
  .shell.is-mobile-nav-open .mobile-sidebar-backdrop {
    display: block;
  }
  body.is-mobile-nav-open {
    overflow: hidden;
  }
  .sidebar-toggle {
    display: none;
  }
  .shell.is-sidebar-collapsed .sidebar {
    align-items: stretch;
    padding-inline: 16px;
  }
  .shell.is-sidebar-collapsed .brand {
    justify-content: flex-start;
    padding-inline: 8px;
  }
  .shell.is-sidebar-collapsed .brand-copy,
  .shell.is-sidebar-collapsed .nav-group-summary span,
  .shell.is-sidebar-collapsed .nav-chevron,
  .shell.is-sidebar-collapsed .nav-link span,
  .shell.is-sidebar-collapsed .nav-link small,
  .shell.is-sidebar-collapsed .logout span,
  .shell.is-sidebar-collapsed .legal {
    display: block;
  }
  .shell.is-sidebar-collapsed .nav-group-summary,
  .shell.is-sidebar-collapsed .nav-link,
  .shell.is-sidebar-collapsed .logout {
    width: 100%;
    margin-inline: 0;
    justify-content: flex-start;
    padding: 7px 10px;
  }
  .shell.is-sidebar-collapsed .nav-group-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14px;
  }
  .shell.is-sidebar-collapsed .nav-link {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .shell.is-sidebar-collapsed .nav-link small {
    display: block;
  }
  .shell.is-sidebar-collapsed .nav-group-links {
    padding-left: 10px;
  }
  .shell.is-sidebar-collapsed .sidebar-footer {
    align-items: stretch;
  }
  .sidebar-footer { margin-top: 18px; }
  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 14px;
  }
  .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
  }
  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    color: var(--brand-dark);
    border-color: color-mix(in srgb, var(--brand-dark) 28%, var(--line));
  }
  .topbar-title {
    display: none;
  }
  .topbar-tools {
    margin-left: auto;
    justify-content: flex-end;
    gap: 8px;
  }
  .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-menu-identity { display: none; }
  .color-settings { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .document-type-card-head {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
  }
  .document-type-edit-fields,
  .document-type-actions {
    grid-column: 1 / -1;
  }
  .document-type-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .document-type-field-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .document-type-field-form .btn {
    width: auto;
    justify-self: start;
  }
  .org-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .org-title-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .org-title-form input[name="name"],
  .org-create-form input[name="address"],
  .org-title-form input[name="address"] {
    grid-column: span 1;
  }
  .org-title-form .badge,
  .org-title-form .org-users-count,
  .org-title-form .btn {
    justify-self: start;
  }
  .department-create-form,
  .department-title-form {
    flex-wrap: wrap;
  }
  .department-create-form input[name="name"],
  .department-create-form input[name="description"],
  .department-title-form input[name="description"] {
    flex: 1 1 240px;
  }
  .user-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user-create-form .create-user-roles {
    grid-column: 1 / -1;
  }
  .user-create-form .create-user-submit {
    grid-column: 2;
    justify-self: end;
    width: auto;
    min-width: 150px;
  }
  .user-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recent-activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-file-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .storage-admin-layout {
    grid-template-columns: 1fr;
  }
  .storage-admin-layout .config-list div {
    grid-template-columns: minmax(120px, .28fr) minmax(0, 1fr);
  }
  .storage-box-metrics {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .shell,
  .shell.is-sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(320px, calc(100vw - 58px));
    height: 100dvh;
    padding: 16px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 44px rgba(25, 42, 70, .16);
  }
  .mobile-sidebar-close {
    display: inline-grid;
    place-items: center;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
  }
  .mobile-sidebar-close:hover,
  .mobile-sidebar-close:focus-visible {
    color: var(--brand-dark);
    border-color: color-mix(in srgb, var(--brand-dark) 28%, var(--line));
  }
  .topbar-tools > .topbar-language-menu {
    display: none;
  }
  .mobile-language-switch {
    display: block;
    width: 100%;
    margin: 0 0 12px;
  }
  .mobile-language-switch summary {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    border-style: dashed;
  }
  .mobile-language-switch .language-menu-panel {
    position: static;
    margin-top: 8px;
    box-shadow: none;
  }
  .shell.is-mobile-nav-open .sidebar {
    transform: translateX(0);
  }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, .28);
    cursor: pointer;
  }
  .shell.is-mobile-nav-open .mobile-sidebar-backdrop {
    display: block;
  }
  body.is-mobile-nav-open {
    overflow: hidden;
  }
  .sidebar-toggle {
    display: none;
  }
  .shell.is-sidebar-collapsed .sidebar {
    align-items: stretch;
    padding-inline: 16px;
  }
  .shell.is-sidebar-collapsed .brand {
    justify-content: flex-start;
    padding-inline: 8px;
  }
  .shell.is-sidebar-collapsed .brand-copy,
  .shell.is-sidebar-collapsed .nav-group-summary span,
  .shell.is-sidebar-collapsed .nav-chevron,
  .shell.is-sidebar-collapsed .nav-link span,
  .shell.is-sidebar-collapsed .nav-link small,
  .shell.is-sidebar-collapsed .logout span,
  .shell.is-sidebar-collapsed .legal {
    display: block;
  }
  .shell.is-sidebar-collapsed .nav-group-summary,
  .shell.is-sidebar-collapsed .nav-link,
  .shell.is-sidebar-collapsed .logout {
    width: 100%;
    margin-inline: 0;
    justify-content: flex-start;
    padding: 7px 10px;
  }
  .shell.is-sidebar-collapsed .nav-group-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14px;
  }
  .shell.is-sidebar-collapsed .nav-link {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .shell.is-sidebar-collapsed .nav-link small {
    display: block;
  }
  .shell.is-sidebar-collapsed .nav-group-links {
    padding-left: 10px;
  }
  .shell.is-sidebar-collapsed .sidebar-footer {
    align-items: stretch;
  }
  .sidebar-footer { margin-top: 18px; }
  .topbar {
    position: sticky;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 14px;
  }
  .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
  }
  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    color: var(--brand-dark);
    border-color: color-mix(in srgb, var(--brand-dark) 28%, var(--line));
  }
  .topbar-title {
    display: none;
  }
  .topbar-tools {
    margin-left: auto;
    justify-content: flex-end;
    gap: 8px;
  }
  .topbar-tools > .topbar-language-menu {
    min-height: 38px;
  }
  .notification-menu summary,
  .user-menu summary {
    min-height: 38px;
  }
  .titlebar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }
  .notification-menu { position: static; }
  .notification-panel {
    left: 18px;
    right: 18px;
    width: auto;
  }
  .user-menu-panel {
    left: auto;
    right: 0;
    width: min(300px, calc(100vw - 36px));
  }
  .page { padding: 18px; }
  .stats, .form-grid, .detail-grid, .integration-grid, .workflow-grid, .compact-form { grid-template-columns: 1fr; }
  .storage-admin-layout .config-list div { grid-template-columns: 1fr; gap: 4px; }
  .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .dashboard-stats > .card {
    min-height: 112px;
    padding: 12px;
  }
  .dashboard-stats .stat-value {
    font-size: clamp(18px, 5.4vw, 24px);
    line-height: 1.18;
    word-break: break-word;
  }
  .dashboard-stats .stat-label,
  .dashboard-stats .stat-caption {
    font-size: 10px;
    line-height: 1.25;
  }
  .storage-usage-summary { grid-template-columns: 1fr; align-items: start; }
  .storage-usage-summary > div:nth-child(2) { text-align: left; }
  .storage-usage-summary b { justify-self: start; grid-column: 1 / -1; }
  .billing-status-grid { grid-template-columns: 1fr; }
  .billing-plan-grid { grid-template-columns: 1fr; }
  .dashboard-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .recent-activity-grid,
  .dashboard-file-filters {
    grid-template-columns: 1fr;
  }
  .activity-file-preview {
    height: 180px;
  }
  .settings-hub-grid { grid-template-columns: 1fr; }
  .access-guide { grid-template-columns: 1fr; }
  .workflow-column { gap: var(--gap); }
  .comments-layout { grid-template-columns: 1fr; }
  .linked-documents-form .btn, .workflow-grid > .panel > .compact-form:not(.linked-documents-form) .btn.primary, .workflow-action-form .btn.primary { grid-column: 1 / -1; justify-self: stretch; width: 100%; }
  .report-stats { grid-template-columns: 1fr; }
  .approval-actions { grid-template-columns: 1fr; }
  .workflow-route-head { flex-direction: column; align-items: stretch; }
  .branding-grid { grid-template-columns: 1fr; }
  .payment-detail-item { grid-column: span 1; }
  .payment-status-form { grid-template-columns: 1fr; }
  .auth-page {
    background: #f3f6f5;
  }
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }
  .auth-visual {
    min-height: 220px;
    padding: 28px;
    align-items: end;
    background-position: center 38%;
  }
  .auth-visual::after {
    background:
      linear-gradient(90deg, rgba(13, 50, 45, .58), rgba(13, 50, 45, .18)),
      linear-gradient(180deg, rgba(13, 50, 45, .08), rgba(13, 50, 45, .78));
  }
  .auth-visual-video {
    object-position: center 38%;
  }
  .auth-visual-content {
    max-width: 460px;
    gap: 7px;
  }
  .auth-visual-content > strong {
    font-size: 30px;
    line-height: 1.08;
  }
  .auth-visual-content > span {
    font-size: 14px;
  }
  .auth-visual-legal {
    margin-top: 2px;
  }
  .auth-visual-legal strong,
  .auth-visual-legal span {
    font-size: 10px;
  }
  .auth-card {
    align-self: start;
    justify-self: stretch;
    max-width: none;
    margin: 16px;
    padding: 24px;
  }
  .auth-language { margin-bottom: 16px; }
  .browser-layout { grid-template-columns: 1fr; }
  .browser-tree { position: static; max-height: none; }
  .title-actions { justify-content: flex-start; }
  .toolbar .field { min-width: 100%; }
  .dictionary-edit { grid-template-columns: 1fr; }
  .dictionary-list-head { align-items: stretch; flex-direction: column; }
  .dictionary-search { width: 100%; }
  .dictionary-table-saas {
    display: block;
    min-width: 0;
  }
  .dictionary-table-saas thead {
    display: none;
  }
  .dictionary-table-saas tbody,
  .dictionary-table-saas tr,
  .dictionary-table-saas td {
    display: block;
    width: 100% !important;
  }
  .dictionary-table-saas tbody {
    display: grid;
    gap: 12px;
  }
  .dictionary-table-saas tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .dictionary-table-saas td {
    padding: 6px 0;
    border-bottom: 0;
    text-align: left !important;
  }
  .dictionary-table-saas td:empty {
    display: none;
  }
  .dictionary-table-saas input,
  .dictionary-table-saas select {
    width: 100%;
  }
  .dictionary-table-saas input[type="color"] {
    width: 52px;
    min-width: 52px;
    margin: 0;
  }
  .dictionary-table-saas .dictionary-checkbox {
    justify-content: flex-start;
  }
  .dictionary-table-saas .dictionary-actions {
    justify-content: flex-start;
    width: 100%;
  }
  .dictionary-table-saas .dictionary-actions .btn {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
  }
  .dictionary-table-saas .dictionary-actions .inline-form {
    flex: 1 1 0;
  }
  .document-type-card-head,
  .document-type-edit-fields,
  .document-type-field-form { grid-template-columns: 1fr; }
  .document-type-actions { justify-content: flex-start; flex-wrap: wrap; }
  .document-type-fields-head { align-items: flex-start; flex-direction: column; }
  .user-create-form { grid-template-columns: 1fr; }
  .panel-head-row,
  .org-card-head,
  .department-head,
  .org-create-form,
  .org-title-form,
  .department-title-form,
  .department-create-form {
    align-items: stretch;
    flex-direction: column;
  }
  .org-title-form input[name="name"],
  .department-title-form input[name="name"],
  .department-title-form input[name="description"] {
    max-width: none;
    width: 100%;
  }
  .department-create-form input[name="name"],
  .department-create-form input[name="description"],
  .department-title-form input[name="name"],
  .department-title-form input[name="description"] {
    flex: none;
    width: 100%;
    max-width: none;
  }
  .department-create-form .btn {
    min-width: 0;
    width: 100%;
  }
  .org-create-form,
  .org-title-form {
    grid-template-columns: 1fr;
  }
  .org-create-form input[name="address"],
  .org-title-form input[name="address"] {
    grid-column: 1;
  }
  .structure-table { min-width: 680px; }
  .user-create-form .create-user-roles {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
  .user-create-form .create-user-submit {
    width: 100%;
  }
  .user-card { grid-template-columns: 1fr; }
  .user-card-meta, .user-card-actions { justify-content: flex-start; }
  .user-fields { grid-template-columns: 1fr; }
  .role-guide { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .panel { padding: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 13px; }
  .sidebar { padding: 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .page { padding: 14px; }
  .title-actions, .dictionary-actions { width: 100%; }
  .title-actions .btn, .dictionary-actions .btn { flex: 1 1 auto; }
  .btn { width: auto; min-width: 0; }
  .stats { gap: 10px; }
  .card { padding: 12px; }
  .stat-value { font-size: 19px; }
  .table-wrap { border-radius: 8px; }
  th, td { padding: 8px 10px; }
  table { min-width: 720px; }
  .dictionary-table,
  .dictionary-table-tags,
  .dictionary-table-saas.dictionary-table-tags { min-width: 0; }
  .color-settings { grid-template-columns: 1fr; }
  .auth-page {
    padding: 10px;
    background: #14181d;
  }
  .auth-shell {
    min-height: calc(100svh - 20px);
    border-radius: 0;
    overflow: hidden;
    background: #fff;
  }
  .auth-visual {
    min-height: 248px;
    padding: 28px 26px 24px;
  }
  .auth-visual-content {
    gap: 8px;
  }
  .auth-visual-content .preview-kicker {
    font-size: 11px;
  }
  .auth-visual-content > strong {
    font-size: 27px;
    max-width: 330px;
  }
  .auth-visual-content > span {
    max-width: 320px;
    font-size: 14px;
  }
  .auth-visual-legal {
    margin-top: 8px;
    max-width: 260px;
  }
  .auth-visual-legal strong,
  .auth-visual-legal span {
    display: block;
    font-size: 10px;
    line-height: 1.35;
  }
  .auth-card {
    margin: 0;
    padding: 24px 26px 26px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-language {
    justify-content: flex-end;
    margin-bottom: 20px;
  }
  .auth-brand {
    margin-bottom: 22px;
  }
  .auth-card h1 {
    font-size: 24px;
    line-height: 1.15;
  }
  .auth-form {
    gap: 14px;
  }
  .turnstile-field {
    min-height: 65px;
    overflow: hidden;
  }
  .turnstile-field .cf-turnstile {
    transform-origin: top left;
  }
}

@media (max-width: 380px) {
  .auth-page { padding: 0; }
  .auth-shell { min-height: 100svh; }
  .auth-visual {
    min-height: 226px;
    padding: 24px 22px 20px;
  }
  .auth-visual-content > strong {
    font-size: 24px;
  }
  .auth-card {
    padding: 22px 22px 24px;
  }
  .language-menu summary {
    gap: 4px;
  }
  .language-menu summary {
    padding: 4px 8px;
  }
}

/* Reports layout override: keep sections independent and symmetrical. */
.report-workflow-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-workflow-grid > .report-panel-wide {
  grid-column: 1 / -1;
  grid-row: auto;
}
.report-workflow-grid > .report-panel:not(.report-panel-wide) {
  min-height: 188px;
}

/* Public landing page */
.public-page {
  min-height: 100vh;
  background: #071512;
  color: #eef7f3;
}
.public-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(7, 17, 20, .78);
  backdrop-filter: blur(16px);
}
.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}
.public-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}
.public-brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.public-brand strong,
.public-brand small {
  display: block;
}
.public-brand strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: .04em;
}
.public-brand small {
  color: rgba(238,247,243,.68);
  font-size: 12px;
}
.public-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: 8px;
}
.public-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(238,247,243,.74);
  font-size: 13px;
  font-weight: 500;
}
.public-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.public-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.public-login {
  min-height: 38px;
  white-space: nowrap;
}
.landing-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 118px clamp(18px, 5vw, 72px) 56px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(4, 18, 20, .95) 0%, rgba(9, 40, 39, .72) 48%, rgba(7, 21, 18, .92) 100%),
    linear-gradient(180deg, rgba(245,173,27,.10), rgba(22,160,133,.06) 48%, rgba(4,18,20,.92)),
    url("/assets/brand/login-bg.jpg") center / cover no-repeat;
}
.landing-space {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 22%, rgba(245,173,27,.16) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 28%, rgba(255,255,255,.20) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 70%, rgba(22,160,133,.18) 0 1px, transparent 2px);
  background-size: 180px 180px, 230px 230px, 260px 260px;
  opacity: .75;
}
.landing-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .72fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  width: min(1180px, 100%);
  margin: 0 auto;
}
.landing-copy {
  max-width: 720px;
}
.landing-copy h1 {
  max-width: 720px;
  margin: 12px 0 10px;
  color: #fff;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: 0;
}
.landing-copy p {
  max-width: 620px;
  margin: 0 0 8px;
  color: rgba(238,247,243,.9);
  font-size: clamp(19px, 2.2vw, 28px);
}
.landing-copy .landing-lead {
  color: rgba(238,247,243,.74);
  font-size: 16px;
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.landing-primary,
.landing-secondary {
  min-height: 44px;
  padding-inline: 16px;
}
.landing-secondary {
  border-color: rgba(255,255,255,.20);
  color: #fff;
  background: rgba(255,255,255,.08);
}
.landing-secondary:hover {
  background: rgba(255,255,255,.14);
}
.terminal-card {
  align-self: stretch;
  min-height: 360px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(4, 12, 16, .78);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
  overflow: hidden;
}
.terminal-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}
.terminal-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f87171;
}
.terminal-top span:nth-child(2) { background: #f5ad1b; }
.terminal-top span:nth-child(3) { background: #16a085; }
.terminal-top strong {
  margin-left: 8px;
  color: rgba(238,247,243,.72);
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
}
.terminal-lines {
  display: grid;
  gap: 18px;
  padding: 28px 24px;
}
.terminal-lines p {
  margin: 0;
  color: #dffcf2;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}
.terminal-lines span {
  color: #f5ad1b;
}
.terminal-lines em {
  display: block;
  margin-top: 3px;
  color: rgba(238,247,243,.58);
  font-style: normal;
}
.terminal-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 24px 24px;
  padding: 14px 16px;
  border: 1px solid rgba(22,160,133,.28);
  border-radius: 12px;
  background: rgba(22,160,133,.10);
}
.terminal-status span {
  color: rgba(238,247,243,.64);
  font-size: 12px;
}
.terminal-status strong {
  color: #58e3c5;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.landing-section {
  padding: 86px clamp(18px, 5vw, 72px);
  background: #f5f7fb;
  color: var(--text);
}
.section-head {
  width: min(880px, 100%);
  margin: 0 auto 30px;
  text-align: center;
}
.section-head h2 {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.05;
}
.section-head p {
  margin: 0 auto;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.landing-card {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.landing-card .icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 10px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 12%, white);
}
.landing-card h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 19px;
}
.landing-card p {
  margin: 0;
  color: var(--muted);
}
.landing-dark-band {
  color: #eef7f3;
  background:
    linear-gradient(135deg, rgba(7,21,18,.96), rgba(9,38,40,.94)),
    url("/assets/brand/login-bg.jpg") center 42% / cover no-repeat;
}
.landing-dark-band .section-head h2 {
  color: #fff;
}
.security-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.security-strip div {
  min-height: 130px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
}
.security-strip strong,
.security-strip span {
  display: block;
}
.security-strip strong {
  margin-bottom: 12px;
  color: #f5ad1b;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.security-strip span {
  color: rgba(238,247,243,.78);
}
.orbit-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.orbit-flow div {
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.orbit-flow span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.orbit-flow strong {
  color: var(--text);
  font-size: 20px;
}
.orbit-flow small {
  color: var(--muted);
  font-size: 13px;
}
.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 5vw, 72px);
  color: rgba(238,247,243,.68);
  background: #071512;
}
.public-footer strong,
.public-footer span {
  display: block;
  font-size: 11px;
}
.public-footer a {
  color: #f5ad1b;
  font-size: 13px;
}

@media (max-width: 980px) {
  .public-header {
    position: static;
    flex-wrap: wrap;
  }
  .public-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .public-actions {
    margin-left: auto;
  }
  .landing-hero {
    min-height: auto;
    padding-top: 54px;
  }
  .landing-hero-inner {
    grid-template-columns: 1fr;
  }
  .terminal-card {
    min-height: 0;
  }
  .landing-grid,
  .security-strip {
    grid-template-columns: 1fr 1fr;
  }
  .orbit-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .public-header {
    gap: 14px;
    padding: 14px;
  }
  .public-brand {
    min-width: 0;
    flex: 1 1 100%;
  }
  .public-actions {
    width: 100%;
    justify-content: space-between;
  }
  .public-login {
    flex: 1 1 auto;
  }
  .landing-hero {
    padding: 42px 18px;
  }
  .landing-copy h1 {
    font-size: 42px;
  }
  .landing-copy p {
    font-size: 18px;
  }
  .landing-cta .btn {
    width: 100%;
    justify-content: center;
  }
  .terminal-lines {
    padding: 22px 18px;
  }
  .terminal-status {
    margin: 0 18px 18px;
  }
  .landing-section {
    padding: 58px 18px;
  }
  .landing-grid,
  .security-strip,
  .orbit-flow {
    grid-template-columns: 1fr;
  }
  .public-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* CosmoDocs public landing: CloudHive space + terminal direction. */
.ch-public-page {
  min-height: 100vh;
  color: #e8eaf0;
  background: #06080e;
}
.ch-public-header {
  position: relative;
  z-index: 20;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
}
.ch-public-top {
  border-bottom: 1px solid #e2e8f0;
  padding: 15px 0;
}
.ch-public-top-content,
.ch-public-nav-content,
.ch-public-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.ch-public-top-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.ch-public-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.ch-public-logo img {
  width: auto;
  height: 40px;
  display: block;
  object-fit: contain;
}
.ch-public-top-content .ch-public-logo {
  margin-right: auto;
}
.ch-public-services {
  display: none;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  justify-content: center;
}
.ch-public-services a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}
.ch-public-services a:hover {
  color: #e67e22;
}
.ch-public-services .icon {
  width: 17px;
  text-align: center;
  color: #64748b;
}
.ch-public-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.ch-public-language {
  min-height: 34px;
  background: #fff;
}
.ch-public-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s ease;
}
.ch-public-panel:hover {
  border-color: #F5AD1B;
  color: #1e293b;
  background: #fff8e7;
}
.ch-public-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #F5AD1B;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,.16);
}
.ch-public-nav-content {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 46px;
}
.ch-public-nav-content {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ch-public-nav-content::-webkit-scrollbar {
  display: none;
}
.ch-public-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 15px 13px;
  color: rgba(255,255,255,.92);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.ch-public-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.13);
}
.ch-public-nav .icon {
  font-size: 13px;
}
.cosmo-landing {
  overflow: hidden;
  background: #06080e;
}
.cosmo-hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, #06080e 0%, #0a0e1a 40%, #0d1020 100%);
}
.cosmo-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 64%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to right, rgba(6,8,14,.96) 0%, rgba(6,8,14,.70) 72%, transparent 100%);
}
.cosmo-stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .9;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 30%, rgba(255,255,255,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 44% 76%, rgba(255,255,255,.35) 0 1px, transparent 1.4px),
    radial-gradient(circle at 88% 62%, rgba(255,255,255,.65) 0 1px, transparent 1.5px);
  background-size: 180px 160px, 260px 220px, 230px 210px, 310px 260px;
  animation: cosmoStarDrift 32s linear infinite;
}
@keyframes cosmoStarDrift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 180px -160px, -260px 220px, 230px -210px, -310px 260px; }
}
.cosmo-nebula {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(.2px);
}
.cosmo-nebula-one {
  width: 700px;
  height: 400px;
  top: -120px;
  left: -120px;
  z-index: 1;
  background: radial-gradient(ellipse, rgba(30,60,140,.22) 0%, rgba(20,40,100,.10) 50%, transparent 76%);
  animation: cosmoNebulaOne 20s ease-in-out infinite alternate;
}
.cosmo-nebula-two {
  width: 520px;
  height: 520px;
  right: 90px;
  bottom: -100px;
  z-index: 1;
  background: radial-gradient(ellipse, rgba(80,30,120,.18) 0%, rgba(60,20,90,.08) 52%, transparent 76%);
  animation: cosmoNebulaTwo 25s ease-in-out infinite alternate;
}
@keyframes cosmoNebulaOne {
  to { transform: translate(30px, 20px) scale(1.08); }
}
@keyframes cosmoNebulaTwo {
  to { transform: translate(-25px, 15px) scale(1.05); }
}
.cosmo-planet {
  position: absolute;
  left: 55%;
  top: 50%;
  z-index: 2;
  width: 640px;
  height: 640px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cosmo-planet span {
  position: absolute;
  inset: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80,100,180,.22) 0%, rgba(50,70,140,.10) 42%, transparent 70%);
  animation: cosmoGlow 5s ease-in-out infinite alternate;
}
.cosmo-planet img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 50px rgba(100,150,220,.30)) drop-shadow(0 0 100px rgba(80,120,200,.18));
  animation: cosmoPlanetFloat 9s ease-in-out infinite alternate;
}
@keyframes cosmoGlow {
  to { opacity: 1; transform: scale(1.07); }
}
@keyframes cosmoPlanetFloat {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-22px) rotate(2deg); }
}
.cosmo-hero-inner {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  align-items: center;
  gap: 60px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 90px 40px 80px;
}
.ch-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 7px 16px;
  border: 1px solid rgba(255,218,121,.25);
  border-radius: 50px;
  color: #ffda79;
  background: rgba(255,218,121,.08);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ch-hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffda79;
  box-shadow: 0 0 8px #ffda79;
}
.cosmo-hero-copy h1 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 22px;
}
.cosmo-hero-copy h1 span {
  display: block;
  color: #fff;
  font-size: clamp(28px, 3.55vw, 54px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}
.cosmo-title-accent {
  width: fit-content;
  color: #ffda79 !important;
  position: relative;
}
.cosmo-title-accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffda79, #F5A623 60%, transparent);
}
.cosmo-title-muted {
  color: rgba(255,255,255,.58) !important;
  font-size: clamp(22px, 2.8vw, 42px) !important;
  font-weight: 600 !important;
}
.cosmo-hero-copy p {
  max-width: 470px;
  margin: 0 0 10px;
  color: #c8d4e0;
  font-size: 17px;
  line-height: 1.65;
}
.cosmo-hero-copy .cosmo-hero-lead {
  color: #7a8899;
  font-size: 15px;
}
.cosmo-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.cosmo-primary,
.cosmo-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
}
.cosmo-primary {
  color: #1e293b;
  background: #F5AD1B;
}
.cosmo-primary:hover {
  transform: translateY(-1px);
  background: #ffbd35;
}
.cosmo-secondary {
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
}
.cosmo-secondary:hover {
  background: rgba(255,255,255,.12);
}
.cosmo-trust {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 34px;
}
.cosmo-trust div {
  text-align: center;
}
.cosmo-trust strong {
  display: block;
  margin-bottom: 4px;
  color: #ffda79;
  font-size: 24px;
  line-height: 1;
}
.cosmo-trust span {
  color: #6a7888;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.cosmo-trust i {
  width: 1px;
  height: 38px;
  background: rgba(255,255,255,.10);
}
.ch-visual-card {
  position: relative;
  padding: 32px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(10,14,30,.45) 0%, rgba(6,10,20,.35) 100%);
  box-shadow: 0 24px 80px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(6px);
}
.ch-float-badge {
  position: absolute;
  left: -10px;
  top: -16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: #e8eaf0;
  background: rgba(8,12,24,.92);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  animation: ch-float 4s ease-in-out infinite;
}
.ch-float-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}
@keyframes ch-float {
  50% { transform: translateY(-7px); }
}
.ch-grid-bg {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 36px 36px;
}
.ch-server-rack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.ch-server-unit {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(6,10,20,.55);
}
.ch-server-unit::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.ch-server-unit.ch-online::after { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.ch-server-unit.ch-busy::after { background: #ffda79; box-shadow: 0 0 8px #ffda79; }
.ch-lights {
  display: flex;
  gap: 4px;
}
.ch-lights b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 5px #4ade80;
}
.ch-lights b:nth-child(2) {
  background: #60a5fa;
  box-shadow: 0 0 5px #60a5fa;
}
.ch-busy .ch-lights b:nth-child(2) {
  background: #ffda79;
  box-shadow: 0 0 5px #ffda79;
}
.ch-server-unit strong,
.ch-server-unit small {
  display: block;
}
.ch-server-unit strong {
  color: #e8eaf0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
}
.ch-server-unit small,
.ch-server-unit em {
  color: #6a7888;
  font-size: 10px;
  font-style: normal;
}
.ch-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ch-metrics div {
  padding: 14px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  text-align: center;
  background: rgba(6,10,20,.50);
}
.ch-metrics strong {
  display: block;
  margin-bottom: 3px;
  color: #ffda79;
  font-size: 15px;
  font-weight: 800;
}
.ch-metrics span {
  color: #6a7888;
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.terminal-service-section,
.automation-section {
  padding: 78px 20px 84px;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(88,50,180,.06), transparent 48%),
    #f6f8fc;
  color: #34495E;
}
.landing-section-head {
  max-width: 860px;
  margin: 0 auto 30px;
  text-align: center;
}
.landing-section-head span {
  color: #F5AD1B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.landing-section-head h2 {
  margin: 8px 0 10px;
  color: #1e293b;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.08;
}
.landing-section-head p {
  max-width: 760px;
  margin: 0 auto;
  color: #64748b;
  font-size: 15px;
  line-height: 1.75;
}
.terminal-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
}
.terminal-service-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tcard-lite {
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  overflow: hidden;
  background: #080910;
  box-shadow: 0 20px 55px rgba(15,23,42,.14);
}
.tcard-lite-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: #171825;
}
.tcard-lite-bar span,
.lterm-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tcard-lite-bar span:nth-child(1),
.lterm-bar span:nth-child(1) { background: #ff5f57; }
.tcard-lite-bar span:nth-child(2),
.lterm-bar span:nth-child(2) { background: #febc2e; }
.tcard-lite-bar span:nth-child(3),
.lterm-bar span:nth-child(3) { background: #28c840; }
.tcard-lite-bar b {
  min-width: 0;
  overflow: hidden;
  color: rgba(255,255,255,.42);
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcard-lite-bar em {
  margin-left: auto;
  color: #28c840;
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .8px;
}
.tcard-lite-body {
  min-height: 255px;
  padding: 22px;
}
.tcard-lite-body strong {
  display: block;
  color: #fff;
  font-size: 19px;
  margin-bottom: 13px;
}
.tcard-lite-body code {
  display: block;
  margin-bottom: 16px;
  color: #7ecf7e;
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  white-space: normal;
}
.tcard-lite-body p {
  margin: 0 0 18px;
  color: rgba(255,255,255,.68);
  font-size: 14px;
  line-height: 1.65;
}
.tcard-lite-body ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tcard-lite-body li {
  padding: 5px 9px;
  border: 1px solid rgba(245,173,27,.30);
  border-radius: 999px;
  color: #ffda79;
  background: rgba(245,173,27,.08);
  font-size: 11px;
  font-weight: 700;
}
.capabilities-section {
  padding: 78px 20px 86px;
  background:
    radial-gradient(ellipse at 12% 20%, rgba(22,160,133,.10), transparent 46%),
    radial-gradient(ellipse at 88% 70%, rgba(245,173,27,.08), transparent 48%),
    #fff;
  color: #34495E;
}
.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}
.capability-card {
  min-height: 245px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.96)),
    linear-gradient(rgba(15,23,42,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.025) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
}
.capability-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border: 1px solid rgba(22,160,133,.18);
  border-radius: 10px;
  color: #16A085;
  background: rgba(22,160,133,.08);
  box-shadow: 0 12px 28px rgba(22,160,133,.10);
}
.capability-icon-symbol {
  font-size: 15px;
  line-height: 1;
}
.capability-card strong,
.capability-card p {
  display: block;
}
.capability-card strong {
  margin-bottom: 10px;
  color: #1e293b;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}
.capability-card p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}
.capability-note {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 18px 20px;
  border: 1px solid rgba(245,173,27,.28);
  border-radius: 14px;
  background: rgba(245,173,27,.08);
}
.capability-note b {
  flex: 0 0 auto;
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
}
.capability-note span {
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}
.lterm-section {
  position: relative;
  padding: 74px 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(88,50,180,.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(20,70,160,.09) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(245,166,35,.04) 0%, transparent 60%),
    #060a14;
}
.lterm {
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid rgba(245,166,35,.18);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,.30);
}
.lterm-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  background: #171825;
}
.lterm-bar strong {
  flex: 1;
  text-align: center;
  color: rgba(255,255,255,.38);
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
}
.lterm-bar em {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #28c840;
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 1.3px;
}
.lterm-bar em i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28c840;
  animation: ltPulse 1.4s ease-in-out infinite;
}
@keyframes ltPulse {
  50% { opacity: .38; box-shadow: 0 0 0 6px rgba(40,200,64,0); }
}
.lterm-body {
  min-height: 300px;
  padding: 24px 28px;
  background: #080910;
  color: #e2e8f0;
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
}
.lterm-body p {
  margin: 0 0 8px;
}
.lterm-body b {
  color: rgba(255,255,255,.30);
  font-weight: 500;
}
.lterm-body .lt-out {
  padding-left: 18px;
  color: #7ecf7e;
}
.lt-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: #F5AD1B;
  animation: ltBlink 1s step-end infinite;
}
@keyframes ltBlink {
  50% { opacity: 0; }
}
.automation-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}
.automation-flow div {
  display: grid;
  gap: 7px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
}
.automation-flow span {
  color: #F5AD1B;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.automation-flow strong {
  color: #1e293b;
  font-size: 20px;
}
.automation-flow small {
  color: #64748b;
  font-size: 13px;
}
.intelligence-section {
  padding: 78px 20px 84px;
  color: #e8eaf0;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(245,173,27,.09), transparent 46%),
    radial-gradient(ellipse at 82% 72%, rgba(22,160,133,.10), transparent 48%),
    #080910;
}
.intelligence-section .landing-section-head h2 {
  color: #fff;
}
.intelligence-section .landing-section-head p {
  color: rgba(232,234,240,.68);
}
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}
.intelligence-grid div {
  min-height: 190px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(10,14,30,.72), rgba(6,10,20,.55)),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}
.intelligence-grid strong,
.intelligence-grid span {
  display: block;
}
.intelligence-grid strong {
  margin-bottom: 13px;
  color: #ffda79;
  font-size: 18px;
}
.intelligence-grid span {
  color: rgba(232,234,240,.72);
  font-size: 14px;
  line-height: 1.65;
}
.archive-section {
  padding: 76px 20px;
  background: #f6f8fc;
}
.archive-panel {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(320px, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15,23,42,.08);
}
.archive-panel > div:first-child > span {
  color: #F5AD1B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.archive-panel h2 {
  margin: 8px 0 14px;
  color: #1e293b;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}
.archive-panel p {
  margin: 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.75;
}
.archive-list {
  display: grid;
  gap: 12px;
}
.archive-list div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.archive-list b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #1e293b;
  background: #F5AD1B;
  font-size: 12px;
}
.archive-list strong {
  color: #1e293b;
  font-size: 16px;
}
.archive-list small {
  color: #64748b;
  font-size: 13px;
}
.ch-public-footer {
  padding: 34px 0;
  color: rgba(255,255,255,.62);
  background: #06080e;
}
.ch-public-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.ch-public-footer strong,
.ch-public-footer span,
.ch-public-footer a {
  font-size: 12px;
}
.ch-public-footer strong,
.ch-public-footer span {
  display: block;
}
.ch-public-footer strong {
  color: #fff;
  letter-spacing: .04em;
}
.ch-public-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.ch-public-footer a {
  color: #ffda79;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .ch-public-services {
    display: none;
  }
  .cosmo-hero-inner {
    grid-template-columns: 1fr;
    padding: 76px 24px 60px;
    gap: 36px;
  }
  .cosmo-hero::before {
    width: 100%;
    background: linear-gradient(to bottom, rgba(6,8,14,.92) 0%, rgba(6,8,14,.78) 62%, rgba(6,8,14,.55) 100%);
  }
  .cosmo-planet {
    left: 64%;
    width: 440px;
    height: 440px;
  }
  .terminal-service-grid {
    grid-template-columns: 1fr;
    max-width: 680px;
  }
  .terminal-service-grid-wide,
  .capability-grid,
  .intelligence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 820px;
  }
  .automation-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .archive-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .ch-public-top-content {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .ch-public-right {
    width: 100%;
    justify-content: space-between;
  }
  .ch-public-nav-content {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 12px;
  }
  .cosmo-hero {
    min-height: auto;
  }
  .cosmo-hero-inner {
    padding: 58px 16px 48px;
  }
  .cosmo-planet {
    left: 70%;
    top: 26%;
    width: 270px;
    height: 270px;
    opacity: .72;
  }
  .ch-hero-badge {
    max-width: 100%;
    line-height: 1.45;
    white-space: normal;
  }
  .cosmo-hero-copy h1 span {
    font-size: 30px;
  }
  .cosmo-title-muted {
    font-size: 22px !important;
  }
  .cosmo-hero-actions a {
    width: 100%;
  }
  .cosmo-trust {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .cosmo-trust div {
    text-align: left;
  }
  .cosmo-trust i {
    display: none;
  }
  .ch-visual-card {
    padding: 24px 16px 18px;
  }
  .ch-float-badge {
    position: static;
    width: fit-content;
    margin: 0 0 14px;
    white-space: normal;
  }
  .ch-server-unit {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ch-server-unit em {
    grid-column: 2;
  }
  .ch-metrics,
  .terminal-service-grid-wide,
  .intelligence-grid,
  .automation-flow {
    grid-template-columns: 1fr;
  }
  .terminal-service-section,
  .automation-section,
  .capabilities-section,
  .intelligence-section,
  .archive-section {
    padding: 56px 16px 62px;
  }
  .capability-grid {
    grid-template-columns: 1fr;
  }
  .capability-card {
    min-height: auto;
  }
  .capability-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .archive-panel {
    padding: 22px;
  }
  .landing-section-head {
    text-align: left;
  }
  .landing-section-head h2 {
    font-size: 28px;
  }
  .lterm-section {
    padding: 54px 14px;
  }
  .lterm-bar strong {
    text-align: left;
  }
  .lterm-bar em {
    display: none;
  }
  .lterm-body {
    min-height: 230px;
    padding: 17px 14px;
    font-size: 11px;
  }
  .ch-public-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .payment-status-form {
    grid-template-columns: 1fr;
  }
  .payment-status-form .btn {
    width: 100%;
  }
}

/* Premium User Menu Panel styling */
.user-menu-panel.user-menu-panel--saas {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  width: 336px !important;
  padding: 14px !important;
  overflow: hidden !important;
  border-radius: 22px !important;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 18%, var(--line)) !important;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14) !important;
}
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 14%, var(--line));
  border-radius: 16px;
  background: #fff;
}
.user-avatar-circle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-dark) 12%, white);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-menu-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-menu-info strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.user-menu-info span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-top: 2px;
}
.user-menu-metrics {
  padding: 14px 16px;
  margin-top: 10px;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 12%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-dark) 3%, #fff);
}
.user-menu-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 8px;
}
.user-menu-metric-head span {
  color: var(--text);
  font-weight: 600;
}
.user-menu-metric-head strong {
  color: var(--brand-dark);
  font-weight: 700;
}
.user-menu-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 8px;
}
.user-menu-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-dark);
}
.user-menu-metric-caption {
  color: var(--muted);
  font-size: 11px;
}
.user-menu-links {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 0 0;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  background: #fff;
  border: 1px dashed color-mix(in srgb, var(--brand-dark) 10%, var(--line));
  border-radius: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.user-menu-item:hover {
  background: var(--surface-soft);
  color: var(--brand-dark);
}
@media (max-width: 1100px) {
  .billing-plan-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .billing-plan-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}
.user-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s;
}
.user-menu-item:hover i {
  color: var(--brand-dark);
}
.user-menu-item.logout-btn:hover {
  background: color-mix(in srgb, var(--danger) 8%, white);
  color: var(--danger) !important;
}
.user-menu-item.logout-btn:hover i {
  color: var(--danger) !important;
}
.user-menu-footer {
  border-top: 1px dashed color-mix(in srgb, var(--brand-dark) 12%, var(--line));
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding-top: 10px;
  background: transparent;
}
.user-menu-footer form {
  padding: 0;
}
.user-menu-version {
  padding: 8px 16px 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.user-menu-version a {
  color: inherit;
  text-decoration: underline;
}

/* Premium Badges redesign */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 22px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #116ACC !important;
  background: color-mix(in srgb, #116ACC 8%, white) !important;
  border: 1px solid color-mix(in srgb, #116ACC 24%, transparent) !important;
  transition: all 0.15s ease;
}
.badge.success {
  color: #065f46 !important;
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}
.badge.warning {
  color: #92400e !important;
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
.badge.danger {
  color: #991b1b !important;
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
.badge.gray {
  color: #475569 !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
.badge.tag-colored {
  color: var(--tag-color) !important;
  background: color-mix(in srgb, var(--tag-color) 8%, white) !important;
  border-color: color-mix(in srgb, var(--tag-color) 24%, transparent) !important;
}

/* Pagination styles */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pagination-info {
  font-size: 13px;
  color: var(--muted);
}
.pagination-info strong {
  color: var(--text);
}
.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.pagination-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}
.pagination-btn.primary {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.pagination-btn.primary:hover {
  background: color-mix(in srgb, var(--brand-dark) 85%, black);
}
.pagination-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Responsive side scroll and compact box for tree on mobile */
@media (max-width: 820px) {
  .browser-tree {
    position: relative !important;
    top: 0 !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    border-bottom: 2px solid var(--line) !important;
    margin-bottom: 16px !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-soft) !important;
  }
}

/* Premium Input Fields */
input, select, textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line) !important;
  border-radius: var(--control-radius);
  padding: 8px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover {
  border-color: var(--line-strong) !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-dark) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-dark) 12%, transparent) !important;
}
input.is-invalid, select.is-invalid, textarea.is-invalid,
input[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--danger) !important;
}
input.is-invalid:focus, select.is-invalid:focus, textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent) !important;
}


/* Drag and Drop premium UI enhancements */
.title-with-handle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.title-content {
  display: flex;
  flex-direction: column;
}
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 24px;
  color: var(--muted);
  cursor: grab;
  opacity: 0.35;
  transition: opacity 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.draggable-doc:hover .drag-handle {
  opacity: 0.8;
}
.drag-handle:hover {
  opacity: 1 !important;
  color: #116ACC !important;
}
.drag-drop-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #116ACC;
  background: color-mix(in srgb, #116ACC 8%, white);
  border: 1px dashed color-mix(in srgb, #116ACC 30%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 12px;
  animation: pulse-hint 2s infinite ease-in-out;
}
@keyframes pulse-hint {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.02); opacity: 1; box-shadow: 0 0 8px rgba(17, 106, 204, 0.15); }
}

/* Premium Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.toast-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(120%);
  opacity: 0;
}

.toast-card.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-card.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

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

/* Colors for icon types */
.toast--info .toast-icon { color: #64748b; }
.toast--success .toast-icon { color: #10b981; }
.toast--warning .toast-icon { color: #f59e0b; }
.toast--error .toast-icon { color: #ef4444; }
.toast--loading .toast-icon { color: #3b82f6; }
.toast--custom .toast-icon { color: #475569; }
.toast--loading .toast-icon {
  animation: toast-spin 1s linear infinite;
  transform-origin: center;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 3px 0;
  line-height: 1.25;
}

.toast-message {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  margin-top: -2px;
  margin-right: -4px;
  transition: color 0.15s ease;
}
.toast-close-icon {
  width: 14px;
  height: 14px;
}

.toast-close:hover {
  color: #64748b;
}

.toast-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.toast-action {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.toast-action:hover {
  opacity: 0.7;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
}

.toast-card.show .toast-progress {
  animation: toast-progress-anim linear forwards;
}

@keyframes toast-progress-anim {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast--info .toast-progress { background: #64748b; }
.toast--success .toast-progress { background: #10b981; }
.toast--warning .toast-progress { background: #f59e0b; }
.toast--error .toast-progress { background: #ef4444; }
.toast--loading .toast-progress { background: #3b82f6; }
.toast--custom .toast-progress { background: #475569; }

/* Keyboard styling inside toasts */
.toast-message kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 1px 0 rgba(0,0,0,0.1);
  display: inline-block;
  line-height: 1.2;
}

/* Premium Cursor Utilities */
.cursor-pointer, [data-clickable] { cursor: pointer !important; }
.cursor-grab, [data-draggable] { cursor: grab !important; }
.cursor-grabbing, .is-dragging { cursor: grabbing !important; }
.cursor-text { cursor: text !important; }
.cursor-not-allowed, :disabled, .disabled { cursor: not-allowed !important; }
.cursor-resize-width { cursor: ew-resize !important; }
.cursor-resize-height { cursor: ns-resize !important; }
.cursor-resize-diagonal { cursor: nwse-resize !important; }
.cursor-move { cursor: move !important; }
.cursor-progress, .is-loading { cursor: progress !important; }
.cursor-default { cursor: default !important; }

/* Force grabbing cursor globally during active drag operations */
body.is-dragging, body.is-dragging * {
  cursor: grabbing !important;
}

/* Premium Progress Accordion */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.accordion-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.accordion-item.is-gray {
  background: #f8fafc;
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-state-icon {
  font-size: 16px;
  flex-shrink: 0;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.accordion-item.accordion--idle .accordion-state-icon {
  color: #94a3b8;
}

.accordion-item.accordion--progress .accordion-state-icon {
  color: #3b82f6;
}

.accordion-item.accordion--done .accordion-state-icon {
  color: #10b981;
}

.accordion-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
}

.accordion-chevron {
  font-size: 11px;
  color: #64748b;
  transition: transform 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.accordion-item[open] .accordion-chevron {
  transform: rotate(90deg);
}

.accordion-content {
  padding: 0 16px 16px 44px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  border-top: 1px solid transparent;
}

.accordion-item[open] .accordion-content {
  border-top-color: #f1f5f9;
  padding-top: 12px;
}

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  overflow-y: scroll;
  color-scheme: light;
}

/* Fix date picker calendar styling (prevent dark background and overflow) */
input[type="date"] {
  color-scheme: light !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: none !important;
  opacity: 0.7;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* OCR textarea override to keep border constant on hover/focus */
.ocr-terminal textarea,
.ocr-terminal textarea:hover,
.ocr-terminal textarea:focus,
.terminal-panel textarea,
.terminal-panel textarea:hover,
.terminal-panel textarea:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Premium Flatpickr custom styling overrides */
input.flatpickr-input,
input[type="date"],
input[type="datetime-local"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z' /%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
  background-size: 18px !important;
  padding-left: 36px !important;
}

/* Symmetrical calendar layout containers */
.flatpickr-calendar {
  font-family: var(--app-font) !important;
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
  color: #1f2937 !important;
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
}

.flatpickr-innerContainer {
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
}

.flatpickr-days {
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
  padding: 8px 12px 12px 12px !important;
}

.dayContainer {
  width: 294px !important;
  min-width: 294px !important;
  max-width: 294px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
}

.flatpickr-months {
  width: 320px !important;
  box-sizing: border-box !important;
  padding: 16px 20px 8px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Centered static month/year headers */
.flatpickr-current-month {
  font-weight: 600 !important;
  color: #111827 !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  left: 0 !important;
  width: 100% !important;
  text-align: center !important;
  padding: 0 !important;
  margin: 0 !important;
}

.flatpickr-current-month {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  user-select: none !important;
  pointer-events: auto !important;
}

.flatpickr-current-month * {
  pointer-events: none !important;
}

.flatpickr-current-month::after {
  content: "▾" !important;
  font-size: 11px !important;
  color: #9ca3af !important;
  margin-left: 5px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.flatpickr-current-month .cur-month {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #111827 !important;
}

.flatpickr-current-month .numInputWrapper {
  display: inline-block !important;
  width: auto !important;
  margin-left: 4px !important;
}

.flatpickr-current-month input.cur-year {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  width: 40px !important;
  outline: none !important;
}

.flatpickr-current-month input.cur-year::-webkit-outer-spin-button,
.flatpickr-current-month input.cur-year::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.flatpickr-current-month input.cur-year {
  -moz-appearance: textfield !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-current-month .numInputWrapper span.arrowDown {
  display: none !important;
}

/* Navigation Arrow Controls */
.flatpickr-prev-month,
.flatpickr-next-month {
  position: absolute !important;
  top: 14px !important;
  width: 32px !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #1f2937 !important;
  fill: #1f2937 !important;
  font-weight: 300 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 10 !important;
  transition: all 0.15s ease-in-out !important;
}

.flatpickr-prev-month {
  left: 14px !important;
}

.flatpickr-next-month {
  right: 14px !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  background: #f3f4f6 !important;
  border-radius: 50% !important;
  color: #111827 !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  display: none !important;
}

/* Weekday header grid */
.flatpickr-weekdays {
  width: 294px !important;
  min-width: 294px !important;
  max-width: 294px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

span.flatpickr-weekday {
  color: #9ca3af !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  text-transform: none !important;
  display: inline-block !important;
  text-align: center !important;
  width: 40px !important;
  max-width: 42px !important;
}

/* Day cells styling */
.flatpickr-day {
  color: #1f2937 !important;
  width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  margin: 2px !important;
  border-radius: 8px !important;
  transition: all 0.1s ease-in-out !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid transparent !important;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: #f3f4f6 !important;
  border-color: #f3f4f6 !important;
  color: #1f2937 !important;
  border-radius: 8px !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

.flatpickr-day.today {
  border-color: transparent !important;
  color: #111827 !important;
  font-weight: 700 !important;
}

.flatpickr-day.today:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.flatpickr-day.today.selected {
  background: #111827 !important;
  color: #ffffff !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #cbd5e1 !important;
}

/* Continuous black pill style for ranges */
.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  border-radius: 0 !important;
}

.flatpickr-day.startRange,
.flatpickr-day.startRange.today,
.flatpickr-day.startRange:hover {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  border-top-left-radius: 10px !important;
  border-bottom-left-radius: 10px !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.flatpickr-day.endRange,
.flatpickr-day.endRange.today,
.flatpickr-day.endRange:hover {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  border-top-right-radius: 10px !important;
  border-bottom-right-radius: 10px !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.flatpickr-day.startRange.endRange {
  border-radius: 8px !important;
}

/* Symmetrical Popover Arrow Positioning */
.flatpickr-calendar.arrowTop:before {
  border-width: 9px !important;
  margin-left: -9px !important;
  left: 24px !important;
  border-bottom-color: #f1f5f9 !important;
}

.flatpickr-calendar.arrowTop:after {
  border-width: 8px !important;
  margin-left: -8px !important;
  left: 24px !important;
  border-bottom-color: #ffffff !important;
}

.flatpickr-calendar.arrowBottom:before {
  border-width: 9px !important;
  margin-left: -9px !important;
  left: 24px !important;
  border-top-color: #f1f5f9 !important;
}

.flatpickr-calendar.arrowBottom:after {
  border-width: 8px !important;
  margin-left: -8px !important;
  left: 24px !important;
  border-top-color: #ffffff !important;
}

/* Premium Time Picker Overrides */
.flatpickr-time {
  border-top: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
  border-radius: 0 0 16px 16px !important;
  height: 40px !important;
  line-height: 40px !important;
}

.flatpickr-time input {
  font-family: var(--app-font) !important;
  color: #111827 !important;
  font-weight: 600 !important;
}

.flatpickr-time .flatpickr-time-separator {
  color: #9ca3af !important;
  font-weight: 600 !important;
}

.flatpickr-time .numInputWrapper span.arrowUp::after {
  border-bottom-color: #9ca3af !important;
}

.flatpickr-time .numInputWrapper span.arrowDown::after {
  border-top-color: #9ca3af !important;
}

/* Custom Month-Grid Selector Overrides */
.flatpickr-calendar.show-month-grid .flatpickr-months,
.flatpickr-calendar.show-month-grid .flatpickr-weekdays,
.flatpickr-calendar.show-month-grid .flatpickr-days {
  display: none !important;
}

.flatpickr-month-grid-wrapper {
  display: none;
  position: relative !important;
  width: 100% !important;
  height: 280px !important;
  background: #ffffff !important;
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;
  z-index: 10;
  animation: flatpickrMonthGridFadeIn 0.15s ease-out forwards;
}

@keyframes flatpickrMonthGridFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.flatpickr-calendar.show-month-grid .flatpickr-month-grid-wrapper {
  display: flex !important;
  flex-direction: column !important;
}

.flatpickr-month-grid-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  padding: 0 8px !important;
}

.flatpickr-month-grid-year {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  font-family: var(--app-font), sans-serif !important;
}

.flatpickr-month-grid-prev,
.flatpickr-month-grid-next {
  background: transparent !important;
  border: none !important;
  font-size: 18px !important;
  color: #9ca3af !important;
  cursor: pointer !important;
  padding: 2px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  transition: all 0.2s !important;
}

.flatpickr-month-grid-prev:hover,
.flatpickr-month-grid-next:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.flatpickr-month-grid-months {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-template-rows: repeat(4, 1fr) !important;
  gap: 6px !important;
  flex-grow: 1 !important;
}

.flatpickr-month-grid-month-btn {
  background: transparent !important;
  border: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #4b5563 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 0 !important;
  font-family: var(--app-font), sans-serif !important;
}

.flatpickr-month-grid-month-btn:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.flatpickr-month-grid-month-btn.is-active {
  background: #111827 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.dashboard-tasks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); margin-bottom: 30px; }

/* Symmetry & Order Fixes */
.user-notification-settings {
    grid-column: 1 / -1;
    margin: 1.5rem 0;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--control-radius);
    background: #fdfdfd;
}
.user-notification-settings h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.user-notification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.user-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.user-fields input, .user-fields select {
    width: 100%;
    min-height: 42px;
}

/* --- Expert UI/UX Polish: Symmetry & Responsiveness --- */

/* Perfect symmetry for Dashboard stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap);
    margin-bottom: 2rem;
}

.dashboard-stats .card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* User edit form symmetry */
.user-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.user-notification-settings {
    margin-top: 2rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }
    .user-fields {
        grid-template-columns: 1fr;
    }
    .role-guide {
        grid-template-columns: 1fr;
    }
}

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

/* Guard against duplicated user notification panels from stale iterative markup. */
.user-fields > .user-notification-settings { display: none; }
.user-fields > .user-notification-settings:last-of-type { display: block; }

/* 2026-06-01 form polish: status checkbox alignment and role help cards */
.template-active-field {
  display: grid;
  align-content: end;
  gap: 8px;
}
.template-active-field > label:first-child {
  margin: 0;
}
.template-active-field .checkbox-label {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  gap: 8px;
  margin: 0;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.template-active-field .checkbox-label input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
}

.user-create-form .create-user-roles {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  column-gap: 14px;
}
.user-create-form .create-user-roles select {
  min-height: 84px;
}
.role-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
  min-width: 0;
}
.user-role-field .role-guide {
  grid-template-columns: 1fr;
  margin-top: 8px;
}
.role-guide > span {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 80px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: var(--control-radius);
  color: #334155;
  background: linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--brand) 4%, #fff) 100%);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: normal;
}
.role-guide b {
  display: block;
  min-width: 0;
  color: #f97316;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1200px) {
  .role-guide {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .user-create-form .create-user-roles {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .user-create-form .create-user-roles select {
    width: 100%;
  }
  .user-create-form .create-user-roles .role-guide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .user-create-form .create-user-submit {
    grid-column: 1 / -1;
    justify-self: end;
    width: min(200px, 100%);
    margin-top: 0;
  }
}
@media (max-width: 640px) {
  .user-create-form .create-user-roles .role-guide {
    grid-template-columns: 1fr;
  }
  .role-guide > span {
    min-height: 0;
  }
  .user-create-form .create-user-submit {
    width: 100%;
    max-width: none;
  }
}


/* Compact Flatpickr final override: keeps month/year picker symmetrical. */
.flatpickr-calendar {
  width: 288px !important;
  min-width: 288px !important;
  max-width: 288px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
.flatpickr-innerContainer,
.flatpickr-days,
.flatpickr-calendar .flatpickr-rContainer,
.flatpickr-months {
  width: 288px !important;
  min-width: 288px !important;
  max-width: 288px !important;
}
.flatpickr-months {
  padding: 10px 16px 6px !important;
  min-height: 44px !important;
}
.flatpickr-prev-month,
.flatpickr-next-month {
  top: 8px !important;
  width: 28px !important;
  height: 28px !important;
  font-size: 18px !important;
}
.flatpickr-prev-month { left: 14px !important; }
.flatpickr-next-month { right: 14px !important; }
.flatpickr-current-month,
.flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year {
  font-size: 14px !important;
  line-height: 28px !important;
}
.flatpickr-days { padding: 4px 18px 10px !important; }
.flatpickr-weekdays,
.dayContainer {
  width: 252px !important;
  min-width: 252px !important;
  max-width: 252px !important;
}
.flatpickr-weekdays { height: 26px !important; }
span.flatpickr-weekday {
  width: 36px !important;
  max-width: 36px !important;
  font-size: 12px !important;
}
.flatpickr-day {
  width: 32px !important;
  max-width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  margin: 2px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}
.dayContainer { min-height: 216px !important; }
.flatpickr-month-grid-wrapper {
  height: 232px !important;
  padding: 12px !important;
  border-radius: 12px !important;
}
.flatpickr-month-grid-header {
  min-height: 30px !important;
  margin-bottom: 10px !important;
  padding: 0 4px !important;
}
.flatpickr-month-grid-year { font-size: 15px !important; }
.flatpickr-month-grid-prev,
.flatpickr-month-grid-next {
  width: 30px !important;
  height: 30px !important;
  padding: 2px 10px !important;
}
.flatpickr-month-grid-months { gap: 6px !important; }
.flatpickr-month-grid-month-btn {
  min-height: 34px !important;
  padding: 6px 0 !important;
  border-radius: 7px !important;
  font-size: 13px !important;
}


/* Archive browser panels must not inherit generic card space-between stretching. */
.browser-tree.panel,
.browser-documents.panel {
  height: auto !important;
  justify-content: flex-start !important;
}
.browser-tree.panel {
  display: flex !important;
  flex-direction: column !important;
  align-self: start !important;
}
.browser-tree .tree-container {
  flex: 0 1 auto !important;
  margin-top: 0 !important;
}
.browser-tree .tree-head {
  flex: 0 0 auto !important;
}


/* Unified dropdown polish: stable spacing, calm focus, and consistent native menu hints. */
select {
  min-height: var(--control-height) !important;
  height: var(--control-height) !important;
  padding: 0 42px 0 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--control-radius) !important;
  background-color: #fff !important;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%) !important;
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  color-scheme: light !important;
  cursor: pointer !important;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease !important;
}
select:hover {
  border-color: var(--line-strong) !important;
  background-color: #fff !important;
}
select:focus,
select:focus-visible {
  border-color: var(--brand-dark) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-dark) 13%, transparent) !important;
  outline: 0 !important;
}
select:disabled {
  cursor: not-allowed !important;
  color: var(--muted) !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
}
select option {
  min-height: 36px;
  padding: 9px 14px;
  color: var(--text);
  background: #fff;
  font: 500 14px var(--app-font), system-ui, sans-serif;
}
select option:checked {
  color: var(--brand-dark) !important;
  background: #fff !important;
  background-color: #fff !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
select option:hover,
select option:focus {
  color: var(--brand-dark) !important;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  box-shadow: none !important;
}
select[multiple] {
  height: auto !important;
  min-height: 104px !important;
  padding: 8px !important;
  background-image: none !important;
  cursor: default !important;
}
select[multiple] option {
  border-radius: 6px;
  margin: 2px 0;
}
.field select,
.toolbar select,
.user-fields select,
.filter-control select,
.dictionary-edit select,
.payment-status-form select {
  min-width: 0 !important;
  max-width: 100% !important;
}


.storage-ping-empty {
  min-height: 104px !important;
  margin-top: 10px !important;
  border: 1px dashed var(--line) !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--surface-soft) 58%, white) !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-align: center !important;
}


/* Backstage vertical rhythm: keep dashboard sections from touching. */
.page > .titlebar + .grid,
.page > .grid + .panel,
.page > .panel + .dashboard-section,
.page > .dashboard-section + .panel,
.page > .panel + .grid,
.page > .grid + .panel {
  margin-top: 18px;
}

.dashboard-tasks-grid {
  margin-bottom: 18px;
}


/* Native dropdown menus: avoid full-row selected strips where the browser honors option CSS. */
select option:checked,
select option:hover,
select option:focus {
  box-shadow: none !important;
}


/* Project-wide custom dropdowns: symmetric field + floating menu. */
select.cd-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.cd-select {
  position: relative;
  width: 100%;
  min-width: 0;
  font-family: var(--app-font), system-ui, sans-serif;
}

.cd-select-trigger {
  width: 100%;
  min-height: 42px;
  padding: 0 42px 0 14px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  transition: border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

.cd-select-placeholder .cd-select-trigger,
.cd-select-trigger.is-placeholder {
  color: #94a3b8;
}

.cd-select-trigger::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-65%) rotate(45deg);
  transition: transform .16s ease, border-color .16s ease;
}

.cd-select.is-open .cd-select-trigger,
.cd-select-trigger:focus-visible {
  border-color: #d8e0ea;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  outline: 0;
}

.cd-select.is-open .cd-select-trigger::after {
  border-color: #64748b;
  transform: translateY(-35%) rotate(225deg);
}

.cd-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  max-height: 268px;
  overflow: auto;
  padding: 10px 0;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .06);
}

.cd-select:not(.is-open) .cd-select-menu {
  display: none;
}

.cd-select-option {
  width: 100%;
  min-height: 36px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: #475569;
  display: block;
  text-align: left;
  font: 500 14px/1.35 var(--app-font), system-ui, sans-serif;
  cursor: pointer;
}

.cd-select-option:hover,
.cd-select-option:focus-visible,
.cd-select-option.is-active {
  color: var(--brand-dark);
  background: transparent;
  outline: 0;
}

.cd-select-option.is-selected {
  color: var(--brand-dark);
  font-weight: 700;
  background: transparent;
}

.cd-select-option:disabled,
.cd-select-option.is-disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.cd-select.is-disabled .cd-select-trigger {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
  box-shadow: none;
}

.cd-select-menu::-webkit-scrollbar {
  width: 8px;
}
.cd-select-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}


/* Custom dropdowns: no colored field highlight when open or focused. */
.cd-select.is-open .cd-select-trigger,
.cd-select .cd-select-trigger:focus,
.cd-select .cd-select-trigger:focus-visible {
  background: #fff !important;
  border-color: #d8e0ea !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03) !important;
  outline: 0 !important;
}


/* Sidebar redesign: soft workspace card navigation. */
.shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 14px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 52%, #f4f7fb 100%);
  border-right: 1px solid #e5edf6;
  box-shadow: 12px 0 36px rgba(15, 23, 42, .045);
}

.brand {
  min-height: 68px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border-color: #e5edf6;
  box-shadow: 0 10px 20px rgba(17, 106, 204, .08);
}

.brand-logo {
  width: 32px;
  height: 32px;
}

.brand-name {
  color: #172554;
  font-size: 15px;
  letter-spacing: .01em;
  line-height: 1.15;
}

.brand-subtitle {
  max-width: 172px;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  padding: 4px 2px 10px 0;
  margin-right: -6px;
}

.nav {
  gap: 10px;
}

.nav-group {
  position: relative;
  gap: 6px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
}

.nav-group[open],
.nav-group.is-open {
  border-color: rgba(226, 232, 240, .86);
  background: rgba(255, 255, 255, .66);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.nav-group-summary {
  min-height: 30px;
  padding: 0 4px 2px;
  grid-template-columns: minmax(0, 1fr) 18px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  border-radius: 10px;
  background: transparent;
}

.nav-group-summary:hover {
  color: #475569;
  background: transparent;
}

.nav-chevron {
  justify-self: end;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #94a3b8;
  background: rgba(241, 245, 249, .8);
  font-size: 9px;
}

.nav-group-links {
  gap: 5px;
  padding-left: 0;
}

.nav-link,
.logout {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 48px;
  column-gap: 10px;
  padding: 6px 10px 6px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #334155;
  background: transparent;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-link-icon,
.nav-link .icon {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #64748b;
  background: #f3f6fa;
  font-size: 14px;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.nav-link-icon .icon {
  width: auto;
  height: auto;
  background: transparent;
}

.nav-link-copy,
.nav-link span:not(.nav-link-icon):not(.nav-link-copy),
.nav-link small {
  min-width: 0;
}

.nav-link-copy {
  display: grid;
  align-content: center;
  gap: 3px;
}

.nav-link span:not(.nav-link-icon):not(.nav-link-copy) {
  color: inherit;
  font-weight: 700;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link small {
  margin: 0;
  color: #7c8da5;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover,
.logout:hover {
  color: #172554;
  background: rgba(255, 255, 255, .86);
  border-color: #e7edf5;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .045);
}

.nav-link:hover .nav-link-icon,
.nav-link:hover .icon {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 10%, #fff);
}

.nav-link.is-active,
.nav-link.is-hash-active {
  color: #0f2f66;
  border-color: color-mix(in srgb, var(--brand-dark) 22%, #e5edf6);
  background: linear-gradient(135deg, #ffffff 0%, color-mix(in srgb, var(--brand-dark) 7%, #fff) 100%);
  box-shadow: 0 10px 24px rgba(17, 106, 204, .09);
}

.nav-link.is-active::before,
.nav-link.is-hash-active::before {
  background: var(--brand-dark);
}

.nav-link.is-active .nav-link-icon,
.nav-link.is-active .icon,
.nav-link.is-hash-active .nav-link-icon,
.nav-link.is-hash-active .icon {
  color: #fff;
  background: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(17, 106, 204, .24);
}

.nav-link.is-active small,
.nav-link.is-hash-active small {
  color: #52657f;
}

.nav-link-accent {
  margin-top: 6px;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-dark), color-mix(in srgb, var(--brand-dark) 78%, #ff9933));
  box-shadow: 0 12px 24px rgba(17, 106, 204, .16);
}

.nav-link-accent::before {
  display: none;
}

.nav-link-accent small,
.nav-link-accent span:not(.nav-link-icon):not(.nav-link-copy) {
  color: #fff;
}

.nav-link-accent .nav-link-icon,
.nav-link-accent .icon {
  color: var(--brand-dark);
  background: rgba(255, 255, 255, .92);
  box-shadow: none;
}

.nav-link-accent:hover,
.nav-link-accent.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), color-mix(in srgb, var(--brand-dark) 72%, #ff9933));
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(17, 106, 204, .2);
}

.nav-link-accent:hover .nav-link-icon,
.nav-link-accent:hover .icon,
.nav-link-accent.is-active .nav-link-icon,
.nav-link-accent.is-active .icon {
  color: var(--brand-dark);
  background: #fff;
}

.sidebar-footer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .035);
}

.logout {
  min-height: 42px;
  display: flex;
  justify-content: center;
  border-color: #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.legal {
  padding-top: 2px;
  color: #94a3b8;
}

.legal strong {
  color: #64748b;
  font-size: 10px;
  letter-spacing: .02em;
}

.legal span {
  font-size: 10px;
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { padding: 16px 14px; }
}


/* Sidebar v33 finish: align nested nav rows after markup upgrade. */
.sidebar .nav-link {
  grid-template-columns: 38px minmax(0, 1fr) !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  min-height: 48px !important;
  height: 48px !important;
}

.sidebar .nav-link > .nav-link-icon {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: inline-grid !important;
  place-items: center !important;
  align-self: center !important;
  justify-self: center !important;
  width: 34px !important;
  height: 34px !important;
}

.sidebar .nav-link > .nav-link-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: grid !important;
  align-content: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.sidebar .nav-link > .nav-link-copy > span,
.sidebar .nav-link > .nav-link-copy > small {
  grid-column: auto !important;
  display: block !important;
  align-self: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.sidebar .nav-link > .nav-link-copy > span {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
}

.sidebar .nav-link > .nav-link-copy > small {
  color: #7c8da5 !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
}

.sidebar .nav-link-accent > .nav-link-copy > span,
.sidebar .nav-link-accent > .nav-link-copy > small {
  color: #fff !important;
}

.sidebar .nav-link-accent.is-active > .nav-link-copy > span,
.sidebar .nav-link-accent.is-active > .nav-link-copy > small,
.sidebar .nav-link-accent:hover > .nav-link-copy > span,
.sidebar .nav-link-accent:hover > .nav-link-copy > small {
  color: #fff !important;
}


/* Sidebar v34 finish: keep closed details groups truly collapsed. */
.sidebar .nav-group:not([open]) > .nav-group-links {
  display: none !important;
}

.sidebar .nav-group:not([open]) {
  height: auto !important;
}


/* Sidebar active state: no left rail stripe. */
.sidebar .nav-link::before,
.sidebar .nav-link.is-active::before,
.sidebar .nav-link.is-hash-active::before {
  display: none !important;
  background: transparent !important;
}

/* Sidebar v40: remove active-item left rail everywhere. */
.sidebar .nav-link::before,
.sidebar .nav-link.is-active::before,
.sidebar .nav-link.is-hash-active::before {
  display: none !important;
  background: transparent !important;
}

/* Layout v41: when sidebar is off-canvas, content must use the full grid width. */
@media (min-width: 821px) and (max-width: 1280px) {
  .shell,
  .shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .main {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Layout v42: keep the desktop sidebar visible on laptop-width screens. */
@media (min-width: 1025px) and (max-width: 1280px) {
  .shell,
  .shell.is-sidebar-collapsed {
    grid-template-columns: 292px minmax(0, 1fr) !important;
  }

  .sidebar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    z-index: 5 !important;
    width: auto !important;
    height: 100vh !important;
    transform: none !important;
    box-shadow: 12px 0 36px rgba(15, 23, 42, .045) !important;
  }

  .main {
    grid-column: auto !important;
    width: auto !important;
  }

  .mobile-nav-toggle,
  .mobile-sidebar-close,
  .mobile-sidebar-backdrop,
  .mobile-language-switch {
    display: none !important;
  }

  .topbar {
    min-height: 66px !important;
    padding: 12px 24px !important;
  }

  .topbar-title {
    display: block !important;
  }

  .topbar-tools > .topbar-language-menu {
    display: block !important;
  }
}

/* Sidebar v43: cleaner sidebar icons. */

.sidebar .nav-link > .nav-link-icon,
.sidebar .nav-link .icon {
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-link.is-active > .nav-link-icon,
.sidebar .nav-link.is-active .icon,
.sidebar .nav-link.is-hash-active > .nav-link-icon,
.sidebar .nav-link.is-hash-active .icon {
  color: var(--brand-dark) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-link-accent > .nav-link-icon,
.sidebar .nav-link-accent .icon,
.sidebar .nav-link-accent:hover > .nav-link-icon,
.sidebar .nav-link-accent:hover .icon,
.sidebar .nav-link-accent.is-active > .nav-link-icon,
.sidebar .nav-link-accent.is-active .icon {
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-group-summary .nav-chevron {
  background: transparent !important;
}

/* Sidebar v44: nav controls DOM cache bump. */

/* Sidebar v45: nav controls markup is present. */

/* Sidebar v46: repaired UTF-8 nav control labels. */

/* Sidebar v47: nav expand/collapse handlers active. */

/* Sidebar v48: collapse all clears saved group state. */

/* Sidebar v49: collapse clearing runs after detail toggles. */

/* Titlebar v50: keep header action buttons stable across screens. */
.titlebar-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
}

.titlebar-action-btn .icon {
  width: 14px;
}

.titlebar-action-btn span {
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .titlebar-action-btn {
    align-self: flex-start;
  }
}

@media (max-width: 560px) {
  .titlebar-action-btn {
    width: auto !important;
    min-width: 0;
  }
}

/* Titlebar v51: browser action button class wired in markup. */

/* Sidebar v52: accent links are not selected unless active. */
.sidebar .nav-link-accent:not(.is-active):not(.is-hash-active) {
  color: #334155 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-link-accent:not(.is-active):not(.is-hash-active) > .nav-link-icon,
.sidebar .nav-link-accent:not(.is-active):not(.is-hash-active) .icon {
  color: #ff9933 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-link-accent:not(.is-active):not(.is-hash-active) > .nav-link-copy > span {
  color: #334155 !important;
}

.sidebar .nav-link-accent:not(.is-active):not(.is-hash-active) > .nav-link-copy > small {
  color: #7c8da5 !important;
}

.sidebar .nav-link-accent:not(.is-active):not(.is-hash-active):hover {
  color: #172554 !important;
  border-color: #e7edf5 !important;
  background: rgba(255, 255, 255, .86) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .045) !important;
}

/* Sidebar v53: remove the special upload/accent navigation treatment. */
.sidebar .nav-link-accent,
.sidebar .nav-link-accent:hover,
.sidebar .nav-link-accent.is-active,
.sidebar .nav-link-accent.is-hash-active {
  margin-top: 0 !important;
  color: #334155 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav-link-accent.is-active,
.sidebar .nav-link-accent.is-hash-active {
  color: #0f2f66 !important;
  border-color: color-mix(in srgb, var(--brand-dark) 22%, #e5edf6) !important;
  background: linear-gradient(135deg, #ffffff 0%, color-mix(in srgb, var(--brand-dark) 7%, #fff) 100%) !important;
  box-shadow: 0 10px 24px rgba(17, 106, 204, .09) !important;
}

.sidebar .nav-link-accent > .nav-link-icon,
.sidebar .nav-link-accent .icon,
.sidebar .nav-link-accent:hover > .nav-link-icon,
.sidebar .nav-link-accent:hover .icon,
.sidebar .nav-link-accent.is-active > .nav-link-icon,
.sidebar .nav-link-accent.is-active .icon,
.sidebar .nav-link-accent.is-hash-active > .nav-link-icon,
.sidebar .nav-link-accent.is-hash-active .icon {
  color: #64748b !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Sidebar v55: expand/collapse menu controls fully removed. */

/* Users v56: compact role multi-selects. */
.role-select {
  width: 100%;
  min-height: 88px !important;
  height: 88px !important;
  padding: 5px 6px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}

.role-select option {
  min-height: 22px;
  padding: 3px 6px;
  margin: 1px 0 !important;
  border-radius: 5px !important;
  line-height: 1.2;
}

.create-user-roles .role-select {
  max-width: 260px;
}

.user-role-field .role-select {
  max-width: 320px;
}

/* Users v87: keep IMAP active checkbox compact without changing grid rhythm. */
.mail-accounts-panel .user-fields .field:has(.checkbox-label) {
  display: grid;
  align-content: start;
  min-height: 0;
  padding-top: 30px;
}
.mail-accounts-panel .user-fields .checkbox-label,
.mail-accounts-panel .mail-account-create-form .checkbox-label {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 10px !important;
  width: fit-content !important;
  min-width: 0 !important;
  min-height: 28px !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--muted);
  line-height: 1.35;
}
.mail-accounts-panel .user-fields .checkbox-label input[type="checkbox"],
.mail-accounts-panel .mail-account-create-form .checkbox-label input[type="checkbox"] {
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
}
.mail-accounts-panel .user-fields .checkbox-label span,
.mail-accounts-panel .mail-account-create-form .checkbox-label span {
  display: inline-block;
  white-space: nowrap;
}

/* Users v57: force role multi-select compact size after global select rules. */
select.role-select[multiple] {
  min-height: 88px !important;
  height: 88px !important;
  padding: 5px 6px !important;
}

select.role-select[multiple] option {
  min-height: 22px !important;
  padding: 3px 6px !important;
  margin: 1px 0 !important;
}

/* Users v58: compact and consistent company structure forms. */
.org-create-form input,
.org-title-form input,
.department-title-form input,
.department-create-form input,
.org-create-form .btn,
.org-title-form .btn,
.department-title-form .btn,
.department-create-form .btn {
  min-height: 38px !important;
  height: 38px;
  padding: 8px 12px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.org-title-form input[name="name"],
.department-title-form input[name="name"] {
  color: var(--brand-dark) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.org-title-form input:not([name="name"]),
.org-create-form input,
.department-title-form input:not([name="name"]),
.department-create-form input {
  font-weight: 500 !important;
}

.org-card .badge,
.org-users-count {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1;
}

/* Sidebar v59: simple Figma-inspired navigation, replacing legacy details menu. */
.shell {
  grid-template-columns: 292px minmax(0, 1fr) !important;
}

.sidebar {
  width: 292px;
  padding: 16px 14px !important;
  background: #ffffff !important;
  border-right: 1px solid #e5edf6 !important;
  box-shadow: 12px 0 32px rgba(15, 23, 42, .045) !important;
}

.brand {
  min-height: 64px !important;
  margin: 0 0 14px !important;
  padding: 10px !important;
  border: 1px solid #e7edf5 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .045) !important;
}

.side-search {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  margin: 0 8px 12px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #f8fafc;
}

.side-search .icon {
  width: 28px;
  color: #64748b;
  font-size: 12px;
}

.side-search input {
  min-height: 36px;
  height: 36px;
  width: 100%;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-size: 12px;
  box-shadow: none !important;
}

.side-search input:focus {
  box-shadow: none !important;
}

.side-menu.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 4px 10px 0 !important;
  margin-right: -6px !important;
}

.side-section {
  display: grid;
  gap: 4px;
  padding: 0 4px;
}

.side-section-label {
  padding: 7px 8px 4px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.side-link-list {
  display: grid;
  gap: 2px;
}

.side-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #1f2937;
  background: transparent;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.side-link[hidden],
.side-section[hidden] {
  display: none !important;
}

.side-link-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #64748b;
  font-size: 13px;
}

.side-link-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.side-link-copy > span,
.side-link-copy > small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-link-copy > span {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.12;
}

.side-link-copy > small {
  color: #7c8da5;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.08;
}

.side-link:hover {
  color: #0f2f66;
  background: #f3f7fb;
  border-color: #edf2f7;
}

.side-link:hover .side-link-icon {
  color: #116acc;
}

.side-link.is-active,
.side-link.is-hash-active {
  color: #0f2f66;
  border-color: transparent;
  background: #eaf3ff;
}

.side-link.is-active .side-link-icon,
.side-link.is-hash-active .side-link-icon {
  color: #116acc;
}

.side-section.has-hash-active .side-link.is-active:not(.is-hash-active) {
  color: #64748b;
  background: transparent;
}

.side-section.has-hash-active .side-link.is-active:not(.is-hash-active) .side-link-icon {
  color: #64748b;
}

.sidebar-footer {
  margin-top: 12px !important;
  padding: 12px !important;
  border: 1px solid #e7edf5 !important;
  border-radius: 14px !important;
  background: #f8fafc !important;
  box-shadow: none !important;
}

.sidebar-footer .logout {
  min-height: 38px !important;
  border-radius: 9px !important;
  background: #fff !important;
}

@media (min-width: 1025px) and (max-width: 1280px) {
  .shell,
  .shell.is-sidebar-collapsed {
    grid-template-columns: 292px minmax(0, 1fr) !important;
  }

  .sidebar {
    width: 292px !important;
  }
}

@media (max-width: 1024px) {
  .shell,
  .shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sidebar {
    width: min(320px, calc(100vw - 58px)) !important;
  }
}

/* Sidebar v60: align search block with the new menu grid. */
.side-search {
  grid-template-columns: 26px minmax(0, 1fr) !important;
  width: auto !important;
  min-height: 40px !important;
  margin: 0 0 12px !important;
  padding: 2px 8px 2px 4px !important;
  border-color: #dbe5ef !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
}

.side-search .icon {
  display: inline-grid !important;
  place-items: center !important;
  width: 18px !important;
  height: 18px !important;
  margin-left: 6px !important;
  color: #64748b !important;
  font-size: 11px !important;
}

.side-search input {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 4px !important;
  font-size: 12px !important;
}

.side-search:focus-within {
  border-color: #cbd5e1 !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
}

/* Sidebar v61: search input is visually merged with its container. */
.side-search input,
.side-search input:hover,
.side-search input:focus,
.side-search input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.side-search input::-webkit-search-decoration,
.side-search input::-webkit-search-cancel-button,
.side-search input::-webkit-search-results-button,
.side-search input::-webkit-search-results-decoration {
  display: none;
}

/* Sidebar v62: keep hash navigation visually exact and stable while preserving menu scroll. */
.side-link:not(.is-active):not(.is-hash-active) {
  font-weight: inherit;
}
.side-section.has-hash-active .side-link.is-active:not(.is-hash-active) {
  border-color: transparent !important;
}

/* Sidebar v64: give the footer breathing room below the navigation on desktop and off-canvas layouts. */
.side-menu.sidebar-nav {
  padding-bottom: 18px !important;
}

.sidebar-footer {
  margin-top: 24px !important;
  padding: 14px !important;
}

.sidebar-footer .legal {
  padding-top: 6px !important;
  gap: 3px !important;
}

@media (max-width: 1024px) {
  .side-menu.sidebar-nav {
    padding-bottom: 16px !important;
  }

  .sidebar-footer {
    margin-top: 20px !important;
  }
}



/* Dictionary tables v63: compact custom selects inside dense editable rows. */
.table-wrap table .cd-select {
  min-width: 112px;
}

.table-wrap table .cd-select-trigger {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 34px 0 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

.table-wrap table .cd-select-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap table .cd-select-trigger::after {
  right: 13px !important;
  width: 7px !important;
  height: 7px !important;
}

.table-wrap table .cd-select-menu {
  top: calc(100% + 6px) !important;
  padding: 6px 0 !important;
  min-width: 100%;
}

.table-wrap table .cd-select-option {
  min-height: 32px !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

.table-wrap table .cd-select-option.is-selected {
  font-weight: 600 !important;
}



/* Form rhythm v64: consistent control sizing in dense admin forms. */
.page--dictionary > .panel > .dictionary-create-form {
  gap: 12px !important;
  align-items: end !important;
  margin-bottom: 0 !important;
}

.page--dictionary > .panel > .dictionary-create-correspondents {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(190px, 1fr) minmax(170px, .8fr) minmax(170px, .8fr) !important;
}

.page--dictionary > .panel > .dictionary-create-tags {
  grid-template-columns: minmax(170px, 1fr) 76px minmax(170px, 1fr) minmax(190px, 1fr) minmax(170px, .8fr) minmax(170px, .8fr) !important;
}

.page--dictionary > .panel > .dictionary-create-document-types {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(170px, .8fr) !important;
}

.page--dictionary > .panel > .dictionary-create-form .field,
.dashboard-file-filters .filter-control,
.user-create-form > .field,
.mail-account-create-form > .field,
.document-type-field-form > .field,
#theme .form-grid > .field,
#document-form > .field {
  min-width: 0;
}

.page--dictionary > .panel > .dictionary-create-form input:not([type="color"]):not([type="file"]),
.page--dictionary > .panel > .dictionary-create-form .cd-select-trigger,
.page--dictionary > .panel > .dictionary-create-form .btn,
.dashboard-file-filters input,
.dashboard-file-filters .cd-select-trigger,
.document-type-field-form input:not([type="color"]):not([type="file"]),
.document-type-field-form .cd-select-trigger,
.document-type-field-form .btn,
#document-form input:not([type="file"]):not([type="color"]),
#document-form .cd-select-trigger,
#document-form .document-submit-btn,
#theme .form-grid input:not([type="file"]):not([type="color"]),
#theme .form-grid .cd-select-trigger,
.user-create-form input:not([type="file"]):not([type="color"]),
.user-create-form .cd-select-trigger,
.user-create-form .create-user-submit,
.mail-account-create-form input:not([type="file"]):not([type="color"]),
.mail-account-create-form .cd-select-trigger,
.mail-account-create-form .mail-account-submit {
  min-height: 38px !important;
  height: 38px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  border-radius: 9px !important;
}

.page--dictionary > .panel > .dictionary-create-form input[type="color"] {
  width: 52px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 4px !important;
}

.page--dictionary > .panel > .dictionary-create-form .dictionary-checkbox {
  min-height: 38px;
  align-items: center;
  margin: 0 !important;
  white-space: nowrap;
}

.dashboard-file-filters .filter-control .cd-select-trigger {
  padding-left: 38px !important;
}

.dashboard-file-filters .filter-control input {
  padding-left: 38px !important;
}

.document-type-field-form {
  align-items: end !important;
}

.document-type-field-form .btn {
  min-height: 38px !important;
  height: 38px !important;
}

#document-form .document-submit-btn,
.user-create-form .create-user-submit,
.mail-account-create-form .mail-account-submit,
.page--dictionary > .panel > .dictionary-create-form > .btn {
  justify-content: center;
  width: 100%;
}

@media (max-width: 1180px) {
  .page--dictionary > .panel > .dictionary-create-correspondents,
  .page--dictionary > .panel > .dictionary-create-tags,
  .page--dictionary > .panel > .dictionary-create-document-types {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .page--dictionary > .panel > .dictionary-create-correspondents,
  .page--dictionary > .panel > .dictionary-create-tags,
  .page--dictionary > .panel > .dictionary-create-document-types,
  .dashboard-file-filters,
  .user-create-form,
  .mail-account-create-form {
    grid-template-columns: 1fr !important;
  }
}



/* Custom select v65: visual icon options for document type icon selectors. */
.cd-select-value,
.cd-select-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cd-select-option-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #64748b;
  background: #f4f7fb;
  font-size: 12px;
}

.cd-select-option-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cd-select-option.is-selected .cd-select-option-icon,
.cd-select-option:hover .cd-select-option-icon,
.cd-select-option:focus-visible .cd-select-option-icon {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 10%, #fff);
}



/* Buttons v66: flat outline buttons, no 3D shadow. */
.btn,
.btn.primary,
.btn.blue,
.btn.danger,
.btn.secondary,
button.btn,
a.btn {
  box-shadow: none !important;
}

.btn:hover,
.btn:focus,
.btn:focus-visible,
.btn.primary:hover,
.btn.primary:focus,
.btn.primary:focus-visible,
.btn.blue:hover,
.btn.blue:focus,
.btn.blue:focus-visible,
.btn.danger:hover,
.btn.danger:focus,
.btn.danger:focus-visible {
  box-shadow: none !important;
}



/* Buttons v67: primary submit buttons are flat orange outline in every state. */
.btn.primary,
.btn.primary:hover,
.btn.primary:focus,
.btn.primary:focus-visible,
.btn.primary:active,
button.btn.primary,
a.btn.primary,
.template-submit-btn,
.template-submit-btn:hover,
.template-submit-btn:focus,
.template-submit-btn:focus-visible,
.template-submit-btn:active {
  color: var(--brand-dark) !important;
  background: #fff !important;
  border: 1px solid var(--brand-dark) !important;
  box-shadow: none !important;
  outline: 0 !important;
  transform: none !important;
}

.btn.primary:hover,
.template-submit-btn:hover {
  background: color-mix(in srgb, var(--brand-dark) 6%, #fff) !important;
}



/* Templates v68: standalone flat save button, detached from legacy btn/primary styles. */
.template-submit-btn,
.template-submit-btn:hover,
.template-submit-btn:focus,
.template-submit-btn:focus-visible,
.template-submit-btn:active {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 14px !important;
  border: 1px solid var(--brand-dark) !important;
  border-radius: 8px !important;
  color: var(--brand-dark) !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
  outline: 0 !important;
  transform: none !important;
  font: 500 13px/1 var(--app-font), system-ui, sans-serif !important;
  cursor: pointer !important;
}

.template-submit-btn:hover,
.template-submit-btn:focus,
.template-submit-btn:focus-visible {
  background: color-mix(in srgb, var(--brand-dark) 5%, #fff) !important;
}

/* Templates v90: compact starter presets for existing document template form. */
.template-starters-panel {
  display: grid;
  gap: 14px;
}

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

.template-starter-card {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 112px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}

.template-starter-card:hover,
.template-starter-card:focus-visible {
  border-color: color-mix(in srgb, var(--brand-dark) 35%, var(--line));
  background: color-mix(in srgb, var(--brand-dark) 4%, #fff);
  outline: none;
}

.template-starter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-dark) 16%, var(--line));
  border-radius: 8px;
}

.template-starter-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.template-starter-copy strong,
.template-starter-copy small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.template-starter-copy strong {
  color: var(--brand-dark);
  font-size: 15px;
  line-height: 1.25;
}

.template-starter-copy small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .template-starter-grid {
    grid-template-columns: 1fr;
  }

  .template-starter-card {
    min-height: 0;
  }
}

/* Portal v93: read-only document surface for clients and auditors. */
.portal-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .portal-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-stat {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.portal-stat .icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand-dark) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-dark) 14%, var(--line));
  border-radius: 8px;
}

.portal-stat span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.portal-stat strong {
  justify-self: end;
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1;
}

#integrations .cron-commands-card {
  grid-column: 1 / -1;
  min-height: 0;
}

#integrations .cron-commands-card .config-list div {
  grid-template-columns: minmax(140px, .22fr) minmax(0, 1fr);
}

#integrations .cron-commands-card .cron-code {
  white-space: pre-wrap;
  word-break: break-word;
}

#integrations .storage-admin-config {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .66);
}

#integrations .storage-admin-config div {
  grid-template-columns: minmax(118px, .4fr) minmax(0, 1fr);
}

.portal-panel {
  display: grid;
  gap: 14px;
}

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

.portal-document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.portal-document-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-document-main strong,
.portal-document-main span,
.portal-document-main small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-document-main strong {
  color: var(--brand-dark);
  font-size: 15px;
  line-height: 1.3;
}

.portal-document-main span,
.portal-document-main small,
.portal-document-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.portal-document-meta {
  display: grid;
  gap: 6px;
  justify-items: start;
}

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

.portal-document-actions .btn {
  min-height: 36px;
  white-space: nowrap;
}

.portal-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.portal-empty .icon {
  color: var(--brand-dark);
  font-size: 22px;
}

.portal-empty strong {
  color: var(--brand-dark);
}

@media (max-width: 980px) {
  .portal-document-card {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 560px) {
  .portal-summary-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .portal-document-actions .btn {
    width: 100%;
  }
}

/* Users v99: keep company badges and save action on their own row. */
.org-title-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.org-title-form .org-meta-badges {
  grid-column: 1 / 4;
  align-self: center;
}

.org-title-form > .btn {
  grid-column: 4 / 5;
  justify-self: end;
  width: min(100%, 180px);
}

@media (max-width: 980px) {
  .org-title-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-title-form input[name="address"],
  .org-title-form .org-meta-badges,
  .org-title-form > .btn {
    grid-column: 1 / -1;
  }

  .org-title-form > .btn {
    justify-self: stretch;
    width: 100%;
  }
}



/* Dictionary actions v69: centered icon/text rhythm for responsive table actions. */
.dictionary-table-saas .dictionary-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.dictionary-table-saas .dictionary-actions .btn,
.dictionary-table-saas .dictionary-actions .inline-form .btn {
  display: inline-grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: max-content !important;
  align-items: center !important;
  justify-content: center !important;
  justify-items: center !important;
  gap: 7px !important;
  min-height: 34px !important;
  height: 34px !important;
  width: 112px !important;
  min-width: 112px !important;
  padding: 0 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.dictionary-table-saas .dictionary-actions .btn .icon {
  display: inline-grid !important;
  place-items: center !important;
  width: 14px !important;
  min-width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  line-height: 1 !important;
  font-size: 12px !important;
}

.dictionary-table-saas .dictionary-actions .inline-form {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  flex: 0 0 112px !important;
}

@media (max-width: 720px) {
  .dictionary-table-saas .dictionary-actions {
    justify-content: stretch !important;
  }

  .dictionary-table-saas .dictionary-actions .btn,
  .dictionary-table-saas .dictionary-actions .inline-form,
  .dictionary-table-saas .dictionary-actions .inline-form .btn {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
  }
}



/* Dictionary actions v70: actions column fits the paired buttons without edge clipping. */
.dictionary-table-saas th:last-child,
.dictionary-table-saas td:last-child,
.dictionary-table-saas.dictionary-table-tags th:last-child,
.dictionary-table-saas.dictionary-table-tags td:last-child {
  width: 224px !important;
  min-width: 224px !important;
}

.dictionary-table-saas .dictionary-actions {
  justify-content: center !important;
  min-width: 200px !important;
  width: 100% !important;
  max-width: 208px !important;
  margin-inline: auto !important;
}

.dictionary-table-saas .dictionary-actions .btn,
.dictionary-table-saas .dictionary-actions .inline-form,
.dictionary-table-saas .dictionary-actions .inline-form .btn {
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  flex: 0 0 96px !important;
}

.dictionary-table-saas .dictionary-actions .btn,
.dictionary-table-saas .dictionary-actions .inline-form .btn {
  padding-inline: 10px !important;
}

@media (max-width: 720px) {
  .dictionary-table-saas th:last-child,
  .dictionary-table-saas td:last-child,
  .dictionary-table-saas.dictionary-table-tags th:last-child,
  .dictionary-table-saas.dictionary-table-tags td:last-child {
    width: auto !important;
    min-width: 0 !important;
  }

  .dictionary-table-saas .dictionary-actions {
    max-width: none !important;
  }
}



/* Custom select v71: full text discoverability for clipped options. */
.table-wrap table .cd-select-menu {
  min-width: max(100%, 220px) !important;
  width: max-content !important;
  max-width: min(360px, calc(100vw - 32px)) !important;
}

.table-wrap table .cd-select-option {
  max-width: 100%;
}

/* Topbar anchored popovers v72 */
.topbar {
  overflow: visible;
}
.topbar-tools {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  overflow: visible;
}
.topbar-tools > details {
  position: relative !important;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}
.topbar-tools > details > summary {
  position: relative;
}
.topbar-tools .language-menu-panel,
.topbar-tools .notification-panel,
.topbar-tools .user-menu-panel {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 1200 !important;
}
.topbar-tools .language-menu-panel {
  width: max-content;
  min-width: 190px;
  max-width: min(300px, calc(100vw - 24px));
}
.topbar-tools .notification-panel {
  width: min(360px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px);
}
.topbar-tools .user-menu-panel {
  width: min(290px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px);
}
@media (max-width: 720px) {
  .topbar-tools {
    gap: 8px;
  }
  .topbar-tools > details {
    position: relative !important;
  }
  .topbar-tools .language-menu-panel,
  .topbar-tools .notification-panel,
  .topbar-tools .user-menu-panel {
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
  }
}

/* Dictionary checkbox alignment v73 */
.page--dictionary > .panel > .dictionary-create-form .dictionary-checkbox {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: max-content !important;
  min-width: max-content !important;
  max-width: 100% !important;
  min-height: 38px !important;
  padding: 0 2px !important;
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}
.page--dictionary > .panel > .dictionary-create-form .dictionary-checkbox input[type="checkbox"] {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  border-style: solid !important;
  border-radius: 5px !important;
}
.page--dictionary > .panel > .dictionary-create-form .dictionary-checkbox span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dictionary-table-saas .dictionary-checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 32px !important;
}
.dictionary-table-saas .dictionary-checkbox input[type="checkbox"] {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  border-style: solid !important;
  border-radius: 5px !important;
}
.dictionary-table-saas .dictionary-checkbox span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 960px) {
  .page--dictionary > .panel > .dictionary-create-form .dictionary-checkbox {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Topbar popover visual anchoring v74 */
.topbar-tools > details {
  isolation: isolate;
}
.topbar-tools .language-menu-panel {
  left: 0 !important;
  right: auto !important;
  transform: none !important;
  width: 240px !important;
  min-width: 240px !important;
  max-width: min(240px, calc(100vw - 24px)) !important;
}
.topbar-tools .notification-panel {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: min(360px, calc(100vw - 24px)) !important;
}
.topbar-tools .user-menu-panel {
  left: auto !important;
  right: 0 !important;
  transform: none !important;
  width: min(300px, calc(100vw - 24px)) !important;
}
.topbar-tools .language-menu-panel,
.topbar-tools .notification-panel,
.topbar-tools .user-menu-panel {
  top: calc(100% + 12px) !important;
  border-radius: 16px !important;
}
@media (max-width: 720px) {
  .topbar-tools .language-menu-panel {
    left: auto !important;
    right: 0 !important;
    width: min(240px, calc(100vw - 24px)) !important;
    min-width: min(240px, calc(100vw - 24px)) !important;
  }
  .topbar-tools .notification-panel {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 70px !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 92px) !important;
    overflow: hidden auto !important;
  }
  .notification-head {
    align-items: flex-start;
    justify-content: space-between;
  }
}


/* Live Storage ECG Heartbeat Chart */
.storage-ping-chart.ecg-light-theme {
  background: #ffffff !important;
  border: 1.5px dashed var(--line) !important;
  box-shadow: none !important;
  min-height: 178px !important;
  padding: 14px 14px 10px !important;
}
.storage-ping-chart.ecg-light-theme .storage-chart-head span {
  color: var(--text) !important;
}
.storage-chart-head--ecg {
  margin-bottom: 8px;
}
.storage-ecg-frame {
  display: flex;
  flex-direction: column;
  height: 104px;
  position: relative;
}
.storage-ecg-plot {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
}
.storage-ping-chart.ecg-light-theme .storage-ecg-svg {
  display: block;
  width: 100%;
  height: 100%;
  margin-top: 0;
  overflow: visible;
}
.storage-ecg-axis {
  display: flex;
  justify-content: space-between;
  height: 16px;
  padding-top: 3px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 8.5px;
  font-weight: 500;
  user-select: none;
}
.ecg-grid-pattern-light {
  fill: url(#ecgGridLightPattern) !important;
}
.ecg-line-pulse-red {
  stroke: #dc2626 !important;
  stroke-width: .95px !important;
  vector-effect: non-scaling-stroke !important;
}
.storage-ping-chart.is-offline .ecg-line-pulse-red {
  stroke: #94a3b8 !important;
  stroke-width: .95px !important;
  vector-effect: non-scaling-stroke !important;
}

/* Integrations panel symmetry */
#integrations {
  overflow: visible;
}
#integrations .panel-heading {
  margin-bottom: 20px;
}
#integrations .panel-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  line-height: 1.2;
}
#integrations .panel-heading .muted {
  max-width: 760px;
  margin: 0;
  line-height: 1.55;
}
#integrations .integration-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}
#integrations .integration-card {
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 16px;
  min-height: 180px;
  padding: 18px;
  border-radius: 12px;
}
#integrations .integration-card-head {
  min-height: 34px;
}
#integrations .integration-card h3 {
  min-width: 0;
  font-size: 16px;
  line-height: 1.25;
}
#integrations .integration-card h3 svg {
  flex: 0 0 auto;
}
#integrations .integration-card .badge {
  flex: 0 0 auto;
  min-height: 28px;
  padding-inline: 14px;
  line-height: 1;
}
#integrations .config-list {
  align-content: start;
  gap: 10px;
}
#integrations .config-list div {
  grid-template-columns: minmax(132px, .42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-height: 24px;
}
#integrations .config-list dt,
#integrations .storage-box-metrics span,
#integrations .storage-chart-head {
  line-height: 1.25;
}
#integrations .config-list dd {
  line-height: 1.35;
}
#integrations .storage-box-card {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 16px;
  min-height: 0;
  overflow: visible;
}
#integrations .storage-box-metrics {
  gap: 14px;
}
#integrations .storage-box-metrics div {
  min-height: 90px;
  padding: 14px 16px;
  border-radius: 12px;
}
#integrations .storage-box-metrics strong {
  display: block;
  line-height: 1.15;
}
#integrations .storage-ping-chart.ecg-light-theme {
  min-height: 172px !important;
  padding: 14px 16px 10px !important;
  border-radius: 12px !important;
}
#integrations .storage-ecg-frame {
  height: 112px;
}
#integrations .storage-box-note {
  padding: 12px 14px;
  line-height: 1.45;
}
#integrations .integration-note {
  margin-top: 16px;
  line-height: 1.45;
}
@media (max-width: 980px) {
  #integrations .integration-grid {
    grid-template-columns: 1fr;
  }
  #integrations .integration-card,
  #integrations .storage-box-card {
    min-height: 0;
  }
}
@media (max-width: 640px) {
  #integrations .panel-heading {
    margin-bottom: 16px;
  }
  #integrations .panel-heading h2 {
    align-items: flex-start;
    font-size: 20px;
  }
  #integrations .integration-grid {
    gap: 12px;
  }
  #integrations .integration-card {
    gap: 14px;
    padding: 14px;
  }
  #integrations .integration-card-head {
    align-items: flex-start;
  }
  #integrations .integration-card .badge {
    min-height: 26px;
    padding-inline: 10px;
  }
  #integrations .config-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  #integrations .storage-admin-config {
    grid-template-columns: 1fr;
  }
  #integrations .storage-box-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #integrations .storage-box-metrics div {
    min-height: 78px;
  }
  #integrations .storage-ping-chart.ecg-light-theme {
    min-height: 156px !important;
    padding-inline: 12px !important;
  }
  #integrations .storage-ecg-frame {
    height: 100px;
  }
  #integrations .storage-ecg-axis {
    font-size: 8px;
  }
}


/* Reports charts layout */
.report-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.report-chart-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.report-chart-panel h2 {
  margin-top: 0;
  margin-bottom: 16px;
}
@media (max-width: 980px) {
  .report-charts {
    grid-template-columns: 1fr;
  }
}



/* Wiki Module */
.wiki-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.wiki-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 70px;
}
.wiki-sidebar h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wiki-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wiki-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}
.wiki-nav a:hover {
  background: #f1f5f9;
}
.wiki-nav a.is-active {
  background: color-mix(in srgb, var(--brand-dark) 8%, #fff);
  color: var(--brand-dark);
  font-weight: 600;
}
.wiki-content {
  flex-grow: 1;
  min-width: 0;
}
.wiki-article {
  padding: 32px;
}
.wiki-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.wiki-header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  color: var(--text);
}
.wiki-header p {
  margin: 0;
  font-size: 16px;
}
.wiki-body h3 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 20px;
  color: var(--text);
}
.wiki-body p, .wiki-body ul, .wiki-body ol {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 16px;
}
.wiki-body li {
  margin-bottom: 8px;
}
.wiki-body pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 14px;
  margin: 20px 0;
}
@media (max-width: 980px) {
  .wiki-layout {
    flex-direction: column;
  }
  .wiki-sidebar {
    width: 100%;
    position: static;
  }
  .wiki-article {
    padding: 20px;
  }
}


/* Dashboard document analytics */
.dashboard-analytics-panel {
  overflow: hidden;
}
.dashboard-analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(226, 232, 240, .8);
}
.dashboard-analytics-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.dashboard-analytics-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
  flex: 0 0 auto;
}
.dashboard-analytics-tab {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  min-height: 30px;
  padding: 6px 14px;
}
.dashboard-analytics-tab.is-active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.dashboard-analytics-body {
  display: grid;
  grid-template-columns: minmax(230px, 272px) minmax(0, 1fr);
  min-width: 0;
}
.dashboard-analytics-calendar {
  border-right: 1px solid rgba(226, 232, 240, .8);
  padding: 20px 20px 18px 0;
  min-width: 0;
}
.dashboard-analytics-chart {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 0 2px 24px;
}
.analytics-calendar-nav,
.analytics-chart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.analytics-icon-btn {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--brand-dark);
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.analytics-icon-btn:hover {
  background: rgba(17, 106, 204, .06);
}
.analytics-calendar-current {
  text-align: center;
}
.analytics-calendar-current strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
}
.analytics-calendar-current span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 1px;
}
.analytics-year-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin: 14px 0;
}
.analytics-year-pill {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  min-height: 26px;
  padding: 4px 10px;
}
.analytics-year-pill.is-active {
  background: #eef6ff;
  border-color: #bfdbfe;
  color: var(--brand-dark);
}
.analytics-weekdays,
.analytics-calendar-grid {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.analytics-weekdays {
  margin-bottom: 5px;
}
.analytics-weekdays span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.analytics-day-cell {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 700;
  justify-content: center;
  min-width: 0;
  padding: 0;
}
.analytics-day-cell.is-blank {
  pointer-events: none;
}
.analytics-day-cell.is-empty { background: transparent; }
.analytics-day-cell.is-low { background: #eef6ff; color: #335c91; }
.analytics-day-cell.is-mid { background: #dbeafe; color: #1d4ed8; }
.analytics-day-cell.is-high { background: #93c5fd; color: #0f3f86; }
.analytics-day-cell.is-max,
.analytics-day-cell.is-active { background: var(--brand-dark); color: #fff; }
.analytics-day-cell.is-today {
  border-color: var(--brand-dark);
}
.analytics-heat-legend {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 14px;
}
.analytics-heat-legend span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
}
.analytics-heat-legend i {
  border-radius: 3px;
  display: block;
  height: 12px;
  width: 12px;
}
.analytics-heat-legend i:nth-of-type(1) { background: #f8fafc; border: 1px solid #e2e8f0; }
.analytics-heat-legend i:nth-of-type(2) { background: #eef6ff; }
.analytics-heat-legend i:nth-of-type(3) { background: #dbeafe; }
.analytics-heat-legend i:nth-of-type(4) { background: #93c5fd; }
.analytics-heat-legend i:nth-of-type(5) { background: var(--brand-dark); }
.analytics-overline {
  color: #94a3b8;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.analytics-total {
  align-items: baseline;
  display: flex;
  gap: 7px;
}
.analytics-total strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}
.analytics-total span,
.analytics-hint {
  color: var(--muted);
  font-size: 12px;
}
.analytics-back-btn[hidden] {
  display: none;
}
.analytics-bars-shell {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  margin-top: 24px;
  min-height: 220px;
  min-width: 0;
}
.analytics-y-axis {
  color: #94a3b8;
  display: flex;
  flex: 0 0 32px;
  flex-direction: column;
  font-size: 10px;
  justify-content: space-between;
  padding-bottom: 28px;
  text-align: right;
}
.analytics-bars-area {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}
.analytics-grid-lines {
  bottom: 28px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}
.analytics-grid-lines i {
  background: rgba(226, 232, 240, .85);
  display: block;
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
}
.analytics-grid-lines i:nth-child(1) { top: 0; }
.analytics-grid-lines i:nth-child(2) { top: 50%; }
.analytics-grid-lines i:nth-child(3) { bottom: 0; }
.analytics-bars,
.analytics-x-labels {
  display: flex;
  gap: 5px;
  left: 0;
  min-width: 0;
  position: absolute;
  right: 0;
}
.analytics-bars {
  align-items: flex-end;
  bottom: 28px;
  overflow: hidden;
  top: 0;
}
.analytics-x-labels {
  bottom: 0;
  height: 24px;
  overflow: hidden;
}
.analytics-bar {
  align-items: flex-end;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  padding: 0;
}
.analytics-bar span {
  background: #dbeafe;
  border-radius: 6px 6px 0 0;
  display: block;
  min-height: 0;
  transition: background .15s ease, transform .15s ease;
  width: 100%;
}
.analytics-bar:hover span,
.analytics-bar.is-active span {
  background: var(--brand-dark);
  transform: translateY(-2px);
}
.analytics-x-labels span {
  color: #94a3b8;
  flex: 1 1 0;
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}
.analytics-bars.is-day-mode {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.analytics-x-labels.is-day-mode {
  overflow: hidden;
}
.analytics-bars.is-day-mode .analytics-bar,
.analytics-x-labels.is-day-mode span {
  flex: 0 0 16px;
}
.analytics-x-labels.is-day-mode span {
  transform: translateX(var(--analytics-day-scroll, 0));
}
.analytics-hint {
  margin: 16px 0 0;
  text-align: right;
}

@media (max-width: 980px) {
  .dashboard-analytics-body {
    grid-template-columns: 1fr;
  }
  .dashboard-analytics-calendar {
    border-bottom: 1px solid rgba(226, 232, 240, .8);
    border-right: 0;
    padding: 18px 0;
  }
  .dashboard-analytics-chart {
    padding: 20px 0 2px;
  }
}

@media (max-width: 640px) {
  .dashboard-analytics-head,
  .analytics-chart-top {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-analytics-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .dashboard-analytics-tab {
    padding-left: 8px;
    padding-right: 8px;
  }
  .analytics-bars-shell {
    gap: 8px;
    min-height: 190px;
  }
  .analytics-total strong {
    font-size: 28px;
  }
  .analytics-day-cell {
    border-radius: 6px;
    font-size: 10px;
  }
}

/* Client file manager */
.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.file-manager-head {
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.file-manager-count {
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}
.file-manager-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.file-manager-policy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 7%, white);
}
.file-manager-policy > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.file-manager-policy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
  font-size: 13px;
}
.file-manager-policy span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}
.file-manager-policy .drag-drop-hint {
  justify-self: start;
  margin: 4px 0 0;
}
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.file-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 238px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.file-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}
.file-card.is-dragging {
  opacity: .45;
  transform: scale(.98);
}
.file-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4ed8;
  flex: 0 0 auto;
}
.file-card-icon svg,
.file-card-icon i {
  width: 22px;
  height: 22px;
}
.file-type-pdf { background: #fff1f2; color: #be123c; }
.file-type-png { background: #ecfdf5; color: #047857; }
.file-type-doc,
.file-type-docx { background: #eff6ff; color: #1d4ed8; }
.file-type-xls,
.file-type-xlsx { background: #ecfdf5; color: #15803d; }
.file-type-ppt,
.file-type-pptx { background: #fff7ed; color: #c2410c; }
.file-extension {
  margin-left: auto;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}
.file-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.file-card-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.file-card-title:hover {
  color: var(--brand-dark);
}
.file-card-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-card-info {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.file-card-info span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.file-card-tags {
  min-height: 28px;
}
.file-card-tags .tag-list {
  gap: 5px;
}
.file-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.file-card-footer .btn {
  flex: 0 0 auto;
}
.file-empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 260px;
  padding: 34px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 68%, white);
  color: var(--muted);
  text-align: center;
}
.file-empty-state > svg,
.file-empty-state > i {
  width: 38px;
  height: 38px;
  color: var(--brand-dark);
}
.file-empty-state strong {
  color: var(--text);
  font-size: 17px;
}
.file-empty-state span {
  max-width: 420px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}

@media (max-width: 760px) {
  .titlebar-actions,
  .file-manager-actions {
    justify-content: stretch;
    width: 100%;
  }
  .titlebar-actions .btn,
  .file-manager-actions .btn {
    flex: 1 1 150px;
    justify-content: center;
  }
  .file-manager-policy {
    align-items: flex-start;
    flex-direction: column;
  }
  .file-grid {
    grid-template-columns: 1fr;
  }
  .file-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .file-card-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .file-card-footer .btn {
    justify-content: center;
    width: 100%;
  }
}

/* Users roles v1: card-like checkbox choices for create/edit user forms. */
.role-choice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.role-choice {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  min-width: 0;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: var(--control-radius);
  background: linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--brand) 4%, #fff) 100%);
  color: var(--muted);
  cursor: pointer;
  line-height: 1.3;
  position: relative;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.role-choice input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.role-choice > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.role-choice strong,
.role-choice small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-choice strong {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.role-choice small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.role-choice.is-selected,
.role-choice:has(input[type="checkbox"]:checked) {
  border-color: color-mix(in srgb, #ff8a1f 72%, var(--line));
  background: color-mix(in srgb, #ff8a1f 13%, #fff);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #ff8a1f 32%, transparent),
    0 10px 22px color-mix(in srgb, #ff8a1f 13%, transparent);
}

.role-choice.is-selected strong,
.role-choice:has(input[type="checkbox"]:checked) strong {
  color: #ff8a1f;
}

.role-choice:hover,
.role-choice:focus-within {
  border-color: color-mix(in srgb, #ff8a1f 46%, var(--line));
  background: color-mix(in srgb, #ff8a1f 7%, #fff);
  box-shadow: 0 10px 22px rgba(25, 42, 70, .07);
  transform: translateY(-1px);
}

.role-choice.is-selected::after,
.role-choice:has(input[type="checkbox"]:checked)::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff8a1f;
  box-shadow: 0 0 0 4px color-mix(in srgb, #ff8a1f 13%, transparent);
}

.create-user-roles .role-choice-list,
.user-role-field {
  grid-column: 1 / -1;
}

.user-role-field .role-choice-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Portal icons v1: keep summary icons as plain line icons without tile background. */
.portal-stat .icon,
.template-starter-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  color: var(--brand-dark);
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.portal-stat .icon svg,
.template-starter-icon svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 1100px) {
  .role-choice-list,
  .user-role-field .role-choice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .role-choice-list,
  .user-role-field .role-choice-list {
    grid-template-columns: 1fr;
  }

  .role-choice {
    min-height: 0;
  }
}


/* Signature workflow redesign - Final Symmetry */
.workflow-item-stack {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  display: block !important;
}
.workflow-route-head {
  margin: 16px 20px 0;
  padding: 14px 20px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.signature-request-note,
.signature-request-documents {
  margin: 16px 20px;
  padding: 16px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}
.signature-request-documents {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.approval-steps {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.approval-step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.approval-step.is-signed { 
  background: color-mix(in srgb, var(--success) 3%, #fff);
  border-color: color-mix(in srgb, var(--success) 20%, var(--line));
}
.approval-step.is-pending { 
  background: color-mix(in srgb, var(--warning) 3%, #fff);
  border-color: color-mix(in srgb, var(--warning) 25%, var(--line));
}
.approval-step.is-rejected { 
  background: color-mix(in srgb, var(--danger) 3%, #fff);
  border-color: color-mix(in srgb, var(--danger) 20%, var(--line));
}

.signature-signer-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.signature-signer-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 20px;
  font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.approval-step.is-signed .signature-signer-avatar { border-color: var(--success); }
.approval-step.is-pending .signature-signer-avatar { border-color: var(--warning); }
.approval-step.is-rejected .signature-signer-avatar { border-color: var(--danger); }

.signature-signer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.signature-signer-copy {
  display: grid;
  gap: 4px;
}
.signature-signer-copy strong {
  font-size: 16px;
  color: var(--text);
}
.signature-signer-status {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.signature-signer-reason {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}

.signature-signer-details {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.signature-upload-form {
  margin-top: auto;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.signature-upload-form label {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.signature-upload-form .input-group-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.signature-upload-form input[type="file"] {
  flex: 1;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  min-width: 0;
}
.signature-upload-form .btn {
  white-space: nowrap;
  padding: 0 20px;
}
.signature-upload-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.signature-file-list {
  margin: 16px 0;
  padding: 16px;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.signature-file-list strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.signature-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}
.signature-file-item:hover { text-decoration: underline; }

.signature-approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.signature-approval-actions .btn {
  height: 44px;
  font-weight: 700;
  border-radius: 10px;
}

.signature-reject-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.signature-reject-form input {
  height: 44px;
  border-radius: 10px;
}

@media (max-width: 1200px) {
  .approval-steps {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 800px) {
  .signature-upload-form .input-group-row {
    flex-direction: column;
  }
  .signature-upload-form .btn {
    width: 100%;
    height: 42px;
  }
  .signature-approval-actions {
    grid-template-columns: 1fr;
  }
  .approval-step {
    padding: 20px;
  }
}

/* Info Popovers */
.info-popover-wrapper {
  display: inline-block;
  position: relative;
  margin-left: 6px;
  vertical-align: middle;
}
.info-popover-trigger {
  color: var(--muted);
  cursor: help;
  display: flex;
}
.info-popover-trigger:hover {
  color: var(--brand);
}
.info-popover-content {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #1e293b;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
  pointer-events: none;
}
.info-popover-wrapper:hover .info-popover-content {
  visibility: visible;
  opacity: 1;
}
.info-popover-content a {
  color: var(--brand);
  text-decoration: underline;
  pointer-events: auto;
}

@media (max-width: 600px) {
  .info-popover-content {
    left: auto;
    right: -10px;
    transform: none;
    width: 200px;
  }
}

.global-health-popover {
  right: 0;
  left: auto;
  transform: none;
}
@media (max-width: 820px) {
  .global-health-popover {
    left: 0 !important;
    right: auto !important;
  }
}

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

/* Premium SaaS Stepper - Inner Frame Style */
.doc-execution-panel {
  margin-bottom: 32px;
  padding: 40px;
  background: #ecf0f1;
  border: 1px solid #d1d8dd;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
  position: relative;
}

.doc-execution-panel::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  left: 12px;
  border: 1px dashed #bdc3c7;
  border-radius: 14px;
  pointer-events: none;
}

.saas-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.saas-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.saas-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.saas-step-label {
  font-size: 13px;
  font-weight: 700;
  color: #34495e;
}

.saas-step-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 2px;
}

/* Status: Completed */
.saas-step.is-complete .saas-step-icon {
  background: #25C196;
  border-color: #25C196;
  color: #fff;
}

/* Status: Active (In Progress) - Blue Pulse */
@keyframes saas-pulse-blue {
  0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

.saas-step.is-active .saas-step-icon {
  background: #fff;
  border-color: #3498db;
  color: #3498db;
  animation: saas-pulse-blue 2s infinite;
}
.saas-step.is-active .saas-step-label {
  color: #3498db;
}

/* Status: Alert (Rejected) - Red Pulse */
@keyframes saas-pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.saas-step.is-alert .saas-step-icon {
  background: #fff;
  border-color: #e74c3c;
  color: #e74c3c;
  animation: saas-pulse-red 1.5s infinite;
}
.saas-step.is-alert .saas-step-label {
  color: #e74c3c;
}

/* Status: Skipped */
.saas-step.is-skipped .saas-step-icon {
  background: transparent;
  border-style: dashed;
  opacity: 0.5;
}
.saas-step.is-skipped .saas-step-label {
  opacity: 0.5;
  font-style: italic;
}

/* Connectors */
.saas-step::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: var(--line);
  z-index: -1;
}
.saas-step:last-child::after { display: none; }

.saas-step.is-complete::after {
  background: #25C196;
}

@media (max-width: 768px) {
  .doc-execution-panel { padding: 30px 20px; }
  .saas-stepper { flex-direction: column; gap: 24px; }
  .saas-step { flex-direction: row; gap: 16px; align-items: flex-start; }
  .saas-step-icon { margin-bottom: 0; flex-shrink: 0; }
  .saas-step::after {
    left: 17px;
    top: 36px;
    width: 2px;
    bottom: -24px;
    height: auto;
  }
}






/* Smart Security Alerts */
.doc-alerts-container {
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
}

.doc-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.doc-alert .alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.doc-alert .alert-content {
  flex: 1;
}

.doc-alert .alert-action {
  flex-shrink: 0;
}

/* Alert Variants */
.doc-alert.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.doc-alert.is-danger .alert-icon { color: #dc2626; }

.doc-alert.is-warning {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
}
.doc-alert.is-warning .alert-icon { color: #d97706; }

.doc-alert.is-info {
  background: #eff6ff;
  border-color: #dbeafe;
  color: #1e40af;
}
.doc-alert.is-info .alert-icon { color: #2563eb; }

.doc-alert.is-success {
  background: #f0fdf4;
  border-color: #dcfce7;
  color: #166534;
}
.doc-alert.is-success .alert-icon { color: #16a34a; }

@media (max-width: 600px) {
  .doc-alert { padding: 12px 16px; font-size: 13px; }
}

.notifications-page .notifications-feed {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}
.notifications-page .notifications-feed .notification-item:last-child {
  border-bottom: 0;
}

/* Glassmorphism Panel styles for /browser */
.browser-tree.panel,
.browser-documents.panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 233, 243, 0.45);
  box-shadow: 0 8px 30px rgba(25, 42, 70, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Active folder tree node gradient background */
.browser-tree .tree-node.is-active {
  background: linear-gradient(135deg, #273c75 0%, #1e2e5c 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(39, 60, 117, 0.22);
}
.browser-tree .tree-node.is-active .tree-label i,
.browser-tree .tree-node.is-active .tree-label svg,
.browser-tree .tree-node.is-active strong {
  color: #fff !important;
}

/* Drag over indicator pulse animation */
.browser-tree .tree-node.drag-hover {
  background: rgba(39, 60, 117, 0.08) !important;
  box-shadow: inset 0 0 0 2px #273c75 !important;
  animation: pulse-drag 1.5s infinite;
}
@keyframes pulse-drag {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* View toggle styling */
.browser-view-toggle .btn-view-toggle.is-active {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Document List/Grid Container */
.browser-documents-container.view-list .file-list-header {
  display: grid;
  grid-template-columns: 2.5fr 1.5fr 1fr 100px;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.browser-documents-container.view-grid .file-list-header {
  display: none;
}

/* Unified File Item styling */
.file-item {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.file-item:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
  transform: translateY(-2px);
}
.file-item.is-dragging {
  opacity: .45;
  transform: scale(.98);
}

/* file-item under Grid View */
.view-grid .file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.view-grid .file-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 238px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}
.view-grid .file-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-grid .file-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  flex: 0 0 auto;
}
.view-grid .file-item-icon svg,
.view-grid .file-item-icon i {
  width: 22px;
  height: 22px;
}
.view-grid .file-extension-badge {
  margin-left: auto;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.view-grid .file-item-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.view-grid .file-item-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.view-grid .file-item-title:hover {
  color: var(--brand-dark);
}
.view-grid .file-item-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-grid .file-item-info {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.view-grid .file-item-info span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.view-grid .file-item-tags {
  min-height: 28px;
}
.view-grid .file-item-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.view-grid .file-item-right .btn {
  flex: 0 0 auto;
}

/* file-item under List View */
.view-list .file-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.view-list .file-item {
  display: grid;
  grid-template-columns: 2.5fr 1.5fr 1fr 100px;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(15, 23, 42, .01);
}
.view-list .file-item:hover {
  transform: translateX(4px);
}
.view-list .file-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.view-list .file-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.view-list .file-item-icon svg,
.view-list .file-item-icon i {
  width: 16px;
  height: 16px;
}
.view-list .file-extension-badge {
  display: none;
}
.view-list .file-item-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.view-list .file-item-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-list .file-item-title:hover {
  color: var(--brand-dark);
}
.view-list .file-item-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.view-list .file-item-info {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.view-list .file-item-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-list .file-item-tags {
  display: flex;
  align-items: center;
  overflow: hidden;
}
.view-list .file-item-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.view-list .type-badge {
  display: none;
}

/* File format color badges (shared) */
.file-type-pdf { background: #fee2e2 !important; color: #ef4444 !important; }
.file-type-png, .file-type-jpg, .file-type-jpeg { background: #f3e8ff !important; color: #a855f7 !important; }
.file-type-doc, .file-type-docx { background: #eff6ff !important; color: #3b82f6 !important; }
.file-type-xls, .file-type-xlsx { background: #f0fdf4 !important; color: #22c55e !important; }
.file-type-ppt, .file-type-pptx { background: #fff7ed !important; color: #f97316 !important; }

@media (max-width: 768px) {
  .browser-documents-container.view-list .file-list-header {
    display: none;
  }
  .view-list .file-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .view-list .file-item-right {
    justify-content: flex-start;
  }
  .view-list .file-item-info {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
}



/* SaaS Theme updates - Phase 2 */

/* Dashed borders on main blocks & panels */
.browser-tree.panel,
.browser-documents.panel {
  border: 1.5px dashed var(--line) !important;
  border-radius: 12px !important;
}

.file-manager-policy {
  border: 1.5px dashed var(--line) !important;
  border-radius: 10px !important;
}

.view-grid .file-item {
  border: 1.5px dashed var(--line) !important;
  border-radius: 12px !important;
}

.view-grid .file-item:hover {
  border-style: solid !important;
  border-color: var(--brand-dark) !important;
}

.view-list .file-item {
  border: 1.5px dashed var(--line) !important;
  border-radius: 8px !important;
}

.view-list .file-item:hover {
  border-style: solid !important;
  border-color: var(--brand-dark) !important;
}

/* Beautiful directory tree connecting guide lines */
.browser-tree .tree-subnodes {
  border-left: 1.5px dashed rgba(148, 163, 184, 0.3) !important;
  margin-left: 10px !important;
  padding-left: 16px !important;
}

.browser-tree .tree-subnodes .tree-node {
  position: relative;
}

.browser-tree .tree-subnodes .tree-node::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  width: 10px;
  height: 1.5px;
  border-top: 1.5px dashed rgba(148, 163, 184, 0.3);
  transform: translateY(-50%);
}

/* Rounded counter badges in tree */
.browser-tree .tree-node strong {
  border-radius: 999px !important;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px !important;
  background: rgba(148, 163, 184, 0.1) !important;
  color: #64748b !important;
  transition: all 0.2s ease;
}

.browser-tree .tree-node:hover strong {
  background: rgba(148, 163, 184, 0.2) !important;
  color: #475569 !important;
}

/* Beautiful SaaS Dark gradient for active tree row */
.browser-tree .tree-node.is-active {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12) !important;
  border-radius: 8px !important;
}

.browser-tree .tree-node.is-active .tree-label i,
.browser-tree .tree-node.is-active .tree-label svg {
  color: #ffffff !important;
}

.browser-tree .tree-node.is-active strong {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* === Mass-select & bulk ZIP download === */
.col-check {
  width: 36px;
  text-align: center;
  padding-left: 10px !important;
  padding-right: 4px !important;
}
.col-check input[type="checkbox"],
.doc-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #116ACC;
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #eaf3ff;
  border: 1px solid #c3ddfb;
  border-radius: 9px;
  margin-bottom: 10px;
  animation: fadeIn 0.15s ease;
}
.bulk-bar-count {
  font-size: 13px;
  font-weight: 600;
  color: #116ACC;
  flex: 1;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Payment status sidebar tree === */
.side-tree {
  display: grid;
  gap: 0;
}

.side-tree > summary {
  list-style: none;
  cursor: pointer;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
}

.side-tree > summary::-webkit-details-marker,
.side-tree > summary::marker {
  display: none;
}

.side-tree-chevron {
  display: inline-grid;
  place-items: center;
  width: 20px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.side-tree-chevron i,
.side-tree-chevron svg {
  width: 13px !important;
  height: 13px !important;
}

details.side-tree[open] .side-tree-chevron {
  transform: rotate(180deg);
}

.side-tree-body {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  margin-left: 14px;
  margin-top: 2px;
  margin-bottom: 2px;
  border-left: 2px solid #e2e8f0;
}

.side-tree-link {
  min-height: 36px !important;
  padding: 4px 8px !important;
}

.side-tree-link .side-link-copy > span {
  font-size: 12px !important;
}

.side-tree-link .side-link-copy > small {
  font-size: 10px !important;
}
