: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%);
}

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

.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);
}

.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 {
  border: none;
  background: transparent;
  padding: 0;
  color: #2c3550;
  text-decoration: underline;
  text-underline-offset: 4px;
  width: fit-content;
  font-weight: 700;
}

.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;
}

.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: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #f5fbff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.content {
  padding: 28px;
}

.content-shell {
  display: block;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  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;
}

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

.meta-chip {
  display: inline-flex;
  align-items: center;
  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;
  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;
}

.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);
  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;
}

.view.active {
  display: block;
}

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

.metrics-grid,
.two-column,
.three-column,
.stack-layout,
.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;
}

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

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

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

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

.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);
}

.card,
.table-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 251, 253, 0.88));
}

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

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

.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: rgba(45, 122, 82, 0.12);
  color: var(--success);
}

.status-borrador,
.status-revision {
  background: rgba(181, 111, 18, 0.13);
  color: var(--warning);
}

.status-vencido,
.status-observado {
  background: rgba(166, 59, 45, 0.12);
  color: var(--danger);
}

.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;
}

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;
}

.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-user-list {
  display: grid;
  gap: 12px;
}

.audit-user-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.audit-user-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.audit-user-toggle strong,
.audit-user-toggle small {
  display: block;
}

.audit-user-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.audit-chevron {
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.18s ease;
}

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

.audit-user-detail {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.audit-user-detail.collapsed {
  display: none;
}

.audit-user-detail table {
  min-width: 760px;
}

.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-hero {
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top right, rgba(76, 124, 173, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(18, 61, 96, 0.96), rgba(32, 87, 132, 0.94));
  color: white;
  border: none;
}

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

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

.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);
}

.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);
  box-shadow: var(--shadow);
}

.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,
  .profile-grid,
  .settings-grid,
  .document-date-row,
  .two-column,
  .three-column,
  .metrics-grid,
  .filter-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .content {
    padding: 18px;
  }

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

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

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

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

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

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

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