:root {
  --bg: #eef3f7;
  --ink: #0f172a;
  --muted: #3f5366;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(15, 23, 42, 0.12);
  --primary: #0b7d8a;
  --primary-dark: #065a63;
  --success: #15803d;
  --warn: #d97706;
  --danger: #b42318;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(4, 33, 44, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(11, 125, 138, 0.18), transparent 36%),
    radial-gradient(circle at 86% 16%, rgba(245, 158, 11, 0.18), transparent 40%),
    linear-gradient(180deg, #f8fbff, #e8f1f8 54%, #e5eef7 100%);
  color: var(--ink);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  width: 460px;
  height: 460px;
  border-radius: 999px;
  filter: blur(64px);
  z-index: -1;
}

.bg-orb-a {
  top: -200px;
  left: -140px;
  background: rgba(11, 125, 138, 0.22);
}

.bg-orb-b {
  top: 120px;
  right: -140px;
  background: rgba(245, 158, 11, 0.2);
}

.topbar {
  max-width: 1320px;
  margin: 30px auto 14px;
  padding: 0 24px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 220px;
  max-width: 100%;
}

.brand-logo.small {
  width: 140px;
}

.badge {
  margin: 0;
  display: inline-flex;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0b7285;
  background: rgba(11, 125, 138, 0.12);
  border: 1px solid rgba(11, 125, 138, 0.2);
  border-radius: 999px;
  padding: 5px 10px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(1.4rem, 1.8vw, 2.1rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

.container {
  max-width: 1320px;
  margin: 0 auto 40px;
  padding: 0 24px 30px;
  display: grid;
  gap: 18px;
}

.panel,
.stat-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.compact {
  max-width: 760px;
}

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

.stat-card {
  padding: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(246, 251, 255, 0.92));
}

.label {
  font-size: 0.82rem;
  text-transform: uppercase;
  color: #4c6577;
  letter-spacing: 0.08em;
}

.value {
  font-size: 2rem;
  margin-top: 4px;
  font-weight: 700;
  color: #04303d;
}

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

.grid-form .inline-check,
.grid-form button {
  grid-column: span 2;
}

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

.security-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.security-card h3 {
  margin-bottom: 8px;
}

.mfa-qr-shell {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid rgba(11, 125, 138, 0.28);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(244, 251, 255, 0.92));
}

.mfa-qr-canvas {
  width: 208px;
  min-height: 208px;
  padding: 10px;
  border: 1px dashed rgba(15, 23, 42, 0.24);
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
}

.mfa-qr-canvas canvas,
.mfa-qr-canvas img {
  display: block;
  width: 188px;
  height: 188px;
}

.mfa-qr-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 6px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: #17334a;
}

input,
select,
textarea {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(11, 125, 138, 0.28);
  border-color: #0b7d8a;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.btn {
  border: none;
  border-radius: 11px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #12758a);
  color: #fff;
}

.btn-ghost {
  border: 1px solid rgba(12, 50, 63, 0.2);
  background: rgba(255, 255, 255, 0.7);
  color: #0f2f41;
}

.btn-mini {
  padding: 6px 10px;
  font-size: 0.8rem;
  border: 1px solid rgba(11, 125, 138, 0.3);
  background: rgba(11, 125, 138, 0.08);
  color: #0b5964;
}

.btn-mini.danger {
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.08);
  color: #9f251a;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  padding: 10px 8px;
  font-size: 0.87rem;
}

th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3e5f77;
  font-size: 0.72rem;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.14);
  text-transform: uppercase;
}

.status-issued,
.status-pending-issue,
.status-pending-anchor {
  color: #925c0a;
  background: rgba(245, 158, 11, 0.14);
}

.status-anchored,
.status-not-required {
  color: #146534;
  background: rgba(21, 128, 61, 0.12);
}

.status-na {
  color: #3f5366;
  background: rgba(148, 163, 184, 0.2);
}

.status-failed-anchor,
.status-failed,
.status-inactive {
  color: #9a3412;
  background: rgba(180, 35, 24, 0.12);
}

.error-text {
  color: #b42318;
  word-break: break-word;
}

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

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

.level-card {
  border: 1px solid rgba(11, 125, 138, 0.24);
  border-radius: 14px;
  padding: 14px;
  text-decoration: none;
  color: #0e3c4a;
  background: linear-gradient(160deg, rgba(11, 125, 138, 0.07), rgba(245, 158, 11, 0.08));
}

.level-card p {
  margin-top: 4px;
  color: #365468;
}

.hint {
  margin-top: 8px;
  color: #3f5366;
  font-size: 0.86rem;
}

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

.audit-list article {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.audit-list header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  color: #12334d;
}

.audit-list p {
  margin-top: 5px;
  font-size: 0.8rem;
  color: #496175;
}

.audit-list code {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: #134b5e;
  word-break: break-all;
}

.flash {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(21, 128, 61, 0.12);
  color: #14532d;
  border-color: rgba(21, 128, 61, 0.28);
}

.flash-error {
  background: rgba(180, 35, 24, 0.1);
  color: #7f1d1d;
  border-color: rgba(180, 35, 24, 0.22);
}

.flash-info {
  background: rgba(11, 125, 138, 0.1);
  color: #115e67;
  border-color: rgba(11, 125, 138, 0.22);
}

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

.login-shell {
  width: min(980px, 100% - 28px);
  padding: 20px 0;
}

.sign-body {
  min-height: 100vh;
  padding: 26px 16px 36px;
  background:
    radial-gradient(circle at 10% 4%, rgba(17, 113, 199, 0.14), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(11, 125, 138, 0.16), transparent 38%),
    linear-gradient(180deg, #edf3f8 0%, #dce8f2 100%);
}

.sign-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.sign-shell-enterprise {
  gap: 14px;
}

.sign-hero {
  border-radius: 16px;
  border: 1px solid rgba(8, 56, 84, 0.26);
  background: linear-gradient(135deg, #07273b 0%, #0d3e5c 48%, #0d5f7e 100%);
  color: #e7f6ff;
  padding: 16px 18px;
  box-shadow: 0 18px 44px rgba(4, 28, 44, 0.22);
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.sign-hero-brand {
  display: flex;
  align-items: center;
}

.sign-hero-logo {
  width: 188px;
}

.sign-hero-copy h1 {
  margin: 4px 0;
  font-size: clamp(1.25rem, 1.8vw, 1.9rem);
}

.sign-hero .badge {
  color: #d5f3ff;
  border-color: rgba(171, 226, 247, 0.35);
  background: rgba(155, 222, 247, 0.16);
}

.sign-hero-copy p {
  margin: 0;
  color: rgba(232, 247, 255, 0.9);
  font-size: 0.92rem;
}

.sign-status-banner {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
}

.sign-status-banner p {
  margin-top: 6px;
  color: #213e50;
}

.sign-status-banner.tone-success {
  border-color: rgba(21, 128, 61, 0.32);
  background: rgba(231, 251, 239, 0.9);
}

.sign-status-banner.tone-warn {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(255, 247, 229, 0.92);
}

.sign-status-banner.tone-danger {
  border-color: rgba(180, 35, 24, 0.3);
  background: rgba(255, 236, 234, 0.92);
}

.sign-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #16495d;
  border: 1px solid rgba(11, 125, 138, 0.3);
  background: rgba(11, 125, 138, 0.12);
}

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

.nda-doc-enterprise {
  max-height: 430px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.94);
}

.nda-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.sign-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.sign-canvas-card h3,
.sign-input-card h3 {
  margin-bottom: 8px;
}

.sign-input-card .stack {
  margin-top: 4px;
}

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

.sign-confirm-card h2 {
  margin-bottom: 12px;
}

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

.sign-confirm-grid article {
  border: 1px solid rgba(15, 23, 42, 0.11);
  border-radius: 10px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.78);
}

.sign-confirm-grid h4 {
  margin: 0 0 5px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #486378;
}

.sign-confirm-grid p {
  margin: 0;
  color: #0f344d;
  font-size: 0.92rem;
  word-break: break-word;
}

.login-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.auth-divider {
  margin: 14px 0 10px;
  text-align: center;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: rgba(15, 23, 42, 0.15);
}

.auth-divider span {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  padding: 0 10px;
  color: #4f6677;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.muted {
  margin-top: 6px;
  color: #385267;
}

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

.passkey-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
}

.passkey-meta {
  display: grid;
  gap: 3px;
}

.passkey-meta strong {
  font-size: 0.84rem;
  color: #0f2f45;
}

.passkey-meta span {
  font-size: 0.76rem;
  color: #466177;
}

.nda-doc {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
  margin: 12px 0;
}

.nda-doc pre {
  margin: 0;
  white-space: pre-wrap;
  font: 500 0.86rem/1.55 'Manrope', sans-serif;
  color: #163047;
}

canvas#signature-canvas {
  width: 100%;
  max-width: 100%;
  min-height: 240px;
  background: #ffffff;
  border: 2px solid rgba(11, 125, 138, 0.24);
  border-radius: 12px;
}

canvas#admin-signature-canvas {
  width: 100%;
  max-width: 100%;
  min-height: 190px;
  background: #ffffff;
  border: 2px solid rgba(11, 125, 138, 0.24);
  border-radius: 12px;
}

.nda-admin-signature-grid {
  margin-top: 14px;
}

.canvas-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.reveal {
  animation: revealUp .45s ease both;
}

.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .1s; }
.reveal:nth-child(4) { animation-delay: .15s; }
.reveal:nth-child(5) { animation-delay: .2s; }

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

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

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

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

  .grid-form .inline-check,
  .grid-form button {
    grid-column: auto;
  }

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .sign-hero {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sign-hero-logo {
    width: 164px;
  }

  .sign-form-grid,
  .sign-confirm-grid,
  .sign-fields-grid {
    grid-template-columns: 1fr;
  }
}

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

  .brand-logo {
    width: 150px;
  }

  .panel,
  .login-card {
    padding: 14px;
  }

  .sign-body {
    padding: 18px 12px 24px;
  }

  .sign-hero {
    padding: 13px 12px;
  }
}

.dashboard-body {
  overflow-x: hidden;
}

.dashboard-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.side-nav {
  width: 292px;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid rgba(15, 23, 42, 0.14);
  background: linear-gradient(180deg, rgba(8, 25, 34, 0.98), rgba(15, 42, 58, 0.96));
  color: #e8f6fb;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: width 220ms ease;
  z-index: 20;
}

.side-nav-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.side-logo {
  width: 138px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.35));
}

.side-caption {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(225, 242, 248, 0.88);
  line-height: 1.45;
}

.side-links {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #c9e6ef;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 10px;
  transition: all 180ms ease;
}

.side-link:hover {
  border-color: rgba(0, 192, 240, 0.34);
  background: rgba(0, 192, 240, 0.12);
  color: #f4fdff;
}

.side-link.is-active {
  border-color: rgba(0, 192, 240, 0.5);
  background: linear-gradient(132deg, rgba(0, 192, 240, 0.24), rgba(8, 137, 163, 0.22));
  color: #f8feff;
}

.nav-index {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(207, 236, 244, 0.26);
  font-size: 0.73rem;
  font-weight: 700;
  color: #dbf3fa;
}

.nav-label {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.side-nav-foot {
  margin-top: auto;
  border-top: 1px solid rgba(207, 236, 244, 0.2);
  padding-top: 12px;
  font-size: 0.75rem;
  color: rgba(226, 244, 250, 0.9);
  line-height: 1.4;
}

.side-nav-foot p + p {
  margin-top: 4px;
}

.sidebar-overlay {
  display: none;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
}

.topbar-dashboard {
  max-width: none;
  margin: 24px 24px 12px;
  padding: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(11, 125, 138, 0.22);
  background: rgba(255, 255, 255, 0.74);
  color: #0f3a4a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-open {
  display: none;
}

.side-close {
  display: none;
}

.dashboard-container {
  max-width: none;
  margin: 0 0 42px;
  padding: 0 24px 30px;
}

.dashboard-flash {
  margin-bottom: 4px;
}

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

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

.notification-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

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

.nav-section {
  display: none;
  scroll-margin-top: 96px;
}

.nav-section.is-visible {
  display: block;
}

.nav-section.section-stack.is-visible {
  display: grid;
}

.file-workspace {
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.75);
  display: grid;
  gap: 12px;
}

.file-scope-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 420px;
}

.file-scope-btn {
  border: 1px solid rgba(11, 125, 138, 0.26);
  border-radius: 10px;
  background: rgba(11, 125, 138, 0.06);
  color: #0e3a4a;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 9px 13px;
  cursor: pointer;
  transition: all 180ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-scope-btn:hover {
  border-color: rgba(11, 125, 138, 0.48);
  background: rgba(11, 125, 138, 0.12);
}

.file-scope-btn.is-active {
  border-color: rgba(11, 125, 138, 0.55);
  background: linear-gradient(140deg, rgba(11, 125, 138, 0.2), rgba(18, 117, 138, 0.14));
  color: #094956;
}

.file-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-upload-btn {
  position: relative;
  overflow: hidden;
}

.file-upload-btn input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-workspace-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
}

.file-tree-panel {
  border: 1px solid rgba(11, 125, 138, 0.24);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.94));
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.file-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.file-tree-panel h4 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #345468;
}

.file-tree {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.file-tree-list,
.file-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-tree-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px dashed rgba(15, 23, 42, 0.22);
}

.file-tree-item + .file-tree-item {
  margin-top: 4px;
}

.file-tree-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border-radius: 9px;
}

.file-tree-row.is-drop-target {
  background: rgba(11, 125, 138, 0.14);
}

.file-tree-toggle {
  width: 20px;
  height: 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #3e627b;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.file-tree-toggle:hover {
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.74);
}

.file-tree-toggle.is-empty {
  cursor: default;
  opacity: 0.55;
}

.file-tree-node {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #12364b;
  font: inherit;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.file-tree-item.is-active > .file-tree-row .file-tree-node {
  border-color: rgba(11, 125, 138, 0.34);
  background: rgba(11, 125, 138, 0.12);
  color: #0b5964;
  font-weight: 700;
}

.file-tree-node:hover {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.66);
}

.file-tree-marker {
  width: 14px;
  color: #4a657a;
}

.file-tree-icon {
  width: 16px;
  color: #0b7d8a;
  opacity: 0.9;
}

.file-tree-label {
  word-break: break-word;
}

.file-browser-panel {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
}

.file-browser-panel.is-dragover {
  border-color: rgba(11, 125, 138, 0.55);
  box-shadow: inset 0 0 0 2px rgba(11, 125, 138, 0.16);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.94), rgba(237, 248, 252, 0.95));
}

.file-browser-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.file-breadcrumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.file-breadcrumbs .btn-mini {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.16);
  color: #1d4157;
}

.file-drop-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #4e6578;
}

.file-table {
  min-width: 760px;
}

.file-table td,
.file-table th {
  font-size: 0.82rem;
}

.file-table tbody tr:hover {
  background: rgba(11, 125, 138, 0.06);
}

.file-table tbody tr.is-dragging {
  opacity: 0.55;
}

.file-entry-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-kind {
  min-width: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border: 1px solid transparent;
}

.file-kind.dir {
  color: #0b5964;
  border-color: rgba(11, 125, 138, 0.26);
  background: rgba(11, 125, 138, 0.12);
}

.file-kind.file {
  color: #344b5d;
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(15, 23, 42, 0.06);
}

.file-entry-name {
  font-weight: 600;
  color: #0f3248;
  word-break: break-word;
}

.file-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.file-viewer-shell {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  min-height: 72vh;
}

.file-viewer-frame {
  width: 100%;
  min-height: 72vh;
  border: 0;
  display: block;
  background: #f4f8fb;
}

.file-viewer-shell.has-watermark .file-viewer-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  color: rgba(15, 23, 42, 0.18);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  transform: rotate(-18deg);
  text-transform: uppercase;
}

.dashboard-shell.sidebar-collapsed .side-nav {
  width: 96px;
}

.dashboard-shell.sidebar-collapsed .side-caption,
.dashboard-shell.sidebar-collapsed .nav-label,
.dashboard-shell.sidebar-collapsed .side-nav-foot {
  display: none;
}

.dashboard-shell.sidebar-collapsed .side-nav-head {
  grid-template-columns: 1fr;
}

.dashboard-shell.sidebar-collapsed .side-logo {
  width: 56px;
}

.dashboard-shell.sidebar-collapsed .side-collapse {
  width: 100%;
}

.dashboard-shell.sidebar-collapsed .nav-index {
  min-width: 100%;
}

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

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

  .file-tree-panel,
  .file-browser-panel {
    min-height: 420px;
  }
}

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

  .side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: min(88vw, 320px);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 42;
  }

  .dashboard-shell.sidebar-open .side-nav {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 16, 24, 0.54);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    display: block;
    z-index: 41;
    border: none;
  }

  .dashboard-shell.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar-dashboard {
    margin: 18px 16px 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-left,
  .topbar-right {
    justify-content: space-between;
  }

  .topbar-right {
    flex-wrap: wrap;
  }

  .dashboard-container {
    padding: 0 16px 24px;
  }

  .nav-open {
    display: inline-flex;
  }

  .side-close {
    display: inline-flex;
  }

  .side-collapse {
    display: none;
  }

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

@media (max-width: 760px) {
  .stats-grid,
  .security-grid,
  .settings-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .file-scope-row,
  .file-toolbar {
    width: 100%;
  }

  .file-scope-row {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .brand-wrap {
    gap: 10px;
  }

  .brand-logo.small {
    width: 112px;
  }

  .meta-chip {
    font-size: 0.72rem;
  }

  .passkey-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-tree-panel,
  .file-browser-panel {
    min-height: 320px;
  }
}

/* Enterprise Interface Refresh v2 */
:root {
  --bg: #e8f0fa;
  --ink: #0b1f34;
  --muted: #435b72;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(11, 31, 52, 0.14);
  --line-strong: rgba(11, 31, 52, 0.22);
  --primary: #0a8798;
  --primary-dark: #076573;
  --accent-blue: #1576d2;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --shadow-soft: 0 20px 44px rgba(13, 34, 56, 0.12);
  --shadow-hard: 0 28px 64px rgba(13, 34, 56, 0.2);
}

html {
  font-size: 16px;
}

body {
  font-family: 'Plus Jakarta Sans', 'Space Grotesk', sans-serif;
  background:
    radial-gradient(circle at 10% -8%, rgba(21, 118, 210, 0.2), transparent 32%),
    radial-gradient(circle at 110% 2%, rgba(10, 135, 152, 0.2), transparent 38%),
    linear-gradient(180deg, #f6f9fd 0%, #e7eef8 54%, #dde7f4 100%);
  color: var(--ink);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(11, 31, 52, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 31, 52, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.36), transparent 78%);
  z-index: -3;
}

h1,
h2,
h3,
.value,
.nav-label,
.btn,
.meta-chip,
.status {
  font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
}

h1 {
  letter-spacing: -0.015em;
}

h2,
h3 {
  letter-spacing: -0.01em;
}

.panel,
.stat-card,
.login-card,
.security-card,
.file-workspace,
.file-tree-panel,
.file-browser-panel,
.sign-hero,
.sign-status-banner,
.sign-confirm-grid article,
.mfa-qr-shell,
.nda-doc,
.audit-list article {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.panel,
.stat-card,
.login-card,
.security-card,
.file-workspace,
.file-tree-panel,
.file-browser-panel,
.sign-hero,
.sign-status-banner,
.sign-confirm-grid article,
.mfa-qr-shell,
.nda-doc,
.audit-list article {
  position: relative;
  overflow: hidden;
}

.panel::after,
.security-card::after,
.stat-card::after,
.file-tree-panel::after,
.file-browser-panel::after,
.login-card::after,
.sign-status-banner::after,
.sign-confirm-grid article::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(21, 118, 210, 0.36), rgba(10, 135, 152, 0.2), rgba(255, 255, 255, 0));
}

.panel:hover,
.security-card:hover,
.stat-card:hover,
.file-tree-panel:hover,
.file-browser-panel:hover {
  box-shadow: var(--shadow-hard);
  transform: translateY(-1px);
}

.panel,
.security-card,
.stat-card,
.file-tree-panel,
.file-browser-panel {
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.dashboard-main {
  padding-bottom: 24px;
}

.topbar-dashboard,
.dashboard-container {
  width: min(1560px, calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
}

.topbar-dashboard {
  margin-top: 24px;
  margin-bottom: 16px;
}

.dashboard-container {
  padding: 0 0 32px;
}

.side-nav {
  width: 304px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 14% -8%, rgba(24, 127, 223, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(8, 24, 38, 0.98), rgba(10, 42, 62, 0.96) 58%, rgba(7, 29, 47, 0.98));
  box-shadow: 16px 0 36px rgba(3, 10, 19, 0.18);
}

.side-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.03));
}

.side-link {
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.02);
}

.side-link:hover {
  transform: translateX(3px);
}

.side-link.is-active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 24px rgba(0, 0, 0, 0.22);
}

.topbar-right {
  gap: 10px;
}

.meta-chip {
  border: 1px solid rgba(21, 118, 210, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #0f3552;
  font-size: 0.78rem;
  font-weight: 700;
}

.stats-grid {
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-color: rgba(21, 118, 210, 0.16);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.86));
}

.label {
  color: #516980;
  letter-spacing: 0.085em;
}

.value {
  color: #0a304f;
}

.btn {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-blue));
  box-shadow: 0 12px 26px rgba(10, 135, 152, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0a90a3, #0f6ec4);
  box-shadow: 0 14px 30px rgba(10, 135, 152, 0.34);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
}

.btn-mini {
  border-radius: 10px;
  border-color: rgba(10, 135, 152, 0.32);
  background: rgba(10, 135, 152, 0.08);
  color: #0b5c67;
}

.btn-mini.danger {
  border-color: rgba(180, 35, 24, 0.3);
}

input,
select,
textarea {
  border-radius: 12px;
  border-color: rgba(11, 31, 52, 0.16);
  background: rgba(255, 255, 255, 0.96);
  min-height: 42px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(21, 118, 210, 0.16);
  border-color: rgba(21, 118, 210, 0.52);
}

.table-wrap {
  border: 1px solid rgba(11, 31, 52, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

table {
  min-width: 900px;
}

th,
td {
  padding: 12px 10px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(238, 246, 253, 0.94);
  backdrop-filter: blur(8px);
}

tbody tr {
  transition: background-color 150ms ease, transform 150ms ease;
}

tbody tr:hover {
  background: rgba(21, 118, 210, 0.06);
  transform: translateX(1px);
}

.status {
  border-color: rgba(11, 31, 52, 0.12);
  font-size: 0.7rem;
}

.file-workspace {
  gap: 14px;
  padding: 14px;
  margin-top: 14px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.92), rgba(241, 248, 255, 0.82));
}

.file-workspace-layout {
  gap: 14px;
}

.file-tree-panel,
.file-browser-panel {
  min-height: 600px;
}

.file-tree-panel {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 255, 0.9));
}

.file-tree-row,
.file-tree-node,
.file-tree-toggle,
.file-scope-btn,
.file-breadcrumbs .btn-mini {
  transition: all 150ms ease;
}

.file-tree-node {
  border-radius: 10px;
}

.file-tree-item.is-active > .file-tree-row .file-tree-node {
  box-shadow: inset 0 0 0 1px rgba(10, 135, 152, 0.26);
}

.file-browser-panel {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 255, 0.92));
}

.file-browser-panel.is-dragover {
  box-shadow: inset 0 0 0 2px rgba(10, 135, 152, 0.24), 0 20px 42px rgba(10, 135, 152, 0.16);
}

.file-scope-btn {
  border-radius: 11px;
}

.file-scope-btn.is-active {
  background: linear-gradient(140deg, rgba(10, 135, 152, 0.24), rgba(21, 118, 210, 0.14));
}

.file-kind {
  border-radius: 999px;
}

.flash {
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(13, 34, 56, 0.08);
}

.login-card {
  max-width: 660px;
  padding: 28px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.9));
}

.sign-shell {
  width: min(1260px, 100%);
}

.sign-hero {
  border-radius: var(--radius-lg);
  border-color: rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 82% -12%, rgba(74, 166, 255, 0.28), transparent 32%),
    linear-gradient(135deg, #061f31 0%, #0a3858 48%, #0c5f8f 100%);
  box-shadow: 0 22px 52px rgba(3, 24, 39, 0.34);
}

.sign-status-pill {
  border-color: rgba(21, 118, 210, 0.3);
  background: rgba(21, 118, 210, 0.14);
}

.sign-fields-grid {
  gap: 12px;
}

.nda-doc {
  border-radius: 14px;
}

canvas#signature-canvas,
canvas#admin-signature-canvas {
  border-radius: 14px;
  border: 2px solid rgba(21, 118, 210, 0.24);
  box-shadow: inset 0 0 0 1px rgba(10, 135, 152, 0.08);
}

.reveal {
  animation: enterpriseReveal 0.55s cubic-bezier(0.2, 0.68, 0.18, 1) both;
}

@keyframes enterpriseReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1260px) {
  .topbar-dashboard,
  .dashboard-container {
    width: calc(100vw - 36px);
  }

  .file-tree-panel,
  .file-browser-panel {
    min-height: 460px;
  }
}

@media (max-width: 1100px) {
  .topbar-dashboard,
  .dashboard-container {
    width: calc(100vw - 28px);
  }

  .side-nav {
    width: min(90vw, 336px);
  }
}

@media (max-width: 760px) {
  .topbar-dashboard,
  .dashboard-container {
    width: calc(100vw - 20px);
  }

  .panel,
  .login-card,
  .stat-card,
  .security-card,
  .file-workspace,
  .file-tree-panel,
  .file-browser-panel {
    border-radius: 14px;
  }

  .file-tree-panel,
  .file-browser-panel {
    min-height: 340px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .security-card,
  .stat-card,
  .file-tree-panel,
  .file-browser-panel,
  .btn,
  .side-link,
  .reveal,
  tbody tr {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Dashboard layout rescue: spacing, persistent left navigation visibility, and user dropdown profile */
.topbar-dashboard {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.topbar-left {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-right {
  flex: 0 0 auto;
  align-items: flex-start;
}

.dashboard-main {
  padding: 20px 26px 34px;
}

.topbar-dashboard,
.dashboard-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.dashboard-container {
  padding: 0;
  gap: 28px;
}

.side-nav {
  min-width: 286px;
}

.user-menu {
  position: relative;
}

.user-menu[open] {
  z-index: 60;
}

.user-menu-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  min-width: 250px;
  border-radius: 14px;
  border: 1px solid rgba(21, 118, 210, 0.24);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(9, 31, 54, 0.12);
}

.user-menu-summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #f5fbff;
  background: linear-gradient(135deg, #0a8798, #1576d2);
  border: 1px solid rgba(9, 73, 102, 0.24);
  box-shadow: 0 8px 16px rgba(11, 64, 98, 0.28);
}

.user-avatar-photo-wrap {
  padding: 0;
  overflow: hidden;
}

.user-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-identity {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: #0f2f4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: #3e647f;
  text-transform: uppercase;
}

.user-menu-caret {
  margin-left: auto;
  font-size: 0.82rem;
  color: #285776;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(340px, 86vw);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(11, 31, 52, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 42px rgba(9, 24, 43, 0.2);
  display: grid;
  gap: 8px;
}

.user-menu-line {
  margin: 0;
  font-size: 0.8rem;
  color: #23455f;
  line-height: 1.45;
}

.user-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(21, 118, 210, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #0f4466;
  background: rgba(21, 118, 210, 0.07);
}

.user-menu-link:hover {
  background: rgba(21, 118, 210, 0.12);
}

.user-menu-form {
  margin: 0;
}

.user-menu-logout {
  width: 100%;
  justify-content: center;
}

.user-menu-line-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#file-management.nav-section.is-visible {
  margin-top: 12px;
}

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

.user-profile-grid label {
  grid-column: span 1;
}

.user-photo-preview-wrap {
  margin: 8px 0 10px;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(11, 31, 52, 0.16);
  box-shadow: 0 12px 24px rgba(9, 27, 45, 0.14);
}

.user-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nda-finalized-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #0d3f5e;
}

.lang-flags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(21, 118, 210, 0.22);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.86);
  color: #0f3a58;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: transform 130ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.lang-flag:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 135, 152, 0.42);
  background: rgba(233, 246, 255, 0.96);
}

.lang-flag.is-active {
  border-color: rgba(10, 135, 152, 0.56);
  background: linear-gradient(135deg, rgba(10, 135, 152, 0.18), rgba(21, 118, 210, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46);
}

.lang-flag-emoji {
  font-size: 0.96rem;
}

.lang-flag-code {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.login-card > .lang-flags,
.sign-hero-copy > .lang-flags {
  margin-top: 10px;
}

.sign-hero-copy .lang-flag {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #f6fcff;
}

.sign-hero-copy .lang-flag:hover {
  background: rgba(255, 255, 255, 0.22);
}

.sign-hero-copy .lang-flag.is-active {
  border-color: rgba(174, 224, 255, 0.9);
  background: rgba(174, 224, 255, 0.26);
}

@media (max-width: 1260px) {
  .dashboard-main {
    padding: 16px 18px 28px;
  }
}

@media (max-width: 1100px) {
  .topbar-dashboard {
    gap: 12px;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .user-menu-summary {
    min-width: 220px;
  }

  .dashboard-main {
    padding: 12px 14px 22px;
  }
}

@media (max-width: 760px) {
  .topbar-right {
    justify-content: stretch;
  }

  .user-menu {
    width: 100%;
  }

  .user-menu-summary {
    width: 100%;
    min-width: 0;
  }

  .user-menu-line-lang {
    align-items: flex-start;
    flex-direction: column;
  }

  .lang-flags {
    width: 100%;
  }

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

/* Enterprise login cleanup: logo contrast, cleaner spacing, and stronger visual hierarchy */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% -12%, rgba(21, 118, 210, 0.13), transparent 34%),
    radial-gradient(circle at 104% 8%, rgba(10, 135, 152, 0.14), transparent 36%),
    linear-gradient(180deg, #f2f7fc 0%, #eaf1f8 52%, #e4ecf5 100%);
}

.login-body::before {
  display: none;
}

.login-shell {
  width: min(1160px, calc(100vw - 40px));
  padding: 34px 0;
}

.login-card {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 48px 38px;
  border-radius: 30px;
  border: 1px solid rgba(11, 31, 52, 0.16);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.93), rgba(246, 251, 255, 0.9));
  box-shadow: 0 26px 64px rgba(13, 34, 56, 0.13);
}

.login-card .brand-logo {
  width: 250px;
  max-width: min(60vw, 250px);
  margin-bottom: 12px;
}

.login-card .badge {
  margin-bottom: 16px;
  font-size: 0.82rem;
  padding: 7px 14px;
  letter-spacing: 0.075em;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.15rem);
  line-height: 1.1;
  color: #10263b;
}

.login-card .muted {
  margin-top: 13px;
  margin-bottom: 0;
  max-width: 920px;
  font-size: clamp(1.05rem, 1.3vw, 1.32rem);
  line-height: 1.38;
  color: #2d4b62;
}

.login-card > .lang-flags {
  margin-top: 18px;
  margin-bottom: 14px;
}

.login-card > .hint {
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #345269;
}

.login-card > .hint strong {
  color: #18384f;
}

.login-card .btn {
  min-height: 56px;
  border-radius: 16px;
  font-size: 1rem;
}

.login-card .stack {
  margin-top: 16px;
  gap: 11px;
}

.login-card label {
  margin-top: 2px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #17384f;
}

.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  min-height: 62px;
  border-radius: 16px;
  border: 1px solid rgba(11, 31, 52, 0.2);
  background: rgba(255, 255, 255, 0.98);
  padding: 0 18px;
  font-size: 1.05rem;
}

.login-card .btn-primary {
  margin-top: 6px;
  min-height: 64px;
  font-size: clamp(1.16rem, 1.6vw, 1.44rem);
  font-weight: 800;
}

.auth-divider {
  margin: 24px 0 14px;
}

.auth-divider span {
  background: rgba(245, 249, 253, 0.98);
  font-size: 0.8rem;
  letter-spacing: 0.085em;
  color: #4a6174;
}

@media (max-width: 1024px) {
  .login-shell {
    width: calc(100vw - 30px);
    padding: 22px 0;
  }

  .login-card {
    padding: 30px 26px 28px;
    border-radius: 22px;
  }

  .login-card .brand-logo {
    width: 214px;
  }

  .login-card .muted {
    font-size: 1.04rem;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .login-shell {
    width: calc(100vw - 18px);
    padding: 12px 0 18px;
  }

  .login-card {
    padding: 20px 16px 18px;
    border-radius: 18px;
  }

  .login-card .brand-logo {
    width: 174px;
  }

  .login-card .badge {
    margin-bottom: 12px;
    font-size: 0.73rem;
    padding: 6px 10px;
  }

  .login-card h1 {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .login-card .muted {
    font-size: 0.99rem;
    line-height: 1.4;
  }

  .login-card .btn,
  .login-card .btn-primary {
    min-height: 52px;
    font-size: 1.02rem;
  }

  .login-card input[type="email"],
  .login-card input[type="password"],
  .login-card input[type="text"] {
    min-height: 52px;
    font-size: 0.98rem;
  }
}

.image-editor-inline-status {
  min-height: 1.45em;
}

body.image-editor-open {
  overflow: hidden;
}

.image-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(10, 24, 37, 0.56);
  backdrop-filter: blur(4px);
}

.image-editor-modal[hidden] {
  display: none;
}

.image-editor-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 52px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(16, 51, 73, 0.22);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.95));
  box-shadow: 0 30px 80px rgba(8, 24, 38, 0.28);
  padding: 18px 18px 16px;
}

.image-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.image-editor-head h3 {
  margin-top: 6px;
}

.image-editor-badge {
  margin-bottom: 2px;
}

.image-editor-hint {
  margin-top: 8px;
}

.image-editor-stage {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, 0.16) 75%, rgba(148, 163, 184, 0.16)),
    linear-gradient(45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, 0.16) 75%, rgba(148, 163, 184, 0.16));
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  padding: 12px;
  display: grid;
  place-items: center;
}

.image-editor-stage canvas {
  width: min(920px, 100%);
  max-width: 100%;
  border-radius: 12px;
  display: block;
  touch-action: none;
  cursor: grab;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.94);
}

.image-editor-stage canvas:active {
  cursor: grabbing;
}

.image-editor-controls {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.image-editor-zoom-label {
  display: grid;
  grid-template-columns: auto minmax(180px, 320px);
  align-items: center;
  gap: 8px;
  margin-right: auto;
  min-width: 320px;
}

.image-editor-zoom-label span {
  font-size: 0.86rem;
  color: #24465f;
}

.image-editor-zoom-label input[type='range'] {
  width: 100%;
  margin: 0;
}

.image-editor-status {
  margin-top: 10px;
  min-height: 1.45em;
}

@media (max-width: 760px) {
  .image-editor-modal {
    padding: 10px;
  }

  .image-editor-dialog {
    border-radius: 16px;
    padding: 12px;
    max-height: calc(100vh - 20px);
  }

  .image-editor-controls {
    align-items: stretch;
  }

  .image-editor-controls .btn {
    width: 100%;
    justify-content: center;
  }

  .image-editor-zoom-label {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }
}
