:root {
  --ink: #172033;
  --muted-ink: #667085;
  --navy: #10233f;
  --navy-2: #193b62;
  --gold: #bf9140;
  --green: #1f8a70;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #dbe3ef;
  --danger: #b42318;
  --warning: #b7791f;
  --success: #167b50;
  --shadow: 0 18px 50px rgba(16, 35, 63, 0.12);
  --control-height: 46px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

a {
  color: var(--navy-2);
  text-decoration: none;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  min-height: var(--control-height);
  line-height: 1.25;
}

.readonly-control,
input[readonly].readonly-control {
  background: #f4f7fb;
  color: var(--ink);
  cursor: default;
  user-select: none;
}

.password-field {
  position: relative;
  display: block;
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  align-self: start;
}

.password-field input {
  height: 100%;
  min-height: var(--control-height);
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #eef3f8;
  color: var(--navy);
  transform: translateY(-50%);
  line-height: 1;
  z-index: 1;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  align-content: start;
  align-self: start;
  font-size: 0.9rem;
  font-weight: 700;
}

label small {
  min-height: 17px;
  color: var(--danger);
  font-weight: 600;
}

.password-policy {
  display: grid;
  gap: 7px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted-ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.password-policy.is-hidden {
  display: none;
}

.password-policy-item {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.18s ease;
}

.policy-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #c8d3e1;
  box-shadow: 0 0 0 3px rgba(200, 211, 225, 0.26);
}

.password-policy-item.is-ok {
  color: var(--success);
}

.password-policy-item.is-ok .policy-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 123, 80, 0.13);
}

.password-policy-item.is-missing {
  color: #6b778c;
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted-ink);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  box-shadow: inset 0 -3px 0 rgba(191, 145, 64, 0.55);
}

.btn,
.icon-button,
.link-button {
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  text-align: center;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
}

.btn-light {
  background: #fff;
  color: var(--navy);
}

.btn-login {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 8px 18px rgba(16, 35, 63, 0.14);
}

.btn-login:hover {
  color: #fff;
  background: var(--navy-2);
  border-color: var(--navy-2);
}

.btn-small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.otp-resend-form {
  margin-top: 10px;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy-2);
  font-weight: 800;
}

.danger-text {
  color: var(--danger);
}

.is-invalid-input {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12) !important;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.public-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.public-brand-row,
.public-menu,
.public-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
}

.public-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  align-items: center;
  padding: 56px clamp(20px, 6vw, 80px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 48%, rgba(198, 155, 74, 0.32), transparent 32%),
    linear-gradient(135deg, #07172e 0%, #102b4e 52%, #153d54 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 84px;
  background: var(--bg);
  clip-path: polygon(0 65%, 100% 20%, 100% 100%, 0 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 21, 41, 0.68);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 0.95;
}

.hero p {
  max-width: 680px;
  font-size: 1.2rem;
  line-height: 1.65;
}

.hero-actions,
.actions,
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
}

.section {
  padding: 58px clamp(18px, 5vw, 72px);
}

.section.muted {
  background: #fff;
}

.section-title {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-title h2,
.page-heading h1,
.panel h2,
.auth-heading h1 {
  margin: 0;
}

.feature-grid,
.pricing-grid,
.stats-grid,
.dashboard-grid,
.detail-grid {
  display: grid;
  gap: 18px;
}

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

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

.feature-card,
.price-card,
.panel,
.stat-card,
.table-wrap,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 35, 63, 0.06);
}

.feature-card,
.price-card,
.panel,
.stat-card {
  padding: 22px;
}

.price {
  margin: 12px 0;
  color: var(--navy);
  font-size: 2rem;
  font-weight: 900;
}

.price small {
  color: var(--muted-ink);
  font-size: 0.9rem;
}

.price-card ul {
  display: grid;
  gap: 9px;
  padding-left: 18px;
  color: var(--muted-ink);
}

.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 26px clamp(18px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted-ink);
  background: #fff;
  flex-wrap: wrap;
}

.page-hero {
  padding: 76px clamp(18px, 5vw, 72px) 42px;
  background: #fff;
}

.page-hero.compact h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.prose {
  max-width: 860px;
  line-height: 1.75;
}

.auth-body {
  min-height: 100vh;
  background: #eef2f7;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(300px, 1fr);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 5vw, 54px);
  border-radius: 0;
}

.auth-side {
  display: grid;
  align-items: end;
  padding: clamp(28px, 6vw, 76px);
  color: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(198,155,74,0.26), transparent 34%),
    linear-gradient(145deg, #07172e, #153d54);
}

.auth-side h2 {
  max-width: 640px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.form {
  display: grid;
  gap: 15px;
  align-items: start;
}

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

.full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.check-row small {
  flex: 1 0 100%;
  margin-left: 28px;
}

.form-note,
.empty,
.status-line {
  color: var(--muted-ink);
}

.app-body {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 18px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.side-nav-group {
  display: grid;
  gap: 5px;
}

.side-subnav {
  display: grid;
  gap: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.side-subnav a {
  padding-top: 7px;
  padding-bottom: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
}

.brand-app {
  color: #fff;
}

.brand-app .brand-mark {
  background: var(--gold);
  color: var(--navy);
}

.side-nav {
  display: grid;
  gap: 7px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.38) rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.side-nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
}

.side-nav::-webkit-scrollbar {
  width: 8px;
}

.side-nav::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.side-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.side-user {
  flex: 0 0 auto;
  margin-top: 0;
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.side-user small {
  color: rgba(255, 255, 255, 0.68);
}

.app-main {
  min-width: 0;
  padding: 22px clamp(16px, 3vw, 34px) 48px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.topbar-mobile-head {
  display: contents;
}

.topbar-brand,
.topbar-mobile-spacer {
  display: none;
}

.icon-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.global-search {
  flex: 1;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 22px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  display: grid;
  gap: 8px;
}

.stat-link {
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stat-link small {
  color: var(--navy-2);
  font-weight: 900;
}

.stat-link:hover {
  border-color: rgba(24, 70, 111, 0.28);
  box-shadow: 0 16px 34px rgba(15, 31, 58, 0.12);
  transform: translateY(-2px);
}

.stat-card span {
  color: var(--muted-ink);
}

.stat-card strong {
  font-size: 2.4rem;
  color: var(--navy);
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 11px;
}

.list-row,
.agenda-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-row small,
.agenda-item small {
  display: block;
  color: var(--muted-ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--navy);
  background: #eef3f8;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.danger {
  color: var(--danger);
  background: #fff0ef;
}

.legal-document-form .panel {
  box-shadow: none;
}

.rich-field {
  display: grid;
  gap: 8px;
}

.field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.field-head label {
  font-weight: 800;
  color: #061832;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d7e1ef;
  border-radius: 8px 8px 0 0;
  background: #f7f9fc;
}

.rich-toolbar button {
  min-width: 34px;
  height: 32px;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #fff;
  color: #10233f;
  font-weight: 800;
  cursor: pointer;
}

.rich-toolbar button:hover {
  border-color: #17466f;
  color: #17466f;
}

.rich-editor {
  min-height: 190px;
  max-height: 380px;
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid #d7e1ef;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
  color: #10233f;
  line-height: 1.65;
  outline: none;
}

.rich-editor:focus {
  border-color: #17466f;
  box-shadow: 0 0 0 3px rgba(23, 70, 111, 0.12);
}

.rich-editor p {
  margin: 0 0 10px;
}

.rich-editor ol,
.rich-editor ul {
  margin: 8px 0 12px;
  padding-left: 24px;
}

.rich-editor blockquote {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 3px solid #c9a227;
  background: #f8fafc;
}

.evidence-picker {
  padding: 16px;
}

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

.evidence-item {
  border: 1px solid #d7e1ef;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.evidence-item span {
  display: grid;
  gap: 2px;
}

.autosave-status {
  min-height: 20px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

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

.dns-table {
  box-shadow: none;
}

.dns-table h3 {
  margin: 0 0 10px;
  color: #10233f;
  font-size: 1rem;
}

.storage-meter div {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf4;
}

.storage-meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.quota-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.quota-card p {
  margin: 4px 0;
}

.quota-pie {
  --percent: 0;
  width: 132px;
  height: 132px;
  min-width: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--percent) * 1%), #e7edf5 0);
  position: relative;
}

.quota-pie::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #fff;
}

.quota-pie span {
  position: relative;
  z-index: 1;
  color: var(--navy);
  font-weight: 900;
}

.mini-pie {
  width: 72px;
  height: 72px;
  min-width: 72px;
}

.mini-pie::after {
  inset: 10px;
}

.mini-pie span {
  font-size: 0.78rem;
}

.mini-meter {
  width: min(280px, 100%);
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.mini-meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

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

.lawyer-workload-panel {
  margin-bottom: 18px;
}

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

.lawyer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: linear-gradient(180deg, #fff, #fbfdff);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.lawyer-card:hover {
  border-color: rgba(24, 70, 111, 0.28);
  box-shadow: 0 12px 26px rgba(15, 31, 58, 0.1);
  transform: translateY(-1px);
}

.lawyer-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted-ink);
}

.lawyer-card-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lawyer-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--navy);
  background: #eef3f8;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.alert {
  max-width: min(1120px, calc(100% - 32px));
  margin: 16px auto;
  padding: 13px 16px;
  border-radius: 8px;
  font-weight: 700;
}

.app-main > .alert {
  margin: 0 0 16px;
  max-width: none;
}

.alert-success {
  color: var(--success);
  background: #eaf8f0;
  border: 1px solid #b7e4ca;
}

.alert-error {
  color: var(--danger);
  background: #fff0ef;
  border: 1px solid #ffd2ce;
}

.alert-warning {
  color: var(--warning);
  background: #fff6e6;
  border: 1px solid #f8d69a;
}

.alert-info {
  color: #0f4774;
  background: #edf7ff;
  border: 1px solid #bee3ff;
}

.plan-limit-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: none;
  margin: 0 0 18px;
  padding: 18px 20px;
  color: #7a4b00;
  background: linear-gradient(135deg, #fff8e8 0%, #fff2cb 100%);
  border-color: #e8bd58;
  box-shadow: 0 14px 30px rgba(122, 75, 0, 0.12);
}

.plan-limit-alert strong {
  display: block;
  color: #5f3900;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.plan-limit-alert span {
  display: block;
  color: #76520d;
}

.filters,
.inline-form,
.upload-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.filters.wide {
  grid-template-columns: 2fr repeat(4, minmax(140px, 1fr)) auto;
}

.page-form,
.table-wrap {
  padding: 20px;
}

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

.table-wrap.embedded {
  padding: 0;
  border: 0;
  box-shadow: none;
}

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

.document-name-link {
  color: var(--navy);
  text-decoration: none;
}

.document-name-link:hover {
  color: var(--navy-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted-ink);
  font-size: 0.78rem;
}

.stacked-actions,
.reset-password-form {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.reset-password-form input {
  min-width: 150px;
}

.tiny-check {
  font-size: 0.78rem;
  font-weight: 700;
}

.tiny-check input {
  width: 15px;
  height: 15px;
}

.detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
}

.detail-list dt {
  color: var(--muted-ink);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

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

.timeline-item {
  padding-left: 16px;
  border-left: 3px solid var(--gold);
}

.timeline-item span {
  display: block;
  color: var(--muted-ink);
  font-size: 0.86rem;
}

.agenda-list {
  display: grid;
  gap: 12px;
}

.agenda-item {
  justify-content: flex-start;
}

.agenda-item > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.agenda-item h2 {
  margin: 0;
  font-size: 1.1rem;
}

.date-box {
  width: 62px;
  min-width: 62px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
}

.date-box strong {
  font-size: 1.6rem;
}

.date-box span {
  margin-top: -12px;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
}

.agenda-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-section-title {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
}

.geo-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.geo-fields .field-label {
  display: flex;
  align-items: flex-end;
  min-height: 34px;
  line-height: 1.2;
}

.geo-fields select:disabled {
  color: var(--muted-ink);
  background: #f3f6fa;
}

.template-builder {
  padding: 16px;
}

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

.template-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.field-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-required {
  align-self: end;
  min-height: var(--control-height);
}

.custom-template-section[hidden] {
  display: none;
}

.compact-list {
  max-height: 430px;
  overflow: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted-ink);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-links a,
.pagination-gap {
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  font-weight: 800;
}

.pagination-links a.is-active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.pagination-gap {
  color: var(--muted-ink);
  background: transparent;
}

.scope-note {
  display: inline-flex;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: rgba(255,255,255,0.86);
  font-size: 0.82rem;
  font-weight: 800;
}

.audit-filter-panel summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 900;
}

.audit-filter-form {
  margin-top: 18px;
  grid-template-columns: 1.5fr repeat(4, minmax(140px, 1fr)) auto auto;
  align-items: end;
}

.audit-list-panel .table-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.audit-table th {
  font-size: 0.92rem;
}

.audit-table td {
  padding: 18px 16px;
  vertical-align: middle;
}

.audit-table td:first-child {
  color: #344054;
}

.audit-table td:first-child > strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.audit-table td:first-child > span {
  display: inline-block;
  margin-left: 4px;
}

.icon-link {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-ink);
  background: #fff;
  text-decoration: none;
  font-size: 1.05rem;
}

.icon-link:hover {
  color: var(--navy);
  border-color: rgba(15, 71, 120, 0.34);
  box-shadow: 0 8px 18px rgba(16, 35, 63, 0.12);
}

.audit-detail-heading h1 {
  max-width: 980px;
}

.audit-detail-panel {
  display: grid;
  gap: 28px;
}

.audit-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 46px;
}

.audit-meta-grid div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.audit-meta-grid strong,
.audit-json-grid h2,
.audit-metadata h2 {
  color: var(--muted-ink);
  font-size: 0.95rem;
  font-weight: 900;
}

.audit-meta-grid span {
  overflow-wrap: anywhere;
  line-height: 1.55;
}

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

.audit-json-grid article,
.audit-metadata {
  min-width: 0;
}

.json-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.json-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  color: #fff;
  background: #2f80ed;
  font-weight: 800;
}

.json-toolbar span {
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 4px;
}

.json-window pre {
  max-height: 440px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #087a20;
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compact-json pre {
  max-height: 260px;
}

.has-document-preview {
  overflow: hidden;
}

.document-preview-modal[hidden] {
  display: none;
}

.document-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
}

.document-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 23, 46, 0.64);
  backdrop-filter: blur(8px);
}

.document-preview-window {
  position: relative;
  z-index: 1;
  width: min(1120px, 96vw);
  height: min(820px, 90vh);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 23, 46, 0.32);
}

.document-preview-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #07172e, #153d54);
  color: #fff;
}

.document-preview-window h2 {
  max-width: min(560px, 52vw);
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-preview-window .eyebrow {
  color: #f0c66f;
}

.document-preview-window iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef3f8;
}

/* Premium desktop polish */
:root {
  --ink: #101828;
  --muted-ink: #667085;
  --navy: #0b1f3a;
  --navy-2: #18466f;
  --gold: #c69b4a;
  --green: #16856e;
  --bg: #eef3f8;
  --panel: #ffffff;
  --line: #d7e0ec;
  --shadow: 0 18px 45px rgba(15, 31, 58, 0.11);
  --shadow-soft: 0 10px 24px rgba(15, 31, 58, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(180deg, #eaf1f8 0%, #f7f9fc 42%, #eef3f8 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.app-body {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 26px 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0)),
    linear-gradient(160deg, #00110794 0%, #104e39 54%, #0a1e39 100%);
  box-shadow: 18px 0 42px rgba(7, 23, 46, 0.18);
}

.brand-app {
  padding: 8px 6px 14px;
}

.brand-app .brand-mark {
  box-shadow: 0 12px 28px rgba(198, 155, 74, 0.28), inset 0 -3px 0 rgba(255,255,255,0.28);
}

.side-nav {
  gap: 8px;
}

.side-nav a {
  position: relative;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.side-nav a:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.12);
  transform: translateX(2px);
}

.side-nav .side-subnav a {
  padding: 7px 10px;
  font-size: 0.88rem;
}

.side-user {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.app-main {
  padding: 24px clamp(20px, 3.2vw, 42px) 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: -24px calc(clamp(20px, 3.2vw, 42px) * -1) 26px;
  padding: 18px clamp(20px, 3.2vw, 42px);
  border-bottom: 1px solid rgba(215, 224, 236, 0.78);
  background: rgba(247, 249, 252, 0.86);
  backdrop-filter: blur(16px);
}

.global-search input {
  min-height: 46px;
  border-color: transparent;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow-soft);
}

.page-heading {
  min-height: 138px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(198,155,74,0.22), rgba(22,133,110,0.12)),
    linear-gradient(135deg, #07172e 0%, #102b4e 58%, #153d54 100%);
  box-shadow: var(--shadow);
}

.page-heading h1 {
  color: #fff;
  font-size: clamp(1.85rem, 2.5vw, 3rem);
  line-height: 1.08;
}

.page-heading .eyebrow {
  color: #f0c66f;
}

.page-heading .btn-outline,
.page-heading .btn-primary {
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
}

.panel,
.stat-card,
.table-wrap,
.auth-panel {
  border-color: rgba(215, 224, 236, 0.92);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.94));
  box-shadow: var(--shadow-soft);
}

.panel,
.stat-card {
  position: relative;
  overflow: hidden;
}

.panel::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--green), var(--navy-2));
}

.panel-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(215,224,236,0.72);
}

.panel h2 {
  color: var(--navy);
  font-size: 1.08rem;
}

.stats-grid {
  gap: 20px;
}

.stat-card {
  min-height: 132px;
  padding: 24px;
}

.stat-card span {
  font-weight: 800;
}

.stat-card strong {
  font-size: clamp(2.2rem, 3vw, 3.4rem);
  letter-spacing: 0;
}

.list-row,
.agenda-item {
  border-color: rgba(215,224,236,0.88);
  background: linear-gradient(180deg, #fff, #fbfdff);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.list-row:hover,
.agenda-item:hover {
  border-color: rgba(24,70,111,0.24);
  box-shadow: 0 10px 22px rgba(15,31,58,0.08);
  transform: translateY(-1px);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  color: #475467;
  background: #f7f9fc;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fbfdff;
}

td,
th {
  border-bottom-color: rgba(215,224,236,0.82);
}

.btn {
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #0b1f3a, #18466f);
  box-shadow: 0 12px 24px rgba(11, 31, 58, 0.18);
}

.btn-outline {
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 18px rgba(15,31,58,0.06);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(198,155,74,0.18);
  border-color: rgba(24,70,111,0.55);
  box-shadow: 0 0 0 1px rgba(24,70,111,0.08);
}

.badge {
  border: 1px solid rgba(24,70,111,0.08);
}

.quota-pie {
  box-shadow: inset 0 0 0 1px rgba(215,224,236,0.8), 0 14px 28px rgba(22,133,110,0.12);
}

.auth-body {
  background:
    linear-gradient(135deg, #eef3f8 0%, #ffffff 46%, #e7f1ee 100%);
}

.auth-panel {
  border: 0;
  box-shadow: 24px 0 60px rgba(15,31,58,0.14);
}

.auth-side {
  background:
    radial-gradient(circle at 50% 42%, rgba(198,155,74,0.30), transparent 34%),
    linear-gradient(145deg, #07172e, #153d54);
}

.plan-form {
  grid-template-columns: repeat(8, minmax(90px, 1fr));
}

.role-form {
  grid-template-columns: 1.2fr 1fr minmax(150px, 0.45fr) auto;
}

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

.permissions-grid fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.permissions-grid legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 900;
}

.permissions-grid .check-row {
  justify-content: flex-start;
  margin-top: 7px;
}

.role-table {
  margin-top: 16px;
}

.role-actions {
  min-width: 260px;
}

.role-editor summary {
  cursor: pointer;
  color: var(--navy-2);
  font-weight: 900;
}

.role-edit-form {
  margin-top: 10px;
  min-width: min(560px, 82vw);
}

.role-edit-form .permissions-grid {
  grid-template-columns: repeat(2, minmax(170px, 1fr));
}

.plan-edit-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.plan-admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.invoice-create-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-send-form {
  display: grid;
  gap: 8px;
}

.invoice-shell {
  max-width: 980px;
  margin: 0 auto;
}

.invoice-document {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.invoice-head,
.invoice-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr auto;
}

.invoice-head {
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--navy);
}

.invoice-firm {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
}

.invoice-firm img {
  width: 96px;
  max-height: 84px;
  object-fit: contain;
}

.invoice-firm h1 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1.7rem;
}

.invoice-firm p,
.invoice-grid p,
.invoice-notes p {
  margin: 4px 0;
  color: var(--muted-ink);
}

.invoice-number {
  min-width: 190px;
  padding: 16px;
  border-radius: 8px;
  background: #eef3f8;
  text-align: right;
}

.invoice-number span {
  display: block;
  color: var(--muted-ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.invoice-number strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.25rem;
}

.invoice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0;
}

.invoice-grid section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-grid h2,
.invoice-notes h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--navy);
}

.invoice-table {
  min-width: 0;
}

.invoice-table th:last-child,
.invoice-table td:last-child {
  text-align: right;
}

.invoice-table .invoice-total td {
  border-top: 2px solid var(--navy);
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 900;
}

.invoice-notes {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.error-card {
  max-width: 520px;
  padding: 30px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

  .dashboard-grid,
  .detail-grid,
  .lawyer-workload-grid,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side {
    min-height: 320px;
  }

  .filters,
  .filters.wide,
  .inline-form,
  .upload-form,
  .plan-form,
  .role-form,
  .invoice-create-form,
  .audit-filter-form,
  .template-field-row,
  .permissions-grid,
  .geo-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-json-grid,
  .audit-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .public-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 10px 18px 14px;
  }

  .public-brand-row {
    justify-content: space-between;
    width: 100%;
  }

  .public-header .brand-logo-img {
    width: 178px;
    max-width: 178px;
    height: 56px;
  }

  .public-menu-toggle {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .public-nav {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .public-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    order: 1;
    width: 100%;
  }

  .public-actions .btn,
  .public-actions button {
    width: 100%;
    min-height: 42px;
    padding: 8px 8px;
    justify-content: center;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .public-menu {
    display: none;
    order: 2;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 12px 26px rgba(16, 35, 63, 0.08);
  }

  .public-nav.is-open .public-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .public-menu a {
    padding: 11px 12px;
    border-radius: 8px;
  }

  .page-heading,
  .topbar,
  .list-row,
  .agenda-item,
  .lawyer-card,
  .plan-limit-alert,
  .document-scan-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .public-nav > .btn-small {
    width: auto;
  }

  .hero {
    min-height: 72vh;
  }

  .feature-grid,
  .pricing-grid,
  .stats-grid,
  .two-cols,
  .filters,
  .filters.wide,
  .inline-form,
  .upload-form,
  .plan-form,
  .role-form,
  .invoice-create-form,
  .audit-filter-form,
  .template-field-row,
  .permissions-grid,
  .role-edit-form .permissions-grid,
  .geo-fields {
    grid-template-columns: 1fr;
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(82vw, 300px);
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
  }

  .topbar-mobile-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .topbar-brand {
    display: inline-flex;
    justify-content: center;
    min-width: 0;
    color: var(--ink);
    font-size: 1.08rem;
  }

  .topbar-brand .topbar-brand-logo {
    width: auto;
    max-width: min(230px, 58vw);
    height: 58px;
    object-fit: contain;
  }

  .topbar-brand .brand-mark {
    width: 42px;
    height: 42px;
  }

  .topbar-mobile-spacer {
    display: block;
    width: 42px;
    height: 42px;
  }

  .icon-button {
    display: inline-grid;
    place-items: center;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .invoice-head,
  .invoice-grid {
    grid-template-columns: 1fr;
  }

  .invoice-number {
    text-align: left;
  }

  .document-preview-modal {
    padding: 10px;
  }

  .document-preview-window {
    width: 100%;
    height: 94vh;
  }

  .document-preview-window header {
    align-items: stretch;
    flex-direction: column;
  }

  .document-preview-window h2 {
    max-width: 100%;
  }
}

@media print {
  body.app-body {
    display: block;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .no-print {
    display: none !important;
  }

  .app-main {
    padding: 0;
  }

  .invoice-shell {
    max-width: none;
  }

  .invoice-document {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

/* Branding, support chat, messages and theme */
.brand-logo-img {
  width: auto;
  max-width: 280px;
  height: 64px;
  object-fit: contain;
}

.brand-logo-dark,
.side-brand-logo-dark,
.hero-brand-image-dark {
  display: none;
}

[data-theme="dark"] .brand.has-dark-logo .brand-logo-light,
[data-theme="dark"] .brand-app.has-dark-logo .side-brand-logo-light,
[data-theme="dark"] .hero-brand-image-light {
  display: none;
}

[data-theme="dark"] .brand.has-dark-logo .brand-logo-dark,
[data-theme="dark"] .brand-app.has-dark-logo .side-brand-logo-dark,
[data-theme="dark"] .hero-brand-image-dark {
  display: block;
}

.public-header .brand-logo-img {
  width: 220px;
  max-width: 220px;
  height: 70px;
  object-fit: cover;
  object-position: center;
}

.auth-panel .brand-logo-img {
  width: 230px;
  max-width: 230px;
  height: 74px;
  object-fit: cover;
  object-position: center;
}

.side-brand-logo {
  width: 100%;
  max-width: 236px;
  max-height: 96px;
  object-fit: contain;
}

.brand-app .side-brand-logo[src*="Logo_Juridesk"] {
  height: 92px;
  object-fit: cover;
  object-position: center;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand-preview img {
  max-width: 220px;
  max-height: 90px;
  object-fit: contain;
}

.brand-preview .dark-preview {
  padding: 10px;
  border-radius: 8px;
  background: #07172e;
}

.brand-preview .favicon-preview {
  width: 48px;
  height: 48px;
}

.signature-profile-note {
  padding: 12px 14px;
  border: 1px solid #b7dfc4;
  border-radius: 8px;
  color: #0f6b3f;
  background: #effaf2;
  font-weight: 700;
}

.signature-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.signature-preview img {
  max-width: 220px;
  max-height: 90px;
  object-fit: contain;
}

.document-scan-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 16px;
}

.document-scan-panel p {
  margin: 4px 0 0;
  color: var(--muted-ink);
}

.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 18, 34, 0.58);
}

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

.scan-window {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scan-head,
.scan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.scan-camera {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07172e;
}

.scan-camera video {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
}

.scan-pages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.scan-thumb {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scan-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.scan-thumb button {
  border: 0;
  color: #b42318;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.hero {
  overflow: hidden;
  grid-template-columns: minmax(0, 0.92fr) minmax(260px, 0.68fr);
  gap: clamp(24px, 6vw, 80px);
  background:
    radial-gradient(circle at 74% 45%, rgba(198, 155, 74, 0.36), transparent 31%),
    linear-gradient(135deg, #07172e 0%, #102b4e 50%, #153d54 100%);
}

.hero-overlay {
  background: linear-gradient(90deg, rgba(7, 23, 46, 0.32), rgba(7, 23, 46, 0.08));
}

.hero-brand-image {
  position: relative;
  z-index: 1;
  width: min(48vw, 760px);
  max-height: 360px;
  object-fit: contain;
  justify-self: center;
  filter: drop-shadow(0 28px 70px rgba(0,0,0,0.34));
}

.auth-side {
  background:
    radial-gradient(circle at 50% 42%, rgba(198,155,74,0.32), transparent 32%),
    linear-gradient(145deg, #07172e, #153d54);
}

.public-footer a {
  color: var(--navy);
}

.whatsapp-widget {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 110;
}

.whatsapp-launcher {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #25d366;
  box-shadow: 0 18px 34px rgba(37, 211, 102, 0.32), 0 8px 18px rgba(7, 23, 46, 0.14);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.whatsapp-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(37, 211, 102, 0.4), 0 10px 22px rgba(7, 23, 46, 0.16);
}

.whatsapp-launcher svg {
  width: 36px;
  height: 36px;
}

.whatsapp-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(340px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.whatsapp-panel[hidden] {
  display: none;
}

.whatsapp-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #128c4a, #25d366);
}

.whatsapp-panel-head strong,
.whatsapp-panel-head small {
  display: block;
}

.whatsapp-panel-head small {
  color: rgba(255, 255, 255, 0.82);
}

.whatsapp-panel-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,0.14);
  cursor: pointer;
}

.whatsapp-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.whatsapp-form textarea {
  min-height: 86px;
}

.about-founder-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.founder-avatar {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #07172e;
  background:
    radial-gradient(circle at 46% 38%, #f8dc74, #c69b4a 55%, #8a6728 100%);
  font-size: 3.4rem;
  font-weight: 950;
  box-shadow: 0 22px 52px rgba(198,155,74,0.26);
}

.message-form .rich-editor {
  min-height: 170px;
}

.message-row {
  align-items: flex-start;
}

.message-preview {
  max-height: 120px;
  overflow: auto;
  margin-top: 8px;
  color: var(--muted-ink);
  font-size: 0.9rem;
}

.message-preview p {
  margin: 0 0 8px;
}

.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.announcement-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 23, 46, 0.66);
  backdrop-filter: blur(10px);
}

.announcement-card {
  position: relative;
  z-index: 1;
  width: min(680px, 96vw);
  max-height: 86vh;
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 32px 90px rgba(7,23,46,0.34);
}

.announcement-card h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.announcement-card img {
  width: 100%;
  max-height: 260px;
  margin: 12px 0;
  border-radius: 8px;
  object-fit: cover;
}

.announcement-content {
  line-height: 1.7;
}

.support-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 110;
}

.support-launcher {
  position: relative;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, #0b1f3a, #18466f);
  box-shadow: 0 18px 40px rgba(7,23,46,0.26);
  font-weight: 900;
}

.support-widget.is-open .support-launcher {
  display: none;
}

.support-launcher-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 1.45rem;
  line-height: 1;
}

.support-launcher-label {
  position: absolute;
  right: 58px;
  top: 50%;
  white-space: nowrap;
  transform: translateY(-50%);
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: #0b1f3a;
  box-shadow: 0 14px 32px rgba(7,23,46,0.18);
  font-size: 0.86rem;
}

.support-launcher strong {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.76rem;
}

.support-panel {
  width: min(380px, calc(100vw - 28px));
  max-width: 380px;
  height: min(430px, calc(100vh - 42px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(7,23,46,0.34);
}

.support-widget[data-support-mode="auth"] .support-panel {
  width: min(430px, calc(100vw - 28px));
  max-width: 430px;
}

.support-header {
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #07172e, #153d54);
}

.support-header small {
  display: block;
  color: rgba(255,255,255,0.72);
}

.support-header-actions {
  display: flex;
  gap: 6px;
}

.support-header-actions button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  font-weight: 900;
}

.support-auth-body {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 1.5fr);
  min-height: 0;
}

.support-auth-body.single-thread {
  grid-template-columns: 1fr;
}

.support-conversations {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f7f9fc;
}

.support-conversation-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.support-conversation-item.is-active {
  background: #fff;
}

.support-conversation-item strong,
.support-conversation-item small {
  display: block;
}

.support-conversation-item small {
  color: var(--muted-ink);
}

.support-thread {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

.support-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 16px;
  background: #eef3f8;
}

.support-message {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.support-message.is-me {
  justify-self: end;
  color: #fff;
  background: #18466f;
  border-color: #18466f;
}

.support-message small {
  display: block;
  margin-bottom: 4px;
  color: inherit;
  opacity: 0.72;
  font-size: 0.76rem;
}

.support-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.support-form textarea {
  min-height: 44px;
  max-height: 120px;
}

.support-public-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.auth-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
}

[data-theme="dark"] {
  --ink: #eef4ff;
  --muted-ink: #a9b7cc;
  --navy: #f2c76b;
  --navy-2: #8dc8ff;
  --gold: #f2c76b;
  --green: #49d3af;
  --bg: #07111f;
  --panel: #101b2c;
  --line: #26374f;
  --shadow: 0 18px 45px rgba(0,0,0,0.28);
  --shadow-soft: 0 10px 24px rgba(0,0,0,0.22);
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, #07111f 0%, #0d192a 48%, #07111f 100%);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .panel,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .auth-panel,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .price-card,
[data-theme="dark"] .list-row,
[data-theme="dark"] .agenda-item,
[data-theme="dark"] .brand-preview,
[data-theme="dark"] .support-conversation-item.is-active,
[data-theme="dark"] .json-window,
[data-theme="dark"] .rich-editor,
[data-theme="dark"] .announcement-card,
[data-theme="dark"] .template-field-row,
[data-theme="dark"] .invoice-document {
  color: var(--ink);
  background: #101b2c;
}

[data-theme="dark"] .readonly-control,
[data-theme="dark"] input[readonly].readonly-control {
  background: #18253a;
  color: var(--ink);
}

[data-theme="dark"] th,
[data-theme="dark"] .support-conversations,
[data-theme="dark"] .rich-toolbar,
[data-theme="dark"] .support-messages,
[data-theme="dark"] .page-hero,
[data-theme="dark"] .section.muted,
[data-theme="dark"] .public-footer,
[data-theme="dark"] .public-header,
[data-theme="dark"] .topbar {
  background: #0b1626;
}

[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-light,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .pagination-links a,
[data-theme="dark"] .icon-link,
[data-theme="dark"] .public-menu,
[data-theme="dark"] .public-menu-toggle,
[data-theme="dark"] .whatsapp-panel {
  color: var(--ink);
  background: #101b2c;
  border-color: var(--line);
}

[data-theme="dark"] .btn-login {
  color: #07111f;
  background: var(--gold);
  border-color: var(--gold);
}

[data-theme="dark"] .page-heading,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .support-header {
  background: linear-gradient(135deg, #050b14, #10233f 65%, #153d54);
}

[data-theme="dark"] .quota-pie::after,
[data-theme="dark"] .document-preview-window,
[data-theme="dark"] .support-panel {
  background: #101b2c;
}

[data-theme="dark"] .message-preview,
[data-theme="dark"] td small,
[data-theme="dark"] .form-note,
[data-theme="dark"] .empty {
  color: var(--muted-ink);
}

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

  .hero-brand-image {
    width: min(88vw, 480px);
  }

  .about-founder-card,
  .support-auth-body {
    grid-template-columns: 1fr;
  }

  .founder-avatar {
    width: 150px;
    height: 150px;
  }

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

  .support-widget {
    right: 14px;
    bottom: 14px;
  }

  .whatsapp-widget {
    right: 16px;
    bottom: 84px;
  }

  .whatsapp-launcher {
    width: 54px;
    height: 54px;
  }

  .whatsapp-launcher svg {
    width: 34px;
    height: 34px;
  }

  .whatsapp-panel {
    right: -2px;
    bottom: 66px;
    width: calc(100vw - 32px);
  }

  .support-launcher-label {
    display: none;
  }

  .support-widget[data-support-mode="auth"] .support-panel,
  .support-panel {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    height: min(520px, calc(100vh - 28px));
  }
}
/*Nuevo agregado por mí*/
.support-header-actions {
  position: relative;
  z-index: 9999;
  pointer-events: auto;
}

.support-header-actions button,
button[data-support-close],
button[data-support-minimize] {
  position: relative;
  z-index: 10000;
  pointer-events: auto;
  cursor: pointer;
}
.support-widget {
  display: none !important;
}
