:root {
  --line: rgba(54, 72, 95, 0.12);
  --text: #1f2430;
  --muted: #64748b;
  --accent: #db6d2c;
  --accent-soft: #ffd8c2;
  --success: #1d9c84;
  --warning: #d69e2e;
  --danger: #d14f62;
  --navy: #123d60;
  --navy-2: #0f2f4a;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-soft: #e8ddd3;
  --shadow: 0 18px 42px rgba(31, 45, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(219, 109, 44, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(29, 156, 132, 0.12), transparent 18%),
    linear-gradient(180deg, #edf2f7 0%, #eef3f8 42%, #ebe5dd 100%);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.session-card,
.card,
.table-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(1080px, 100%);
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(76, 124, 173, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,250,253,0.96));
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: stretch;
}

.auth-visual,
.auth-panel {
  border-radius: 30px;
}

.auth-visual {
  padding: 32px;
  background:
    radial-gradient(circle at top, rgba(189, 221, 245, 0.55), transparent 62%),
    linear-gradient(180deg, rgba(248, 252, 255, 0.92), rgba(238, 245, 251, 0.72));
  border: 1px solid rgba(18, 61, 96, 0.06);
  display: grid;
  place-items: center;
  min-height: 100%;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.auth-brand-logo {
  width: min(300px, 74%);
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  filter: none;
}

.sidebar-brand-logo {
  width: 150px;
  margin: 0 0 16px;
}

.auth-illustration {
  position: relative;
  min-height: 430px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(244,247,250,0.9));
  overflow: hidden;
  display: grid;
  place-items: center;
}

.auth-blob {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(219,109,44,0.16), rgba(76,124,173,0.08), transparent 70%);
  top: 26px;
  left: 24px;
}

.auth-device {
  width: 220px;
  height: 148px;
  border-radius: 24px;
  background: linear-gradient(180deg, #173b59, #274f72);
  box-shadow: 0 18px 32px rgba(18, 61, 96, 0.18);
  position: relative;
  z-index: 2;
}

.auth-device::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -22px;
  height: 18px;
  border-radius: 999px;
  background: rgba(20, 42, 69, 0.22);
}

.auth-device-screen {
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(121,208,255,0.18), transparent 38%),
    linear-gradient(135deg, #f7fbff, #d9e7f3);
}

.auth-device-screen::before,
.auth-device-screen::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 10px;
  border-radius: 999px;
  background: rgba(18, 61, 96, 0.12);
}

.auth-device-screen::before {
  top: 24px;
}

.auth-device-screen::after {
  top: 50px;
}

.auth-plant {
  position: absolute;
  bottom: 28px;
  width: 18px;
  height: 100px;
  border-radius: 999px;
  background: linear-gradient(180deg, #78b75a, #3c8257);
}

.auth-plant-left {
  left: 72px;
}

.auth-plant-right {
  right: 86px;
  height: 132px;
}

.auth-visual-copy {
  display: grid;
  gap: 6px;
}

.auth-visual-copy strong {
  font-size: 1.05rem;
}

.auth-panel {
  padding: 28px 30px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(18, 61, 96, 0.1);
  display: grid;
  place-items: center;
}

.auth-form-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 18px;
}

.auth-form-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-family: "Space Grotesk", sans-serif;
  color: #202534;
  letter-spacing: -0.04em;
}

.auth-form {
  gap: 16px;
}

.auth-form input {
  border: none;
  border-bottom: 1px solid rgba(31, 36, 48, 0.38);
  border-radius: 0;
  background: transparent;
  color: #1b2230;
  font-size: 1.02rem;
  font-weight: 600;
  padding-top: 6px;
  padding-bottom: 12px;
  padding-left: 0;
  padding-right: 0;
}

.auth-form input::placeholder {
  color: #7a8799;
  font-weight: 500;
}

.auth-form input:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}

.password-field {
  position: relative;
  min-width: 0;
}

.password-field input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 61, 96, 0.08);
  color: #4c6078;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.password-toggle:hover,
.password-field.is-visible .password-toggle {
  background: rgba(219, 109, 44, 0.14);
  color: var(--accent);
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #56657a;
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-check input {
  width: 16px;
  height: 16px;
}

.auth-submit {
  width: 160px;
  border-radius: 14px;
  padding: 14px 20px;
  background: linear-gradient(180deg, #e57b2f, #cf6323);
  color: white;
  font-weight: 800;
  box-shadow: 0 16px 28px rgba(207, 99, 35, 0.22);
}

.auth-switch {
  min-height: 46px;
  border: 1px solid rgba(18, 61, 96, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px 18px;
  color: #123d60;
  text-decoration: none;
  width: 100%;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(22, 51, 84, 0.08);
}

.auth-switch:hover {
  border-color: rgba(219, 109, 44, 0.35);
  color: var(--accent);
  background: rgba(255, 247, 242, 0.92);
}

.auth-switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

.auth-inline-button {
  min-width: 138px;
  white-space: nowrap;
}

.auth-note {
  margin: 0;
  color: #55657a;
  background: rgba(219, 109, 44, 0.08);
  border: 1px solid rgba(219, 109, 44, 0.12);
}

.auth-note code {
  color: #123d60;
  font-weight: 700;
  background: rgba(18, 61, 96, 0.06);
  border-radius: 8px;
  padding: 2px 6px;
}

.auth-visual .eyebrow {
  color: #efb89c;
}

.auth-visual-copy strong {
  color: #233048;
}

.auth-visual-copy span {
  color: #55657a;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 20px;
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #fef5ed;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar h1,
.content h2,
.card h3,
.section-title,
.login-card h1 {
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.sidebar-copy,
.helper,
.metric-helper,
.table-helper,
.note {
  line-height: 1.55;
  color: var(--muted);
}

.sidebar-copy {
  margin: 0;
  color: rgba(233, 244, 255, 0.76);
}

.session-card,
.metric-card,
.card,
.table-card {
  padding: 22px;
}

.session-info {
  line-height: 1.6;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-button,
.secondary-button,
.primary-button,
.ghost-button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  color: #eaf4ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.nav-button.active {
  background: linear-gradient(90deg, rgba(76, 124, 173, 0.36), rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-button.active::after {
  content: "";
  position: absolute;
  inset: 8px auto 8px 8px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #79d0ff, #f4f8fb);
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(121, 208, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5fbff;
  flex: none;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.nav-button.active .nav-icon {
  background: linear-gradient(180deg, rgba(121, 208, 255, 0.28), rgba(255, 255, 255, 0.16));
  color: #ffffff;
}

.content {
  padding: 28px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.content-shell {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.content-main {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 24px;
  padding: 18px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(54, 72, 95, 0.08);
  box-shadow: 0 12px 30px rgba(31, 45, 61, 0.08);
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.topbar-heading {
  min-width: 0;
}

.topbar-subtitle {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.topbar-right {
  display: grid;
  gap: 12px;
  justify-items: end;
  align-items: start;
  min-width: 0;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(245, 248, 251, 0.98), rgba(233, 240, 246, 0.96));
  border: 1px solid rgba(18, 61, 96, 0.1);
  color: #23324b;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 0 10px 22px rgba(31, 45, 61, 0.06);
}

.meta-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #123d60, #4c7cad);
  color: white;
  font-weight: 800;
}

.toolbar,
.card-actions,
.kpi-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.topbar-toolbar {
  justify-content: flex-end;
}

.topbar-profile {
  position: relative;
}

.topbar-profile-trigger {
  min-width: 246px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(18, 61, 96, 0.12);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,246,250,0.94));
  box-shadow: 0 16px 32px rgba(31, 45, 61, 0.1);
  color: var(--text);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.topbar-profile-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 124, 173, 0.22);
  box-shadow: 0 18px 34px rgba(31, 45, 61, 0.12);
}

.topbar-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #123d60, #4c7cad);
  color: white;
  font-weight: 800;
  flex: none;
  overflow: hidden;
}

.topbar-profile-avatar.large {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  box-shadow: 0 14px 24px rgba(18, 61, 96, 0.18);
}

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

.topbar-profile-name {
  font-weight: 800;
  color: #223149;
  white-space: nowrap;
}

.topbar-profile-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1d9c84;
  box-shadow: 0 0 0 4px rgba(29, 156, 132, 0.14);
}

.topbar-profile-chevron {
  margin-left: auto;
  color: #7b8698;
  transition: transform 0.18s ease;
}

.topbar-profile-chevron.is-collapsed {
  transform: rotate(-90deg);
}

.topbar-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 336px;
  padding: 16px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(76, 124, 173, 0.1), transparent 24%),
    rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(18, 61, 96, 0.12);
  box-shadow: 0 28px 54px rgba(27, 41, 59, 0.2);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.topbar-profile-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 26px;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(18, 61, 96, 0.12);
  border-left: 1px solid rgba(18, 61, 96, 0.12);
  transform: rotate(45deg);
}

.topbar-profile-menu.collapsed {
  display: none;
}

.topbar-profile-summary {
  padding: 10px 10px 16px;
  border-bottom: 1px solid rgba(18, 61, 96, 0.08);
}

.topbar-profile-summary-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.topbar-profile-summary-name {
  margin: 0 0 6px;
  font-size: 1.22rem;
  color: #1f2a3b;
}

.topbar-profile-role {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(219, 109, 44, 0.14);
  color: var(--accent);
  font-weight: 800;
}

.topbar-profile-summary-meta {
  margin: 4px 0;
  color: #64748b;
  font-weight: 600;
}

.topbar-profile-links {
  display: grid;
  gap: 8px;
  padding: 14px 0;
}

.topbar-profile-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(247, 250, 252, 0.74);
  color: #24324a;
  text-align: left;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.topbar-profile-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(76, 124, 173, 0.18);
  box-shadow: 0 12px 24px rgba(31, 45, 61, 0.08);
}

.topbar-profile-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(18, 61, 96, 0.08), rgba(76, 124, 173, 0.12));
  color: #456786;
  flex: none;
}

.topbar-profile-link-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.topbar-profile-menu-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(18, 61, 96, 0.08);
}

.topbar-profile-logout {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(209, 79, 98, 0.1), rgba(209, 79, 98, 0.06));
  color: var(--danger);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(209, 79, 98, 0.08);
}

.secondary-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 251, 0.94));
  color: var(--text);
  border: 1px solid rgba(18, 61, 96, 0.1);
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.secondary-button:hover,
.topbar-profile-logout:hover {
  transform: translateY(-1px);
}

.secondary-button:hover {
  border-color: rgba(76, 124, 173, 0.18);
  box-shadow: 0 14px 28px rgba(31, 45, 61, 0.08);
}

.primary-button {
  background: var(--accent);
  color: #fff7f0;
}

.ghost-button {
  background: rgba(219, 109, 44, 0.12);
  color: var(--accent);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.view {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.view.active {
  display: block;
}

#reportsView.active {
  display: grid;
  gap: 18px;
}

.metrics-grid,
.two-column,
.three-column,
.stack-layout,
.stacked-view,
.filter-grid,
.form-grid,
.list,
.timeline,
.policy-list,
.bar-list,
.single-column {
  display: grid;
  gap: 18px;
}

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

.two-column {
  grid-template-columns: 1.4fr 1fr;
}

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

.stacked-view {
  grid-template-columns: 1fr;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

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

.document-filter {
  grid-template-columns: minmax(280px, 1.4fr) repeat(4, minmax(170px, 1fr)) minmax(120px, 0.55fr) minmax(150px, 0.75fr);
  align-items: center;
  margin: 12px 0 10px;
}

.document-filter .filter-search {
  min-width: 260px;
}

.document-area-display {
  color: var(--muted);
  background: rgba(245, 248, 251, 0.82);
  border-style: dashed;
  cursor: default;
}

.workflow-filter {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px;
}

.workflow-filter .ghost-button {
  min-height: 48px;
}

.workflow-filter select,
.workflow-filter input,
.workflow-filter button {
  min-width: 0;
  white-space: normal;
}

.workflow-document-preview {
  min-height: 0;
}

.linked-document-file,
.workflow-linked-files {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.linked-document-file {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(245, 248, 251, 0.68);
}

.linked-document-file.muted {
  color: var(--muted);
}

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

.single-column {
  grid-template-columns: 1fr;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  grid-template-areas:
    "user projects"
    "access access";
  gap: 18px;
}

.users-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.tab-button {
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab-button.active {
  background: linear-gradient(135deg, #123d60, #4c7cad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(18, 61, 96, 0.18);
}

.users-layout.users-active {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  grid-template-areas: "user access";
}

.users-layout.projects-active {
  grid-template-columns: 1fr;
  grid-template-areas: "projects";
}

.users-user-card {
  grid-area: user;
}

.users-project-card {
  grid-area: projects;
}

.users-access-card {
  grid-area: access;
}

.users-project-card .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.users-project-card .form-grid .full,
.users-project-card .form-grid .card-actions.full {
  grid-column: 1 / -1;
}

.project-list {
  margin-top: 18px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  min-width: 0;
}

.users-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

.user-access-item {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.user-access-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.user-access-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #123d60, #4c7cad);
  color: #fff;
  font-weight: 800;
}

.user-access-main {
  min-width: 0;
}

.user-access-main .helper {
  margin: 4px 0 0;
}

.user-access-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-access-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.user-access-actions .chip-row {
  gap: 10px;
}

.user-access-actions .ghost-button {
  min-width: 112px;
}

.user-access-main strong,
.project-item strong {
  overflow-wrap: anywhere;
}

.form-grid .full,
.single-column .full {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.document-date-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.wordpad-field {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.rich-wordpad {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 43, 69, 0.08);
}

.wordpad-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 6px 18px rgba(20, 43, 69, 0.06);
}

.wordpad-tool {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.wordpad-tool:hover {
  border-color: rgba(219, 109, 44, 0.45);
  background: rgba(219, 109, 44, 0.08);
}

.wordpad-select {
  width: auto;
  min-width: 126px;
  height: 34px;
  padding: 6px 28px 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
}

.wordpad-select.wide {
  min-width: 132px;
}

.wordpad-select.small {
  min-width: 88px;
}

.wordpad-editor {
  min-height: 270px;
  padding: 18px;
  outline: none;
  line-height: 1.55;
  background: #fff;
}

.wordpad-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.wordpad-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.wordpad-upload input {
  display: none;
}

.wordpad-upload span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  cursor: pointer;
}

.wordpad-file-name {
  color: var(--muted);
  font-size: 0.88rem;
}

.wordpad-footer-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.metric-value {
  display: block;
  margin-bottom: 8px;
  font-size: 2rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 249, 252, 0.92));
}

.metric-card::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 16px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d9c84, #4c7cad);
  opacity: 0.75;
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.list-item,
.timeline-item,
.policy-item,
.bar-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
}

.card,
.table-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 251, 253, 0.88));
  min-width: 0;
  max-width: 100%;
}

.table-card table {
  min-width: 1080px;
  table-layout: fixed;
}

.document-table-card table {
  min-width: 960px;
}

.document-table-card th:nth-child(1),
.document-table-card td:nth-child(1) {
  width: 30%;
}

.document-table-card th:nth-child(2),
.document-table-card td:nth-child(2),
.document-table-card th:nth-child(3),
.document-table-card td:nth-child(3),
.document-table-card th:nth-child(4),
.document-table-card td:nth-child(4) {
  width: 16%;
}

.document-table-card th:nth-child(5),
.document-table-card td:nth-child(5) {
  width: 14%;
}

.document-table-card th:nth-child(6),
.document-table-card td:nth-child(6) {
  width: 8%;
}

.table-card thead th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.document-alert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
}

.pagination,
.pagination-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-footer {
  justify-content: flex-end;
  margin-top: 16px;
}

.pagination-button {
  min-width: 42px;
  border: 1px solid rgba(18, 61, 96, 0.1);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #23324b;
  font-weight: 800;
  cursor: pointer;
}

.pagination-button.active {
  background: linear-gradient(135deg, #123d60, #4c7cad);
  color: #fff;
}

.pagination-button:disabled {
  opacity: 0.45;
}

.document-alert,
.due-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.document-alert {
  padding: 8px 12px;
}

.due-badge {
  margin-top: 6px;
  padding: 5px 9px;
}

.document-alert.danger,
.due-overdue {
  background: #fdeaea;
  border: 1px solid #f2b8b5;
  color: #b42318;
}

.document-alert.warning,
.due-soon {
  background: #fff4d6;
  border: 1px solid #f6d57a;
  color: #946200;
}

tr.document-row-overdue td {
  background: rgba(253, 234, 234, 0.56);
}

tr.document-row-soon td {
  background: rgba(255, 244, 214, 0.48);
}

.status-pill,
.role-pill,
.kpi-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-vigente,
.status-aprobado {
  background: #e7f7ee;
  border: 1px solid #b9e6ca;
  color: #157347;
}

.status-revision {
  background: #fff4d6;
  border: 1px solid #f6d57a;
  color: #946200;
}

.status-borrador {
  background: #eef5ff;
  border: 1px solid #c9ddf5;
  color: #2d5f93;
}

.status-vencido,
.status-observado {
  background: #fdeaea;
  border: 1px solid #f2b8b5;
  color: #b42318;
}

.role-pill {
  background: rgba(191, 91, 44, 0.12);
  color: var(--accent);
}

.kpi-chip {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  color: var(--text);
}

.bar-track {
  margin-top: 10px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(117, 93, 73, 0.12);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bf5b2c, #df8d54);
}

.success-bar {
  background: linear-gradient(90deg, #2d7a52, #69b286);
}

.warning-bar {
  background: linear-gradient(90deg, #b56f12, #dbab58);
}

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

tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}

tbody tr:hover {
  background: rgba(76, 124, 173, 0.05);
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
}

thead th {
  text-align: left;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-card {
  overflow: auto;
  border-radius: 26px;
  max-width: 100%;
}

.table-card .card-actions {
  gap: 8px;
}

.link-button {
  overflow-wrap: anywhere;
}

.note,
.empty-state,
.error-text,
.success-text {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(219, 109, 44, 0.08);
}

.success-text {
  background: rgba(45, 122, 82, 0.12);
  color: var(--success);
  font-weight: 800;
}

.error-text {
  background: rgba(166, 59, 45, 0.12);
  color: var(--danger);
}

.empty-state {
  border: 1px dashed var(--line);
  text-align: center;
}

.link-button {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.profile-page-avatar {
  width: 74px;
  height: 74px;
  font-size: 1.8rem;
}

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

.profile-detail-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.profile-detail-grid span,
.kpi-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.compact-kpis {
  grid-template-columns: 1fr;
}

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

.settings-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(45, 122, 82, 0.12);
  color: var(--success);
  font-weight: 800;
}

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

.settings-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.settings-list span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.settings-list strong {
  overflow-wrap: anywhere;
}

.settings-photo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.profile-photo-button {
  cursor: pointer;
}

.profile-photo-button input {
  display: none;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.84rem;
}

.permission-pill.allowed {
  background: rgba(45, 122, 82, 0.12);
  color: var(--success);
}

.permission-pill.blocked {
  background: rgba(166, 59, 45, 0.1);
  color: var(--danger);
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.audit-filter {
  grid-template-columns: minmax(210px, 1fr) minmax(150px, 0.7fr) minmax(260px, 1.2fr) auto auto;
  align-items: center;
  margin: 14px 0 18px;
}

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

.audit-table-wrap table {
  min-width: 920px;
  table-layout: fixed;
}

.audit-table-wrap th:nth-child(1),
.audit-table-wrap td:nth-child(1) {
  width: 20%;
}

.audit-table-wrap th:nth-child(2),
.audit-table-wrap td:nth-child(2) {
  width: 16%;
}

.audit-table-wrap th:nth-child(3),
.audit-table-wrap td:nth-child(3),
.audit-table-wrap th:nth-child(4),
.audit-table-wrap td:nth-child(4) {
  width: 14%;
}

.audit-table-wrap th:nth-child(5),
.audit-table-wrap td:nth-child(5) {
  width: 36%;
}

.profile-card {
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 24%),
    linear-gradient(180deg, #e7ddd4, #d7cabc 58%, #d1c3b5);
  box-shadow:
    0 20px 40px rgba(20, 43, 69, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.profile-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 6px;
  border: none;
  background: transparent;
  text-align: left;
}

.profile-card .session-info {
  color: #fff7f0;
}

.profile-panel {
  display: grid;
  gap: 16px;
  margin-top: 10px;
  padding: 0 6px 6px;
}

.profile-panel.collapsed {
  display: none;
}

.profile-chevron {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  color: #fff8f1;
  font-size: 1.2rem;
  transition: transform 0.18s ease;
}

.profile-chevron.is-collapsed {
  transform: rotate(-90deg);
}

.profile-eyebrow {
  margin: 0 0 12px;
  font-size: 1.95rem;
  font-weight: 800;
  color: #fff6ef;
  font-family: "Space Grotesk", sans-serif;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #123d60, #4c7cad);
  color: white;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 10px 24px rgba(18, 61, 96, 0.22);
}

.profile-name {
  margin: 0 0 6px;
  font-size: 1.35rem;
  line-height: 1.1;
  color: #ffffff;
}

.profile-meta {
  margin: 4px 0;
  color: rgba(255, 250, 245, 0.94);
  font-size: 1rem;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(219, 109, 44, 0.16);
  color: var(--accent);
  font-weight: 800;
  margin: 4px 0 10px;
}

.profile-stats {
  display: grid;
  gap: 10px;
  margin: 10px 0 4px;
}

.profile-stat {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.profile-stat strong {
  display: block;
  margin-bottom: 4px;
  color: #fff7ef;
}

.profile-actions {
  display: grid;
  gap: 14px;
}

.profile-quick-actions {
  display: none;
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff7f0;
}

.profile-link strong {
  color: #fffaf5;
}

.profile-link span {
  color: rgba(255, 248, 241, 0.86);
  font-size: 0.94rem;
}

.profile-actions .secondary-button,
.profile-actions .ghost-button {
  justify-content: center;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 1.05rem;
}

.profile-actions .secondary-button {
  background: rgba(255, 255, 255, 0.82);
}

.profile-actions .ghost-button {
  background: rgba(219, 109, 44, 0.12);
}

.dashboard-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(219, 109, 44, 0.28), transparent 24%),
    linear-gradient(135deg, rgba(18, 61, 96, 0.96), rgba(32, 87, 132, 0.94));
  color: white;
  border: none;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dashboard-hero .eyebrow,
.dashboard-hero .helper,
.dashboard-hero .section-title {
  color: #eef6ff;
}

.hero-side {
  display: grid;
  gap: 14px;
  align-content: center;
  min-width: 0;
}

.hero-stat {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-stat strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 6px;
}

.hero-stat span {
  color: rgba(240, 247, 255, 0.88);
}

.dashboard-hero .kpi-chip {
  background: rgba(255, 255, 255, 0.12);
  color: #eef7ff;
  border-color: rgba(255, 255, 255, 0.18);
}

.dashboard-score {
  min-width: 180px;
  max-width: 100%;
  padding: 22px;
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-score strong {
  display: block;
  font-size: 2.6rem;
  line-height: 1;
}

.dashboard-score span {
  display: block;
  margin-top: 8px;
  color: rgba(240, 247, 255, 0.88);
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.dashboard-kpi {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(20, 43, 69, 0.08);
}

.dashboard-kpi span,
.dashboard-kpi p {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-kpi strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 2.1rem;
}

.dashboard-kpi.warning strong {
  color: var(--warning);
}

.dashboard-kpi.danger strong {
  color: var(--danger);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-bottom: 18px;
}

.chart-card {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,249,252,0.92));
  border: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dashboard-visual-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.dashboard-visual-grid.secondary {
  grid-template-columns: 0.9fr 1.1fr;
}

.dashboard-chart-card {
  min-height: 320px;
}

.dashboard-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  align-items: end;
  gap: 16px;
  min-height: 238px;
  padding-top: 12px;
}

.dashboard-bars.compact {
  min-height: 210px;
}

.dashboard-bar {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.dashboard-bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 160px;
  border-radius: 16px;
  background: rgba(18, 61, 96, 0.06);
  overflow: hidden;
}

.dashboard-bar-fill {
  width: 100%;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #2d7a52, #69b286);
}

.dashboard-bar-fill.type-bar {
  background: linear-gradient(180deg, #db6d2c, #f0a15a);
}

.dashboard-bar strong {
  color: var(--text);
  font-size: 1.15rem;
}

.dashboard-bar span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 220px;
}

.dashboard-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  border-radius: 50%;
}

.dashboard-donut.is-empty {
  background: conic-gradient(#d8e1ea 0 100%);
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #fff;
}

.dashboard-legend {
  display: grid;
  gap: 10px;
}

.dashboard-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-legend-item span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dashboard-legend-item strong {
  color: var(--text);
}

.dashboard-legend-item em {
  font-style: normal;
  font-weight: 800;
}

.dashboard-activity {
  display: grid;
  gap: 12px;
}

.dashboard-activity-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-activity-item span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-activity-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 220px;
  padding-top: 18px;
}

.mini-bar {
  flex: 1 1 0;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, rgba(29,156,132,0.94), rgba(76,124,173,0.88));
  position: relative;
  min-height: 36px;
}

.mini-bar span {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: var(--muted);
}

.donut-wrap {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#1d9c84 0 68%, #d69e2e 68% 86%, #e4ebf2 86% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: white;
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 2rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.stat-tile {
  padding: 16px;
  border-radius: 20px;
  background: rgba(18, 61, 96, 0.05);
  border: 1px solid rgba(18, 61, 96, 0.08);
}

.stat-tile strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

@media (max-width: 1100px) {
  .app-shell,
  .content-shell,
  .auth-layout,
  .chart-grid,
  .dashboard-visual-grid,
  .dashboard-visual-grid.secondary,
  .dashboard-kpi-grid,
  .users-layout,
  .profile-grid,
  .settings-grid,
  .document-date-row,
  .two-column,
  .three-column,
  .metrics-grid,
  .filter-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 14px 32px rgba(18, 61, 96, 0.18);
  }

  .sidebar > div:first-child {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
  }

  .sidebar-brand-logo {
    width: 46px;
    max-height: 46px;
  }

  .sidebar h1 {
    margin: 0;
    font-size: 1.35rem;
  }

  .sidebar-copy {
    grid-column: 1 / -1;
    margin-top: 2px;
    font-size: 0.9rem;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin-inline: -2px;
    padding: 2px 2px 8px;
    overflow: visible;
  }

  .nav-button {
    min-width: 0;
    width: 100%;
    white-space: nowrap;
    justify-content: center;
  }

  .nav-button.active::after {
    inset: auto 14px 6px 14px;
    width: auto;
    height: 3px;
  }

  .content {
    padding: 22px;
  }

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

  .topbar-right {
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
  }

  .topbar-toolbar,
  .topbar-meta {
    justify-content: flex-start;
  }

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

  .users-grid-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .users-layout {
    grid-template-areas:
      "user"
      "projects"
      "access";
  }

  .users-layout.users-active,
  .users-layout.projects-active {
    grid-template-columns: 1fr;
  }

  .users-layout.users-active {
    grid-template-areas:
      "user"
      "access";
  }

  .users-layout.projects-active {
    grid-template-areas: "projects";
  }

  .project-item,
  .user-access-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .user-access-actions {
    justify-content: stretch;
  }

  .user-access-actions .chip-row,
  .user-access-actions .ghost-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .login-screen {
    padding: 14px;
    align-items: start;
  }

  .login-card,
  .card,
  .table-card,
  .metric-card {
    border-radius: 18px;
  }

  .login-card {
    padding: 16px;
  }

  .auth-visual {
    min-height: 180px;
    padding: 18px;
    border-radius: 22px;
  }

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

  .auth-panel {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .auth-form-panel h1 {
    font-size: 2.2rem;
  }

  .auth-inline-row {
    grid-template-columns: 1fr;
  }

  .auth-submit,
  .auth-inline-button {
    width: 100%;
  }

  .sidebar {
    padding: 14px;
    border-radius: 0 0 18px 18px;
  }

  .sidebar-copy {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-bottom: 0;
  }

  .nav-button {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    min-height: 82px;
    flex-direction: column;
    align-items: center;
    white-space: normal;
    text-align: center;
  }

  .nav-icon {
    width: 30px;
    height: 30px;
  }

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

  .content {
    padding: 16px 12px 22px;
  }

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

  .toolbar,
  .topbar-right,
  .topbar-meta,
  .toolbar button,
  .card-actions button,
  .topbar-profile,
  .topbar-profile-trigger,
  .topbar-profile-menu {
    width: 100%;
    justify-items: stretch;
  }

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

  .topbar h2 {
    font-size: 1.85rem;
    overflow-wrap: anywhere;
  }

  .topbar-subtitle {
    font-size: 0.95rem;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .topbar-profile-menu {
    position: static;
    margin-top: 10px;
  }

  .topbar-profile-name {
    white-space: normal;
  }

  .meta-chip {
    width: 100%;
    justify-content: center;
    border-radius: 18px;
    text-align: center;
  }

  .session-card,
  .metric-card,
  .card,
  .table-card {
    padding: 16px;
  }

  .users-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab-button {
    padding-inline: 10px;
  }

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

  .user-access-head {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .user-access-avatar {
    width: 38px;
    height: 38px;
  }

  .document-filter .filter-search {
    min-width: 0;
  }

  .document-filter,
  .audit-filter {
    grid-template-columns: 1fr;
  }

  .pagination,
  .pagination-footer {
    justify-content: stretch;
  }

  .pagination-button {
    flex: 1 1 auto;
  }

  .document-table-card {
    overflow: visible;
  }

  .document-table-card table,
  .document-table-card thead,
  .document-table-card tbody,
  .document-table-card tr,
  .document-table-card th,
  .document-table-card td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .document-table-card th:nth-child(n),
  .document-table-card td:nth-child(n) {
    width: 100%;
  }

  .document-table-card table {
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
  }

  .document-table-card thead {
    display: none;
  }

  .document-table-card tbody {
    display: grid;
    gap: 14px;
  }

  .document-table-card tr {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 24px rgba(31, 45, 61, 0.06);
  }

  .document-table-card td {
    display: grid;
    grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(54, 72, 95, 0.08);
    overflow-wrap: anywhere;
  }

  .document-table-card td > * {
    min-width: 0;
  }

  .document-table-card td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .document-table-card td::before {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .document-table-card td:nth-child(1)::before {
    content: "Documento";
  }

  .document-table-card td:nth-child(2)::before {
    content: "Estado";
  }

  .document-table-card td:nth-child(3)::before {
    content: "Proyecto";
  }

  .document-table-card td:nth-child(4)::before {
    content: "Fechas";
  }

  .document-table-card td:nth-child(5)::before {
    content: "Archivo";
  }

  .document-table-card td:nth-child(6)::before {
    content: "Acciones";
  }

  .document-table-card .card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wordpad-toolbar {
    gap: 6px;
    padding: 8px;
  }

  .wordpad-tool {
    min-width: 34px;
    height: 34px;
  }

  .wordpad-select,
  .wordpad-select.wide,
  .wordpad-select.small {
    min-width: 0;
    flex: 1 1 120px;
  }

  .wordpad-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .wordpad-footer-actions {
    margin-left: 0;
  }

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

  .dashboard-hero,
  .section-heading-row,
  .dashboard-donut-wrap {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    padding: 20px;
  }

  .dashboard-hero > *,
  .hero-side,
  .hero-stat,
  .dashboard-score,
  .dashboard-hero .helper,
  .dashboard-hero .section-title {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .dashboard-score {
    min-width: 0;
    width: 100%;
  }

  .dashboard-score strong {
    font-size: 2.1rem;
  }

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

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

  .stat-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .sidebar > div:first-child {
    grid-template-columns: 38px 1fr;
  }

  .sidebar-brand-logo {
    width: 38px;
    max-height: 38px;
  }

  .sidebar h1 {
    font-size: 1.18rem;
  }

  .nav-button {
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
  }

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

  .topbar h2 {
    font-size: 1.55rem;
  }

  .topbar-profile-trigger {
    min-width: 0;
    padding: 9px 12px;
  }

  .topbar-profile-avatar {
    width: 34px;
    height: 34px;
  }

  .metrics-grid,
  .dashboard-kpi-grid {
    gap: 12px;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .dashboard-donut {
    width: 150px;
    height: 150px;
  }

  .dashboard-donut::after {
    inset: 20px;
  }

  .table-card table {
    min-width: 680px;
  }

  .document-table-card table {
    min-width: 0;
  }

  th,
  td {
    padding: 12px 10px;
    font-size: 0.9rem;
  }
}
