﻿:root {
  --font-ampar: "Inter", "Segoe UI Variable", "Segoe UI", Calibri, Arial, sans-serif;
  --ampar-blue: #155c92;
  --ampar-blue-dark: #0b3f66;
  --ampar-blue-light: #eaf5ff;
  --medical-cyan: #21a7c9;
  --medical-turquoise: #2ec4b6;
  --medical-green: #38b000;
  --medical-mint: #dff8f2;
  --medical-purple: #7b61ff;
  --medical-lavender: #f0edff;
  --medical-orange: #f59e0b;
  --medical-yellow-soft: #fff7e6;
  --medical-red: #ef4444;
  --medical-red-soft: #ffecec;
  --surface-bg: #f4f9fc;
  --card-bg: #ffffff;
  --text-main: #0b2545;
  --text-muted: #5e7185;
  --border-soft: #d8e6f0;
  --bg: var(--surface-bg);
  --surface: var(--card-bg);
  --ink: var(--text-main);
  --muted: var(--text-muted);
  --line: var(--border-soft);
  --brand: var(--ampar-blue);
  --brand-dark: var(--ampar-blue-dark);
  --brand-soft: var(--ampar-blue-light);
  --sidebar: var(--ampar-blue-dark);
  --sidebar-active: #104f7d;
  --sidebar-line: rgba(234, 245, 255, 0.2);
  --accent: var(--medical-cyan);
  --danger: var(--medical-red);
  --ok: var(--medical-turquoise);
  --shadow: 0 10px 28px rgba(11, 63, 102, 0.08);
  --content-max: 1560px;
}


.login-screen {
  background: #ffffff;
  display: none;
  inset: 0;
  min-height: 100vh;
  position: fixed;
  z-index: 80;
}

.login-screen.open {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
}

.login-panel {
  grid-column: 1;
}

.login-visual {
  grid-column: 2;
}

.login-visual {
  background:
    linear-gradient(135deg, rgba(15, 61, 102, 0.92), rgba(21, 84, 138, 0.78)),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(145deg, #0f3d66, #15548a);
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  place-items: center;
  position: relative;
}

.login-visual .login-video {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.login-visual::before,
.login-visual::after {
  background: rgba(255, 255, 255, 0.14);
  content: "";
  position: absolute;
  transform: rotate(-18deg);
}

.login-visual::before {
  height: 140%;
  left: 18%;
  top: -20%;
  width: 18px;
}

.login-visual::after {
  height: 120%;
  right: 24%;
  top: -10%;
  width: 42px;
}

.login-visual-mark {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(8, 35, 63, 0.2);
  padding: clamp(24px, 5vw, 54px);
  position: relative;
  width: min(460px, 68%);
  z-index: 0;
}

.login-visual-mark img {
  display: block;
  height: auto;
  width: 100%;
}

.login-panel {
  align-content: center;
  background: #ffffff;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  padding: clamp(24px, 3vw, 40px);
}

.login-panel-card {
  display: grid;
  gap: 22px;
  width: min(360px, 100%);
}

.login-panel-logo {
  display: block;
  height: auto;
  justify-self: start;
  max-width: 100%;
  object-fit: contain;
  width: 260px;
}

.login-panel h1 {
  color: var(--brand-dark);
  font-size: 42px;
  font-weight: 700;
  margin: 4px 0 0;
}

.login-panel .form {
  max-width: 420px;
}

.login-message {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  min-height: 18px;
}

.session-badge {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 40px;
  padding: 0 12px;
}

body.login-required {
  overflow: hidden;
}

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

  .login-visual {
    display: none;
  }

  .login-panel {
    width: 100%;
  }
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f4f9fc 0%, #eaf5ff 100%);
  color: var(--ink);
  font-family: var(--font-ampar);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  display: grid;
  grid-template-columns: 260px 1fr;
  transition: grid-template-columns 180ms ease;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

.danger-button {
  background: linear-gradient(135deg, var(--ampar-blue), var(--medical-cyan));
  box-shadow: 0 10px 20px rgba(33, 167, 201, 0.2);
  font-weight: 650;
}

.danger-button:hover {
  background: var(--brand-dark);
}

.icon-button {
  background: #eef4f7;
  border: 1px solid #c8d6df;
  color: var(--ink);
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.icon-button:hover {
  background: #e0ebf0;
}

.secondary {
  background: #f7fbff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #d8e8f4;
}

.sidebar {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--ampar-blue-dark) 0%, #0d4c76 100%);
  color: #fff;
  overflow-x: hidden;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  transition: padding 180ms ease, width 180ms ease;
  width: 260px;
}

.brand {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
  position: relative;
}

.brand-logo {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: flex;
  flex: 0 0 auto;
  height: 82px;
  justify-content: center;
  padding: 0;
  width: 168px;
}

.brand-logo img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.brand small {
  display: block;
}

.brand small {
  color: #c7d9e8;
  margin-top: 3px;
  text-align: center;
  width: 168px;
}

.sidebar-collapse-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(234, 245, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  position: absolute;
  right: 0;
  top: 6px;
  width: 30px;
}

.sidebar-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-collapse-toggle span {
  font-size: 22px;
  line-height: 1;
  transform: translateY(-1px);
}

body.sidebar-collapsed {
  grid-template-columns: 88px 1fr;
}

body.sidebar-collapsed .sidebar {
  padding: 20px 12px;
  width: 88px;
}

body.sidebar-collapsed .brand {
  gap: 8px;
  justify-items: center;
  margin-bottom: 22px;
}

body.sidebar-collapsed .brand-logo {
  height: 54px;
  padding: 6px;
  width: 54px;
}

body.sidebar-collapsed .brand small {
  height: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  width: 0;
}

body.sidebar-collapsed .sidebar-collapse-toggle {
  right: -2px;
  top: 10px;
}

body.sidebar-collapsed .nav {
  gap: 10px;
}

body.sidebar-collapsed .subnav {
  display: none;
}

body.sidebar-collapsed .nav-item {
  align-items: center;
  display: flex;
  font-size: 0;
  justify-content: center;
  min-height: 42px;
  padding: 0;
  text-align: center;
}

body.sidebar-collapsed .nav-item::before {
  color: #eaf5ff;
  content: attr(data-short);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

body.sidebar-collapsed .nav-parent > span:not(.nav-caret),
body.sidebar-collapsed .nav-caret {
  display: none;
}

body.sidebar-collapsed .nav-group {
  gap: 0;
}

.nav {
  display: grid;
  gap: 8px;
}

body.access-pending .nav {
  opacity: 0;
  pointer-events: none;
}

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

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: #d7e8f4;
  font-weight: 600;
  text-align: left;
  width: 100%;
}

.nav-parent {
  align-items: center;
  color: #fff;
  display: flex;
  font-weight: 600;
  justify-content: space-between;
  gap: 10px;
}

.nav-caret {
  font-size: 12px;
  transition: transform 180ms ease;
}

.nav-item:hover,
.nav-item.active,
.nav-item.is-active {
  background: var(--sidebar-active);
  border-color: var(--sidebar-line);
}

.nav-group.active .nav-parent,
.nav-group.is-active .nav-parent {
  background: var(--sidebar-active);
  border-color: var(--sidebar-line);
}

.subnav {
  border-left: 1px solid var(--sidebar-line);
  display: grid;
  gap: 5px;
  margin-left: 14px;
  max-height: 420px;
  opacity: 1;
  overflow: hidden;
  padding-left: 10px;
  pointer-events: auto;
  transition: max-height 220ms ease, opacity 180ms ease, margin 180ms ease, padding 180ms ease, border-color 180ms ease;
}

.nav-group.collapsed .subnav,
.nav-group:not(.is-open):not(.expanded) .subnav {
  border-color: transparent;
  margin-top: -6px;
  max-height: 0;
  opacity: 0;
  padding-left: 0;
  pointer-events: none;
}

.nav-group.collapsed .subnav > *,
.nav-group:not(.is-open):not(.expanded) .subnav > * {
  min-height: 0;
}

.nav-group.collapsed .nav-caret,
.nav-group:not(.is-open):not(.expanded) .nav-caret {
  transform: rotate(-90deg);
}

.subnav-item {
  color: #c7d9e8;
  font-weight: 300;
  min-height: 34px;
  padding-left: 12px;
}

.subnav-item.active,
.subnav-item.is-active {
  color: #fff;
}

.app {
  justify-self: center;
  padding: 30px clamp(24px, 3vw, 42px);
  min-width: 0;
  width: min(100%, var(--content-max));
}

.topbar {
  background: var(--brand);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: -30px calc(clamp(24px, 3vw, 42px) * -1) 26px;
  padding: 30px clamp(24px, 3vw, 42px);
}

.topbar h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #cfe4f4;
}

.topbar .secondary {
  background: #ffffff;
  color: var(--brand-dark);
}

.topbar .secondary:hover {
  background: var(--brand-soft);
}

.topbar-link {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
}

.mi-rh-install-button {
  border: 0;
  cursor: pointer;
}

body.mi-rh-app-mode .topbar h1::after {
  content: "";
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
}

.notifications-center {
  position: relative;
}

.manuals-body {
  background: var(--surface-bg);
  color: var(--text-main);
  margin: 0;
}

.manuals-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 100vh;
}

.manuals-sidebar {
  background: var(--sidebar);
  color: #ffffff;
  padding: 24px 18px;
}

.manuals-brand {
  align-items: center;
  color: #ffffff;
  display: flex;
  font-weight: 900;
  gap: 12px;
  margin-bottom: 24px;
  text-decoration: none;
}

.manuals-brand img {
  background: #ffffff;
  border-radius: 8px;
  height: 42px;
  object-fit: contain;
  padding: 4px;
  width: 42px;
}

.manuals-nav {
  display: grid;
  gap: 6px;
}

.manuals-nav a {
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: none;
}

.manuals-nav a:hover,
.manuals-nav a.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.manuals-content {
  min-width: 0;
  padding: 28px;
}

.manuals-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1100px;
}

.manuals-header h1 {
  margin: 0;
}

.manuals-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.manuals-article {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.65;
  margin: 0 auto;
  max-width: 1100px;
  padding: 32px;
}

.manuals-article h1,
.manuals-article h2,
.manuals-article h3 {
  color: var(--text-main);
  line-height: 1.2;
}

.manuals-article h1 {
  margin-top: 0;
}

.manuals-article a {
  color: var(--brand);
  font-weight: 800;
}

.manuals-article pre {
  background: var(--brand-soft);
  border-radius: 6px;
  overflow: auto;
  padding: 14px;
}

.manuals-system-hero {
  margin-bottom: 18px;
}

.manuals-system-panel {
  margin-top: 0;
}

.manuals-system-article {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  line-height: 1.65;
  padding: 28px;
}

.manuals-system-article h1,
.manuals-system-article h2,
.manuals-system-article h3 {
  color: var(--text-main);
  line-height: 1.2;
}

.manuals-system-article h1 {
  margin-top: 0;
}

.manuals-system-article a {
  color: var(--brand);
  font-weight: 800;
}

.manuals-system-article pre {
  background: var(--brand-soft);
  border-radius: 6px;
  overflow: auto;
  padding: 14px;
}

.manuals-system-article code {
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .manuals-shell {
    grid-template-columns: 1fr;
  }

  .manuals-sidebar {
    position: static;
  }

  .manuals-content {
    padding: 18px;
  }

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

  .manuals-article {
    padding: 22px;
  }
}

.notification-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
}

.notification-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.notification-icon {
  display: inline-flex;
  height: 18px;
  width: 18px;
}

.notification-label {
  font-size: 12px;
  font-weight: 800;
}

.notification-badge {
  align-items: center;
  background: var(--danger);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  min-width: 20px;
  padding: 2px 6px;
}

.notification-badge.is-empty {
  background: rgba(255, 255, 255, 0.24);
}

.notifications-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(11, 63, 102, 0.18);
  color: var(--ink);
  display: none;
  max-height: min(560px, calc(100vh - 120px));
  overflow: hidden;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(430px, calc(100vw - 32px));
  z-index: 70;
}

.notifications-panel.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.notifications-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px;
}

.notifications-head strong,
.notifications-head span {
  display: block;
}

.notifications-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.notifications-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.notification-item {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.notification-item.unread {
  background: #eef8ff;
  border-left-color: var(--medical-cyan);
}

.notification-item.urgent {
  border-left-color: var(--danger);
}

.notification-item strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.notification-item p {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
}

.notification-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
}

.notification-action {
  justify-self: start;
  margin-top: 2px;
}

.save-sync-status {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 34px;
  padding: 0 12px;
}

.save-sync-status.saved {
  background: rgba(220, 252, 231, 0.18);
  border-color: rgba(220, 252, 231, 0.42);
}

.save-sync-status.saving,
.save-sync-status.pending {
  background: rgba(255, 243, 214, 0.2);
  border-color: rgba(255, 243, 214, 0.48);
}

.save-sync-status.error {
  background: rgba(253, 226, 225, 0.22);
  border-color: rgba(253, 226, 225, 0.52);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.module-header {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.module-header span {
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  text-transform: uppercase;
}

.module-header strong {
  color: var(--muted);
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 14px;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.dashboard-grid,
.split,
.client-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
}

.client-layout {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  align-items: start;
}

.dashboard-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.map-panel {
  margin-bottom: 16px;
}

.corp-panel {
  margin-bottom: 16px;
}

#dashboardCorp .corp-panel {
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(11, 63, 102, 0.07);
}

.corp-kpi-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  margin-bottom: 0;
}

.corp-kpi-grid.compact {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.corp-client-summary-grid {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  margin-bottom: 16px;
}

.corp-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) minmax(420px, 1fr);
  margin-bottom: 18px;
}

.corp-filter-grid .filter-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#dashboardCorp .corp-primary-action {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(11, 95, 155, 0.18);
  color: #ffffff;
}

#dashboardCorp .corp-primary-action:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

#dashboardCorp .corp-report-action {
  background: #ffffff;
  color: var(--brand-dark);
}

.corp-dashboard-stack {
  display: grid;
  gap: 16px;
}

.corp-dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

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

.corp-breakdown-grid h3 {
  color: var(--brand-dark);
  font-size: 15px;
  margin: 0 0 10px;
}

.corp-list,
.corp-alert-list {
  display: grid;
  gap: 8px;
}

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

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

.corp-open-table {
  min-width: 760px;
}

.corp-open-table th:nth-child(1),
.corp-open-table td:nth-child(1) {
  width: 130px;
}

.corp-open-table th:nth-child(2),
.corp-open-table td:nth-child(2) {
  width: 140px;
}

.corp-open-table th:nth-child(4),
.corp-open-table td:nth-child(4) {
  width: 140px;
}

.corp-open-table th:nth-child(5),
.corp-open-table td:nth-child(5) {
  text-align: right;
  width: 150px;
}

.corp-rfm-summary {
  margin: 14px 0;
}

.corp-rfm-summary-card {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.corp-rfm-summary-card h3 {
  color: var(--brand-dark);
  font-size: 16px;
  margin: 0;
}

.corp-rfm-summary-card p {
  color: var(--text-main);
  line-height: 1.45;
  margin: 0;
}

.corp-rfm-contact-table {
  min-width: 1120px;
  table-layout: fixed;
}

.corp-rfm-contact-table th:nth-child(1),
.corp-rfm-contact-table td:nth-child(1) {
  width: 210px;
}

.corp-rfm-contact-table th:nth-child(2),
.corp-rfm-contact-table td:nth-child(2) {
  width: 110px;
}

.corp-rfm-contact-table th:nth-child(3),
.corp-rfm-contact-table td:nth-child(3) {
  width: 170px;
}

.corp-rfm-contact-table th:nth-child(4),
.corp-rfm-contact-table td:nth-child(4) {
  width: 190px;
}

.corp-rfm-contact-table th:nth-child(5),
.corp-rfm-contact-table td:nth-child(5) {
  width: 165px;
}

.corp-rfm-contact-text {
  overflow-wrap: anywhere;
  white-space: normal;
}

.corp-rh-attendance-block {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.corp-rh-attendance-block h3 {
  color: var(--brand-dark);
  font-size: 16px;
  margin: 0 0 8px;
}

.corp-rh-attendance-table {
  min-width: 1040px;
}

.corp-rh-attendance-table th:nth-child(1),
.corp-rh-attendance-table td:nth-child(1) {
  width: 220px;
}

.corp-rh-attendance-table th:nth-child(3),
.corp-rh-attendance-table td:nth-child(3),
.corp-rh-attendance-table th:nth-child(5),
.corp-rh-attendance-table td:nth-child(5) {
  max-width: 190px;
  overflow-wrap: anywhere;
}

.muted-inline {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin-left: 10px;
}

.corp-row,
.corp-alert {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.corp-row.warn {
  border-left: 4px solid var(--medical-orange);
}

.corp-row.ok {
  border-left: 4px solid var(--ok);
}

.corp-row strong,
.corp-alert strong {
  color: var(--brand-dark);
  display: block;
  font-size: 14px;
}

.corp-row span,
.corp-alert small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.corp-row > span,
.corp-alert b {
  color: var(--brand-dark);
  font-size: 14px;
  white-space: nowrap;
}

.corp-alert > span {
  border-radius: 999px;
  color: var(--brand-dark);
  flex: 0 0 104px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.corp-alert.ok {
  border-left: 4px solid var(--ok);
}

.corp-alert.warn {
  border-left: 4px solid var(--medical-orange);
}

.corp-alert.danger {
  border-left: 4px solid var(--danger);
}

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

.shareholder-wide {
  grid-column: 1 / -1;
}

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

.shareholder-company-title {
  border-bottom: 2px solid var(--ampar-blue-dark);
  color: var(--text-main);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 24px 0 10px;
  padding-bottom: 4px;
}

.shareholder-lab-title {
  grid-column: 1 / -1;
  margin-bottom: -2px;
  margin-top: 0;
}

.shareholder-lab-kpi-grid {
  grid-column: 1 / -1;
}

.shareholder-lab-sales-kpi-grid {
  margin-bottom: 8px;
}

.shareholder-summary-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--medical-teal);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 170px;
  padding: 18px;
  text-align: center;
}

.shareholder-action-card {
  cursor: pointer;
}

.shareholder-action-card:focus,
.shareholder-action-card:hover {
  border-color: var(--brand);
  box-shadow: 0 20px 52px rgba(11, 92, 145, 0.16);
  outline: none;
}

.shareholder-sales-card,
.shareholder-profit-card {
  grid-column: span 3;
}

.shareholder-cost-card {
  border-left-color: var(--medical-orange);
  grid-column: span 6;
  justify-items: stretch;
}

.shareholder-secondary-card {
  border-left-color: var(--medical-purple);
  grid-column: span 3;
  min-height: 165px;
}

.shareholder-lab-sales-card {
  border-left-color: var(--medical-teal);
  grid-column: span 3;
  min-height: 165px;
}

.shareholder-lab-sales-card.warn {
  border-left-color: var(--medical-orange);
}

.shareholder-lab-sales-card.ok {
  border-left-color: var(--success);
}

.shareholder-lab-sales-card.risk {
  border-left-color: var(--danger);
}

.shareholder-lab-sales-card.process {
  border-left-color: var(--brand);
}

.shareholder-lab-sales-card.products {
  border-left-color: var(--medical-purple);
}

.shareholder-cost-detail-table.is-product-ranking th:first-child,
.shareholder-cost-detail-table.is-product-ranking td:first-child {
  width: 80px;
}

.shareholder-cost-kpi-card {
  border-left-color: var(--medical-orange);
  grid-column: span 3;
  min-height: 165px;
}

.shareholder-utility-kpi-card {
  grid-column: span 3;
  min-height: 165px;
}

.shareholder-utility-kpi-card.is-positive {
  border-left-color: var(--success);
}

.shareholder-utility-kpi-card.is-negative {
  border-left-color: var(--danger);
}

.shareholder-utility-kpi-card.is-positive > b {
  color: var(--success);
}

.shareholder-utility-kpi-card.is-negative > b {
  color: var(--danger);
}

.shareholder-deposits-panel {
  max-width: 1120px;
}

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

.shareholder-deposit-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.shareholder-deposit-head {
  align-items: center;
  background: #fff;
  border: 0;
  color: var(--brand-dark);
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}

.shareholder-deposit-head:hover,
.shareholder-deposit-head:focus {
  background: var(--soft);
  outline: none;
}

.shareholder-deposit-head span {
  display: grid;
  gap: 4px;
}

.shareholder-deposit-head small {
  color: var(--muted);
}

.shareholder-deposit-head b {
  font-size: 18px;
  white-space: nowrap;
}

.shareholder-deposit-records {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.shareholder-deposit-table {
  min-width: 0;
  table-layout: fixed;
}

.shareholder-deposit-table th,
.shareholder-deposit-table td {
  padding-left: 10px;
  padding-right: 10px;
}

.shareholder-deposit-table th:nth-child(1),
.shareholder-deposit-table td:nth-child(1) {
  width: 78px;
}

.shareholder-deposit-table th:nth-child(2),
.shareholder-deposit-table td:nth-child(2) {
  width: 300px;
}

.shareholder-deposit-table th:nth-child(3),
.shareholder-deposit-table td:nth-child(3) {
  width: 88px;
}

.shareholder-deposit-table th:nth-child(4),
.shareholder-deposit-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 160px;
}

.shareholder-deposit-table th:nth-child(5),
.shareholder-deposit-table td:nth-child(5) {
  width: 96px;
}

.shareholder-deposit-table th:nth-child(6),
.shareholder-deposit-table td:nth-child(6) {
  text-align: center;
  width: 92px;
}

.shareholder-deposit-table td:nth-child(2) small {
  display: block;
  margin-top: 3px;
}

.shareholder-deposit-table .small-action {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.kpi-drilldown-card {
  cursor: pointer;
}

.kpi-drilldown-card:hover {
  transform: translateY(-1px);
}

.corp-kpi-detail-table {
  min-width: 980px;
  table-layout: auto;
}

.corp-kpi-detail-table th,
.corp-kpi-detail-table td {
  vertical-align: top;
}

.corp-kpi-detail-table th:nth-child(n),
.corp-kpi-detail-table td:nth-child(n) {
  width: auto;
}

.corp-kpi-detail-table td small {
  display: block;
  margin-top: 3px;
}

.corp-kpi-detail-table .small-action {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.shareholder-summary-card > strong,
.shareholder-cost-title strong {
  color: var(--brand-dark);
  font-size: 15px;
  line-height: 1.2;
}

.shareholder-summary-card > b,
.shareholder-cost-title b {
  color: var(--brand-dark);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
}

.shareholder-secondary-card > b,
.shareholder-cost-kpi-card > b,
.shareholder-utility-kpi-card > b {
  font-size: clamp(26px, 2.5vw, 38px);
}

.shareholder-summary-card small {
  color: var(--muted);
}

.shareholder-cost-title {
  align-items: center;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.shareholder-cost-rubros {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 6px;
}

.shareholder-cost-rubros div {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.shareholder-cost-rubro-action {
  border-radius: 10px;
  cursor: pointer;
  padding: 8px;
}

.shareholder-cost-rubro-action:focus,
.shareholder-cost-rubro-action:hover {
  background: var(--soft);
  outline: 1px solid var(--line);
}

.shareholder-cost-rubros span {
  color: var(--brand-dark);
  font-size: 14px;
  line-height: 1.25;
}

.shareholder-cost-rubros strong {
  color: var(--brand-dark);
  font-size: 15px;
}

.shareholder-cost-detail-panel {
  max-width: 1180px;
}

.shareholder-cost-detail-table {
  min-width: 0;
  table-layout: fixed;
}

.shareholder-cost-detail-table th,
.shareholder-cost-detail-table td {
  padding-left: 10px;
  padding-right: 10px;
  white-space: normal;
  word-break: normal;
}

.shareholder-cost-detail-table td strong {
  white-space: normal;
}

.shareholder-cost-detail-table.is-product th:nth-child(1),
.shareholder-cost-detail-table.is-product td:nth-child(1) {
  width: 350px;
}

.shareholder-cost-detail-table.is-product th:nth-child(2),
.shareholder-cost-detail-table.is-product td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 70px;
}

.shareholder-cost-detail-table.is-product th:nth-child(3),
.shareholder-cost-detail-table.is-product td:nth-child(3) {
  text-align: center;
  width: 76px;
}

.shareholder-cost-detail-table.is-product th:nth-child(4),
.shareholder-cost-detail-table.is-product td:nth-child(4),
.shareholder-cost-detail-table.is-product th:nth-child(5),
.shareholder-cost-detail-table.is-product td:nth-child(5) {
  width: 116px;
}

.shareholder-cost-detail-table.is-product th:nth-child(6),
.shareholder-cost-detail-table.is-product td:nth-child(6) {
  width: 120px;
}

.shareholder-cost-detail-table.is-shipping th:nth-child(1),
.shareholder-cost-detail-table.is-shipping td:nth-child(1) {
  width: 320px;
}

.shareholder-cost-detail-table.is-shipping th:nth-child(2),
.shareholder-cost-detail-table.is-shipping td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 120px;
}

.shareholder-cost-detail-table.is-shipping th:nth-child(3),
.shareholder-cost-detail-table.is-shipping td:nth-child(3),
.shareholder-cost-detail-table.is-shipping th:nth-child(4),
.shareholder-cost-detail-table.is-shipping td:nth-child(4) {
  text-align: center;
  width: 90px;
}

.shareholder-cost-detail-table.is-shipping th:nth-child(5),
.shareholder-cost-detail-table.is-shipping td:nth-child(5) {
  width: 150px;
}

.shareholder-cost-detail-table.is-payroll th:nth-child(1),
.shareholder-cost-detail-table.is-payroll td:nth-child(1) {
  width: 250px;
}

.shareholder-cost-detail-table.is-payroll th:nth-child(2),
.shareholder-cost-detail-table.is-payroll td:nth-child(2),
.shareholder-cost-detail-table.is-payroll th:nth-child(3),
.shareholder-cost-detail-table.is-payroll td:nth-child(3) {
  width: 190px;
}

.shareholder-cost-detail-table.is-payroll th:nth-child(4),
.shareholder-cost-detail-table.is-payroll td:nth-child(4),
.shareholder-cost-detail-table.is-payroll th:nth-child(5),
.shareholder-cost-detail-table.is-payroll td:nth-child(5) {
  width: 130px;
}

.shareholder-ticket-panel {
  max-width: 1220px;
}

.shareholder-ticket-groups {
  display: grid;
  gap: 18px;
}

.shareholder-ticket-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.shareholder-ticket-section.above {
  border-left: 5px solid var(--success);
}

.shareholder-ticket-section.below {
  border-left: 5px solid var(--medical-purple);
}

.shareholder-ticket-section-head {
  align-items: center;
  background: var(--soft);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.shareholder-ticket-section-head h3 {
  color: var(--brand-dark);
  font-size: 17px;
  margin: 0;
}

.shareholder-ticket-section-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.shareholder-average-divider {
  align-items: center;
  border-bottom: 2px solid var(--ampar-blue-dark);
  border-top: 2px solid var(--ampar-blue-dark);
  color: var(--brand-dark);
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 10px;
  text-align: center;
}

.shareholder-average-divider span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.shareholder-average-divider strong {
  font-size: 22px;
}

.shareholder-ticket-table {
  min-width: 0;
  table-layout: fixed;
}

.shareholder-ticket-table th,
.shareholder-ticket-table td {
  padding-left: 9px;
  padding-right: 9px;
}

.shareholder-ticket-table th:nth-child(1),
.shareholder-ticket-table td:nth-child(1) {
  width: 82px;
}

.shareholder-ticket-table th:nth-child(2),
.shareholder-ticket-table td:nth-child(2) {
  width: 230px;
}

.shareholder-ticket-table th:nth-child(3),
.shareholder-ticket-table td:nth-child(3) {
  width: 92px;
}

.shareholder-ticket-table th:nth-child(4),
.shareholder-ticket-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 250px;
}

.shareholder-ticket-table th:nth-child(5),
.shareholder-ticket-table td:nth-child(5),
.shareholder-ticket-table th:nth-child(6),
.shareholder-ticket-table td:nth-child(6) {
  width: 118px;
}

.shareholder-ticket-table th:nth-child(7),
.shareholder-ticket-table td:nth-child(7) {
  text-align: center;
  width: 96px;
}

.shareholder-ticket-table .small-action {
  min-height: 34px;
  padding: 8px 11px;
  white-space: nowrap;
}

.shareholder-ticket-diff {
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  padding: 5px 8px;
}

.shareholder-ticket-diff.positive {
  background: rgba(45, 212, 191, 0.16);
  color: var(--success);
}

.shareholder-ticket-diff.negative {
  background: rgba(255, 91, 91, 0.12);
  color: var(--danger);
}

.shareholder-bar-chart {
  min-height: 430px;
  overflow-x: auto;
  padding: 10px 0 4px;
}

.shareholder-area-chart-wrap {
  min-width: 920px;
}

.shareholder-area-chart {
  display: block;
  height: auto;
  width: 100%;
}

.shareholder-area-bg {
  fill: #fff;
  stroke: #d7dde3;
  stroke-width: 1;
}

.shareholder-area-title {
  fill: #7a7a7a;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
}

.shareholder-area-legend text {
  fill: #444;
  font-size: 10px;
}

.shareholder-area-legend .dia {
  fill: #4d72c9;
}

.shareholder-area-legend .venta {
  fill: #ff7a45;
}

.shareholder-area-legend .costo {
  fill: #a7a7a7;
}

.shareholder-area-legend .utilidad {
  fill: #ffb000;
}

.shareholder-area-grid-line {
  stroke: #d9d9d9;
  stroke-width: 1;
}

.shareholder-area-axis-label,
.shareholder-area-day-label {
  fill: #444;
  font-size: 11px;
}

.shareholder-area-fill {
  stroke: transparent;
}

.shareholder-area-fill.dia {
  fill: rgba(77, 114, 201, 0.35);
}

.shareholder-area-fill.venta {
  fill: url("#shareholderAreaVentaPattern");
}

.shareholder-area-fill.costo {
  fill: url("#shareholderAreaCostoPattern");
}

.shareholder-area-fill.utilidad {
  fill: url("#shareholderAreaUtilidadPattern");
}

.shareholder-area-line {
  fill: none;
  stroke-linejoin: round;
  stroke-width: 2;
}

.shareholder-area-line.dia {
  stroke: #4d72c9;
}

.shareholder-area-line.venta {
  stroke: #ff7a45;
}

.shareholder-area-line.costo {
  stroke: #a7a7a7;
}

.shareholder-area-line.utilidad {
  stroke: #ffb000;
}

.shareholder-area-value {
  fill: #3f3f3f;
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3px;
}

.shareholder-ai-card {
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.shareholder-ai-card h3 {
  color: var(--brand-dark);
  margin: 0 0 8px;
}

.shareholder-ai-card p {
  color: var(--muted);
  margin: 0 0 10px;
}

.shareholder-ai-card ul {
  color: var(--brand-dark);
  margin: 0;
  padding-left: 18px;
}

.shareholder-ai-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 14px;
}

.shareholder-ai-chat {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.shareholder-chat-message {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  padding: 12px;
}

.shareholder-chat-message strong {
  color: var(--brand-dark);
}

.shareholder-chat-message p {
  color: var(--muted);
  margin: 6px 0 0;
}

.map-kpi-head {
  margin: 8px 0 14px;
}

.map-kpi-head h2 {
  margin: 0 0 8px;
}

.map-executive-summary {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 18px;
}

.map-executive-summary .client-kpi-card {
  min-height: 148px;
}

.sat-panel {
  margin-bottom: 16px;
}

.production-panel {
  margin-bottom: 16px;
}

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

.sat-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.sat-grid strong {
  color: var(--brand-dark);
  font-size: 13px;
}

.sat-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
}

.mexico-map {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 440px;
  overflow: hidden;
}

.mexico-map svg {
  display: block;
  height: 100%;
  min-height: 440px;
  width: 100%;
}

.map-shape {
  fill: #d8e8f4;
  stroke: #9cb9cf;
  stroke-width: 3;
}

.secondary-shape {
  fill: #c7deef;
}

.map-point.has-clients {
  cursor: pointer;
}

.map-empty-point {
  fill: rgba(21, 84, 138, 0.26);
  stroke: #ffffff;
  stroke-width: 8;
}

.map-traffic-ring {
  fill: none;
  stroke-linecap: butt;
}

.map-traffic-outline {
  fill: none;
  stroke: #0f172a;
  stroke-linecap: butt;
}

.map-traffic-ring.inactive {
  filter: drop-shadow(0 6px 10px rgba(21, 84, 138, 0.22));
  stroke: #ef4444;
}

.map-traffic-ring.active {
  stroke: #00b86b;
}

.map-traffic-core {
  fill: #ffffff;
  stroke: #0c3f66;
  stroke-width: 3;
}

.map-point text {
  fill: #111827;
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  text-anchor: middle;
}

.map-ranking {
  display: grid;
  gap: 14px;
}

.map-city-ranking {
  margin-top: 14px;
}

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

.map-ranking section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.map-ranking h3 {
  color: var(--brand-dark);
  font-size: 13px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.geo-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.geo-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.geo-row-action {
  cursor: pointer;
}

.geo-row-action:hover strong,
.geo-row-action:focus strong {
  color: var(--brand);
}

.geo-row strong,
.geo-row span {
  display: block;
}

.geo-row span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--card-bg);
  border-color: var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

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

.panel h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

.form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.form-head p,
.form-note {
  color: var(--muted);
  line-height: 1.4;
  margin: 6px 0 0;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
}

legend {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

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

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

.hidden {
  display: none !important;
}

[hidden],
.access-hidden {
  display: none !important;
}

.autocomplete {
  position: relative;
  z-index: 60;
}

.autocomplete:focus-within,
.autocomplete.autocomplete-open {
  z-index: 520;
}

.autocomplete-list {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(8, 35, 63, 0.16);
  display: grid;
  left: 0;
  max-height: 380px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 540;
}

.autocomplete-option {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: auto;
  padding: 10px 12px;
  text-align: left;
}

.autocomplete-option:hover {
  background: var(--brand-soft);
}

.autocomplete-option strong {
  color: var(--brand-dark);
  font-size: 13px;
}

.autocomplete-option span,
.autocomplete-empty {
  color: var(--muted);
  font-size: 12px;
}

.autocomplete-empty {
  padding: 12px;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 40px;
}

.check-row input {
  width: auto;
}

.workday-grid {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px 12px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 300;
  min-height: 40px;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.search {
  max-width: none;
}

.table-list,
.stack,
.timeline {
  display: grid;
  gap: 10px;
}

.record {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

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

.record strong {
  display: block;
  font-weight: 600;
}

.record small,
.muted {
  color: var(--muted);
}

.status-ok {
  color: #087765;
}

.status-warn {
  color: var(--danger);
}

.status-pending {
  color: var(--brand);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 0 9px;
  white-space: nowrap;
}

.pill.warn {
  background: var(--medical-yellow-soft);
  color: #a15c00;
}

.pill.danger {
  background: var(--medical-red-soft);
  color: var(--danger);
}

.pill.ok {
  background: var(--medical-mint);
  color: #087765;
}

.pill.info {
  background: var(--medical-lavender);
  color: #4f3cc9;
}

.record-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.record-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.record-section {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.record-section h3 {
  color: var(--brand-dark);
  font-size: 13px;
  margin: 0 0 7px;
  text-transform: uppercase;
}

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

.detail-grid span,
.attachment-list span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.detail-grid strong,
.attachment-list a {
  color: var(--ink);
  font-size: 13px;
}

.vacation-policy {
  margin: 0 0 16px;
}

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

.vacation-policy-grid div {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.vacation-policy-grid span {
  color: var(--muted);
  font-size: 12px;
}

.vacation-policy-grid strong {
  color: var(--brand-dark);
  font-size: 15px;
}

.vacation-policy-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 10px 0 0;
}

.attachment-list {
  display: grid;
  gap: 7px;
}

.attachment-list a {
  text-decoration-color: var(--brand);
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  margin-bottom: 16px;
}

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

.directory-panel {
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.data-table thead {
  background: var(--ampar-blue-dark);
  color: #fff;
}

.data-table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 13px 16px;
  text-align: left;
  text-transform: uppercase;
}

.table-sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 6px;
  min-height: auto;
  padding: 0;
  text-transform: inherit;
}

.table-sort-button span {
  font-size: 13px;
  line-height: 1;
}

.data-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 300;
  padding: 13px 16px;
  vertical-align: top;
}

.data-table td strong {
  color: var(--ampar-blue-dark);
  font-weight: 600;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.table-action {
  align-items: center;
  background: #ffffff;
  border: 1px solid #b8cbdc;
  color: var(--brand);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
}

.table-action::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 6px;
  opacity: 0.58;
  width: 6px;
}

.table-action:hover {
  background: var(--medical-mint);
  color: var(--brand-dark);
}

.table-action-danger {
  border-color: #f1b8b1;
  color: var(--danger);
}

.table-action-danger:hover {
  background: #fde8e6;
  color: var(--danger);
}

.rh-master-approve-action {
  background: #0f9f6e;
  border-color: #0f9f6e;
  color: #ffffff;
  font-weight: 800;
}

.rh-master-approve-action:hover {
  background: #0b7f59;
  color: #ffffff;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ui-icon {
  display: block;
  fill: none;
  height: 1em;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 1em;
}

.hero-svg {
  height: 32px;
  width: 32px;
}

.kpi-svg {
  height: 22px;
  width: 22px;
}

.button-svg {
  height: 16px;
  width: 16px;
}

.icon-label-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
}

.executive-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(11, 63, 102, 0.96) 0%, rgba(21, 92, 146, 0.94) 50%, rgba(46, 196, 182, 0.9) 100%),
    radial-gradient(circle at 84% 22%, rgba(240, 237, 255, 0.34), transparent 26%);
  border: 1px solid rgba(234, 245, 255, 0.26);
  border-radius: 16px;
  box-shadow: 0 18px 38px rgba(11, 63, 102, 0.14);
  color: #ffffff;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 auto 20px;
  overflow: hidden;
  padding: 28px;
  position: relative;
  width: 100%;
}

.executive-hero::after {
  background: rgba(255, 255, 255, 0.12);
  content: "";
  height: 150%;
  position: absolute;
  right: 12%;
  top: -25%;
  transform: rotate(18deg);
  width: 42px;
}

.clients-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 56%, #2ec4b6 100%);
}

.products-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #1c78a6 52%, #21a7c9 100%);
}

.logistics-hero,
.deliveries-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 52%, #38b000 100%);
}

.quotes-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 52%, #7b61ff 100%);
}

.sales-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 52%, #38b000 100%);
}

.operations-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 52%, #21a7c9 100%);
}

.hr-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 50%, #7b61ff 100%);
}

.accounting-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 50%, #2ec4b6 100%);
}

.sales-hero.quotes-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 52%, #7b61ff 100%);
}

.sales-hero.deliveries-hero {
  background: linear-gradient(135deg, #0b3f66 0%, #155c92 52%, #38b000 100%);
}

.breadcrumb {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.hero-title-row {
  align-items: center;
  display: flex;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.hero-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  height: 64px;
  justify-content: center;
  width: 64px;
}

.executive-hero h1 {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.executive-hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
  margin: 8px 0 0;
  max-width: 760px;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.hero-action {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  display: inline-flex;
  justify-content: center;
}

.hero-action:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.client-kpi-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin: 0 auto 18px;
  width: 100%;
}

.catalog-kpi-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.catalog-kpi-card > div {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.client-kpi-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ampar-blue);
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(11, 63, 102, 0.1);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 138px;
  overflow: hidden;
  padding: 18px 14px;
  position: relative;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-kpi-card:hover {
  box-shadow: 0 20px 46px rgba(11, 63, 102, 0.14);
  transform: translateY(-2px);
}

.catalog-kpi-card .kpi-sparkline {
  align-items: flex-end;
  display: flex;
  gap: 3px;
  height: 24px;
  left: 14px;
  opacity: 0.62;
  position: absolute;
  top: 14px;
  width: 64px;
  z-index: 0;
}

.catalog-kpi-card .kpi-sparkline i {
  background: #8eb6d2;
  border-radius: 999px;
  display: block;
  flex: 1;
  min-width: 4px;
}

.catalog-kpi-card .kpi-sparkline i:nth-child(1) {
  height: 8px;
}

.catalog-kpi-card .kpi-sparkline i:nth-child(2) {
  height: 12px;
}

.catalog-kpi-card .kpi-sparkline i:nth-child(3) {
  height: 10px;
}

.catalog-kpi-card .kpi-sparkline i:nth-child(4) {
  height: 18px;
}

.catalog-kpi-card .kpi-sparkline i:nth-child(5) {
  height: 22px;
}

.catalog-kpi-card .kpi-sparkline.cost i,
.catalog-kpi-card.docs .kpi-sparkline i,
.catalog-kpi-card.next .kpi-sparkline i {
  background: #e5a13b;
}

.catalog-kpi-card.active .kpi-sparkline i,
.catalog-kpi-card.ok .kpi-sparkline i {
  background: #2ec4b6;
}

.catalog-kpi-card.risk .kpi-sparkline i,
.catalog-kpi-card.inactive .kpi-sparkline i {
  background: #ef6b6b;
}

.catalog-kpi-card.prospect .kpi-sparkline i {
  background: #8d7cff;
}

.catalog-kpi-card .kpi-icon,
.catalog-kpi-card > div {
  position: relative;
  z-index: 1;
}

.catalog-kpi-card .kpi-trend {
  color: #4c6378;
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.catalog-kpi-card .kpi-trend.up {
  color: #008a74;
}

.catalog-kpi-card .kpi-trend.down {
  color: #cf3d3d;
}

.kpi-icon {
  align-items: center;
  background: var(--ampar-blue-light);
  border-radius: 999px;
  color: var(--brand);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.client-kpi-card strong {
  color: var(--brand-dark);
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
}

.client-kpi-card span:not(.kpi-icon) {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}

.client-kpi-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.35;
}

.client-kpi-card.active .kpi-icon {
  background: var(--medical-mint);
  color: #087765;
}

.client-kpi-card.active {
  border-left-color: var(--medical-turquoise);
}

.client-kpi-card.prospect .kpi-icon {
  background: var(--medical-lavender);
  color: var(--medical-purple);
}

.client-kpi-card.prospect {
  border-left-color: var(--medical-purple);
}

.client-kpi-card.docs .kpi-icon,
.client-kpi-card.next .kpi-icon {
  background: var(--medical-yellow-soft);
  color: #a15c00;
}

.client-kpi-card.docs {
  border-left-color: var(--medical-orange);
}

.client-kpi-card.next {
  border-left-color: var(--medical-cyan);
}

.client-kpi-card.risk .kpi-icon {
  background: var(--medical-red-soft);
  color: var(--danger);
}

.client-kpi-card.risk {
  border-left-color: var(--medical-red);
}

#dashboardCorp .client-kpi-card {
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(11, 63, 102, 0.08);
  isolation: isolate;
  min-height: 138px;
  overflow: hidden;
  padding: 16px 14px 14px;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#dashboardCorp .client-kpi-card:hover {
  box-shadow: 0 18px 42px rgba(11, 63, 102, 0.12);
  transform: translateY(-2px);
}

#dashboardCorp .client-kpi-card .kpi-icon {
  height: 42px;
  margin-top: 4px;
  width: 42px;
}

#dashboardCorp .client-kpi-card strong {
  font-size: 30px;
  letter-spacing: 0;
}

#dashboardCorp .client-kpi-card small {
  color: #5d7187;
}

#dashboardCorp .client-kpi-card .kpi-label {
  color: var(--ink);
  font-size: 13px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline {
  align-items: flex-end;
  display: flex;
  font-size: 0;
  gap: 3px;
  height: 22px;
  left: 12px;
  opacity: 0.72;
  position: absolute;
  top: 12px;
  width: 58px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline i {
  background: #8fb7d6;
  border-radius: 999px 999px 2px 2px;
  display: block;
  width: 8px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline i:nth-child(1) {
  height: 7px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline i:nth-child(2) {
  height: 10px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline i:nth-child(3) {
  height: 13px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline i:nth-child(4) {
  height: 17px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline i:nth-child(5) {
  height: 21px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline.cost i {
  background: #e5a13b;
}

#dashboardCorp .client-kpi-card .kpi-sparkline.cost i:nth-child(2) {
  height: 15px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline.cost i:nth-child(4) {
  height: 12px;
}

#dashboardCorp .client-kpi-card .kpi-sparkline.neutral i {
  background: #c4d8e8;
}

#dashboardCorp .client-kpi-card .kpi-sparkline.neutral i:nth-child(1),
#dashboardCorp .client-kpi-card .kpi-sparkline.neutral i:nth-child(2),
#dashboardCorp .client-kpi-card .kpi-sparkline.neutral i:nth-child(3),
#dashboardCorp .client-kpi-card .kpi-sparkline.neutral i:nth-child(4),
#dashboardCorp .client-kpi-card .kpi-sparkline.neutral i:nth-child(5) {
  height: 13px;
}

#dashboardCorp .client-kpi-card .kpi-trend {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  justify-content: center;
  justify-self: center;
  padding: 3px 8px;
  width: max-content;
}

#dashboardCorp .client-kpi-card .kpi-trend.up {
  background: #e6fbf5;
  color: #087765;
}

#dashboardCorp .client-kpi-card .kpi-trend.down {
  background: #ffecec;
  color: #cf3d3d;
}

#dashboardCorp .client-kpi-card .kpi-trend.flat {
  background: #eef6fd;
  color: #2b678d;
}

.client-filter-panel {
  margin: 0 auto 18px;
}

.catalog-filter-panel,
.catalog-directory-panel {
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(11, 63, 102, 0.07);
}

.panel-head.compact {
  margin-bottom: 10px;
}

.client-filter-grid {
  display: grid;
  align-items: end;
  gap: 14px;
  grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto;
}

.client-filter-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.client-filter-grid input,
.client-filter-grid select {
  margin-top: 6px;
  width: 100%;
}

.client-filter-actions {
  align-items: end;
  display: flex;
  gap: 8px;
}

.catalog-filter-actions {
  min-width: 210px;
}

.client-directory-panel {
  border-radius: 16px;
}

.client-pagination {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 12px;
  justify-content: flex-end;
  padding: 10px 0;
}

.client-pagination-top {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.client-pagination-bottom {
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

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

.client-pagination-controls label {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 6px;
  margin: 0;
}

.client-pagination-controls input {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 34px;
  padding: 0 6px;
  text-align: center;
  width: 58px;
}

.pagination-arrow {
  font-size: 20px;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
}

.pagination-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.client-table {
  min-width: 1180px;
}

.catalog-table {
  min-width: 1280px;
}

.sales-kpi-grid {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
}

.sales-filter-grid {
  grid-template-columns: minmax(260px, 1.5fr) repeat(5, minmax(145px, 1fr)) auto;
}

.sales-table {
  min-width: 1360px;
}

.operations-kpi-grid {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
}

.operations-filter-grid {
  grid-template-columns: minmax(260px, 1.5fr) repeat(6, minmax(140px, 1fr)) auto;
}

.operations-table {
  min-width: 1360px;
}

.sales-actions {
  max-width: 280px;
}

.client-table thead {
  background: var(--ampar-blue-dark);
}

.client-table th {
  padding: 14px 16px;
}

.client-table td {
  background: #ffffff;
  font-weight: 300;
  padding: 14px 16px;
}

.client-table tbody tr:hover td {
  background: var(--ampar-blue-light);
}

.client-avatar {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 8px 18px rgba(21, 84, 138, 0.22);
  color: #ffffff;
}

.client-actions .table-action {
  min-height: 30px;
  padding: 0 10px;
}

.quote-items {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
}

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

.mini-table th {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  padding: 10px;
  text-align: left;
  text-transform: uppercase;
}

.mini-table td {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  padding: 10px;
  vertical-align: top;
}

.quote-qty-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  height: 34px;
  max-width: 88px;
  padding: 0 8px;
  text-align: center;
  width: 100%;
}

.quote-qty-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 84, 138, 0.12);
  outline: none;
}

.quote-total {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.quote-total span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quote-total strong {
  color: var(--brand-dark);
  font-size: 22px;
}

.entity-cell {
  align-items: center;
  display: flex;
  gap: 10px;
}

.avatar {
  align-items: center;
  background: var(--brand);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.subtext {
  color: var(--text-muted);
  display: block;
  font-size: 12px;
  font-weight: 300;
  margin-top: 3px;
}

.credential-text {
  color: var(--brand-dark);
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
}

.mini-costs {
  display: grid;
  gap: 4px;
}

.modal {
  display: none;
  inset: 0;
  position: fixed;
  z-index: 20;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  background: rgba(14, 30, 41, 0.48);
  inset: 0;
  position: absolute;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(11, 63, 102, 0.22);
  display: grid;
  gap: 16px;
  left: 50%;
  max-height: calc(100vh - 48px);
  max-width: 980px;
  overflow: auto;
  padding: 22px;
  position: absolute;
  top: 24px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 32px));
}

.modal-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.modal-head h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 3px 0 0;
}

.modal-form {
  display: none;
}

.modal-form.active {
  display: grid;
}

.modal-open {
  overflow: hidden;
}

.quote-document-panel {
  max-width: 1040px;
}

.location-clients-panel {
  max-width: 1120px;
}

.location-clients-table {
  overflow-x: auto;
}

.location-clients-table .data-table {
  min-width: 920px;
}

.location-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.location-filter {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
}

.location-filter.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #ffffff;
}

.location-filter span {
  font-weight: 800;
}

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

.quote-document-preview {
  background: #f3f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.traceability-panel {
  max-width: 1040px;
}

.traceability-preview {
  background: #f3f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.traceability-summary {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px;
}

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

.traceability-sheet {
  background:
    radial-gradient(circle at 16% 20%, rgba(17, 87, 138, 0.06), transparent 24%),
    repeating-linear-gradient(16deg, rgba(11, 53, 88, 0.035) 0 1px, transparent 1px 26px),
    #fbf7e9;
  border: 1px solid #c6d5df;
  border-radius: 8px;
  color: #111827;
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1100px;
  overflow: hidden;
  padding: 22px;
  position: relative;
  width: 100%;
}

.traceability-watermark {
  inset: 230px auto auto 22%;
  opacity: 0.11;
  pointer-events: none;
  position: absolute;
  width: 58%;
  z-index: 0;
}

.traceability-sheet > *:not(.traceability-watermark) {
  position: relative;
  z-index: 1;
}

.traceability-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.traceability-main-logo {
  height: 92px;
  object-fit: contain;
  object-position: left center;
  width: 300px;
}

.traceability-title {
  text-align: right;
}

.traceability-title h3 {
  color: #111827;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 8px;
}

.traceability-title span {
  color: #111827;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.traceability-rule {
  background: #0b3558;
  height: 8px;
  margin-top: -2px;
}

.traceability-certificate-grid {
  display: grid;
  gap: 22px 34px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.traceability-section h4 {
  color: #111827;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 16px;
}

.traceability-detail {
  background: transparent;
  border: 0;
  min-height: auto;
  padding: 0;
}

.traceability-detail span {
  color: #111827;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  margin-bottom: 4px;
  text-transform: none;
}

.traceability-detail strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.35;
}

.traceability-two-col {
  display: grid;
  gap: 16px 28px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.traceability-state {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.traceability-state b {
  background: #23a455;
  border-radius: 999px;
  display: inline-block;
  height: 16px;
  position: relative;
  width: 16px;
}

.traceability-state b::after {
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  content: "";
  height: 7px;
  left: 5px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg);
  width: 4px;
}

.traceability-auth {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 120px 100px 140px;
  justify-content: end;
}

.traceability-auth > div:first-child {
  text-align: center;
}

.traceability-auth > div:first-child > span {
  color: #111827;
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.traceability-auth .traceability-detail {
  grid-column: 1 / -1;
}

.traceability-qr {
  background: #ffffff;
  border: 5px solid #ffffff;
  box-shadow: 0 2px 10px rgba(8, 43, 76, 0.12);
  display: grid;
  height: 92px;
  margin: 0 auto;
  place-items: center;
  width: 92px;
}

.traceability-qr img {
  display: block;
  height: 100%;
  image-rendering: crisp-edges;
  object-fit: contain;
  width: 100%;
}

.traceability-seal {
  aspect-ratio: 1;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(8, 43, 76, 0.16));
  object-fit: contain;
  width: 92px;
}

.traceability-sign {
  color: #111827;
  display: grid;
  gap: 5px;
  justify-items: center;
  text-align: center;
}

.traceability-sign span {
  border-bottom: 1px solid #111827;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
  padding: 0 10px 4px;
  width: 100%;
}

.traceability-sign small {
  color: #111827;
}

.traceability-notes {
  align-items: center;
  border: 1px solid #1d3a5a;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 230px;
  min-height: 92px;
  padding: 16px 20px;
}

.traceability-notes strong {
  color: #111827;
  font-size: 15px;
}

.traceability-notes p {
  color: #111827;
  font-size: 17px;
  margin: 12px 0 0;
}

.traceability-notes img {
  height: 64px;
  object-fit: contain;
  width: 220px;
}

.traceability-sheet footer {
  color: #111827;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.quote-sheet {
  background: #ffffff;
  border: 1px solid #d7e2ec;
  border-radius: 8px;
  color: var(--ink);
  margin: 0 auto;
  max-width: 860px;
  min-height: 960px;
  padding: 38px;
}

.quote-sheet-head {
  align-items: flex-start;
  border-bottom: 3px solid var(--brand);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
}

.quote-sheet-logo {
  height: 78px;
  object-fit: contain;
  width: 190px;
}

.quote-sheet-title {
  text-align: right;
}

.quote-sheet-title h3 {
  color: var(--brand-dark);
  font-size: 28px;
  margin: 0;
}

.quote-sheet-title span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.quote-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}

.quote-sheet-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.quote-sheet-box h4,
.quote-sheet-notes h4 {
  color: var(--brand-dark);
  font-size: 13px;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.quote-sheet-box p {
  margin: 4px 0;
}

.quote-sheet table {
  border-collapse: collapse;
  width: 100%;
}

.quote-sheet th {
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  padding: 10px;
  text-align: left;
  text-transform: uppercase;
}

.quote-sheet td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 10px;
  vertical-align: top;
}

.quote-sheet-total {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 18px;
}

.quote-sheet-total span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.quote-sheet-total strong {
  color: var(--brand-dark);
  font-size: 28px;
}

.quote-sheet-notes {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}

.quote-sheet-footer {
  color: var(--muted);
  font-size: 12px;
  margin-top: 34px;
  text-align: center;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

#miRh .mi-rh-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  width: 100%;
}

#miRh .mi-rh-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  padding: 24px;
  width: 100%;
}

#miRh .mi-rh-section-header {
  display: grid;
  gap: 8px;
  margin: 0;
}

#miRh .mi-rh-section-header h2 {
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

#miRh .mi-rh-section-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

#miRh .mi-rh-content,
#miRh .mi-rh-table-wrap {
  min-width: 0;
  overflow-x: auto;
  width: 100%;
}

#miRh .mi-rh-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

#miRh .mi-rh-summary-card {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
}

#miRh .mi-rh-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

#miRh .mi-rh-summary-card strong {
  color: var(--brand-dark);
  font-size: 20px;
}

#miRh .mi-rh-summary-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#miRh .mi-rh-form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0;
}

#miRh .mi-rh-form-grid label {
  display: grid;
  gap: 6px;
}

#miRh .mi-rh-form-grid .wide,
#miRh .mi-rh-form-actions {
  grid-column: 1 / -1;
}

#miRh .mi-rh-form-actions {
  display: flex;
  justify-content: flex-start;
}

#miRh .mi-rh-attendance-card {
  display: grid;
  gap: 16px;
}

#miRh .mi-rh-attendance-status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

#miRh .mi-rh-attendance-status-grid article {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
}

#miRh .mi-rh-attendance-status-grid span {
  color: var(--muted);
  font-size: 12px;
}

#miRh .mi-rh-attendance-status-grid strong {
  color: var(--brand-dark);
  font-size: 20px;
}

#miRh .mi-rh-attendance-status-grid small {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 2px;
  line-height: 1.35;
}

#miRh .mi-rh-attendance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

#miRh .mi-rh-attendance-button {
  border: 0 !important;
  border-radius: 12px;
  color: #ffffff !important;
  font-size: 22px;
  font-weight: 800;
  min-height: 140px;
  min-width: 280px;
  padding: 0 34px;
  box-shadow: 0 12px 24px rgba(8, 35, 63, 0.14);
}

#miRh .mi-rh-attendance-entry {
  background: #00a94f !important;
}

#miRh .mi-rh-attendance-entry:hover {
  background: #008a40 !important;
}

#miRh .mi-rh-attendance-exit {
  background: #d93a3a !important;
}

#miRh .mi-rh-attendance-exit:hover {
  background: #b72828 !important;
}

#miRh .mi-rh-attendance-button:disabled {
  background: #9fb3c1 !important;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

#miRh .managed-attendance-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) 1fr;
  margin-bottom: 16px;
}

#miRh .managed-attendance-toolbar label {
  display: grid;
  gap: 6px;
}

#miRh .managed-attendance-toolbar .wide {
  min-width: 280px;
}

#miRh .managed-attendance-table button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

#miRh .managed-absence-actions {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

#miRh .managed-absence-justified {
  border-color: #f3c56e;
  color: #9a6400;
}

#miRh .managed-absence-justified:hover {
  background: #fff3d8;
  color: #7a4f00;
}

#miRh .managed-absence-incapacity {
  border-color: #6bb6d6;
  color: #0e668b;
}

#miRh .managed-absence-incapacity:hover {
  background: #e7f7fd;
  color: #0c5574;
}

#miRh .mi-rh-table-wrap table {
  min-width: 820px;
}

#miRh .org-chart-shell {
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  width: 100%;
}

#miRh .org-focus-chart {
  align-items: center;
  background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  justify-items: center;
  min-height: 380px;
  padding: 26px;
}

#miRh .org-focus-title {
  color: var(--brand-dark);
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  text-align: center;
}

#miRh .org-focus-title strong {
  font-size: 20px;
}

#miRh .org-focus-title span {
  color: var(--muted);
  font-size: 12px;
}

#miRh .org-lineage,
#miRh .org-current-level {
  align-items: center;
  display: grid;
  justify-items: center;
  width: 100%;
}

#miRh .org-level {
  display: grid;
  justify-items: center;
}

#miRh .org-connector {
  background: #b9d5e6;
  display: block;
  height: 28px;
  margin: 0 auto;
  width: 2px;
}

#miRh .org-connector.muted {
  opacity: 0.35;
}

#miRh .org-report-tree,
#miRh .org-report-tree ul {
  display: flex;
  gap: 18px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

#miRh .org-report-tree {
  align-items: flex-start;
  border-top: 2px solid #b9d5e6;
  padding-top: 22px;
  position: relative;
  width: max-content;
}

#miRh .org-report-item {
  display: grid;
  justify-items: center;
  min-width: 190px;
  position: relative;
}

#miRh .org-report-item::before {
  background: #b9d5e6;
  content: "";
  height: 22px;
  left: 50%;
  position: absolute;
  top: -22px;
  width: 2px;
}

#miRh .org-report-item ul {
  border-top: 2px solid #d7e7f2;
  margin-top: 20px;
  padding-top: 20px;
  position: relative;
}

#miRh .org-report-item ul .org-report-item::before {
  background: #d7e7f2;
}

#miRh .org-tree,
#miRh .org-tree ul {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#miRh .org-tree ul {
  border-left: 2px solid #d7e7f2;
  margin-left: 22px;
  padding-left: 18px;
}

#miRh .org-tree-item {
  min-width: 0;
  position: relative;
}

#miRh .org-tree ul .org-tree-item::before {
  background: #d7e7f2;
  content: "";
  height: 2px;
  left: -18px;
  position: absolute;
  top: 31px;
  width: 18px;
}

#miRh .org-card {
  align-items: center;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 14px 16px;
  width: 100%;
}

#miRh .org-focus-card {
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(8, 35, 63, 0.08);
  min-width: 260px;
  width: auto;
}

#miRh .org-card.current {
  background: #eefbf8;
  border-color: #80cbc4;
  border-left-color: #26a69a;
}

#miRh .org-avatar {
  height: 40px;
  width: 40px;
}

#miRh .org-card strong,
#miRh .org-card span,
#miRh .org-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

#miRh .org-card strong {
  color: var(--brand-dark);
  font-size: 14px;
}

#miRh .org-card span {
  color: #1f4667;
  font-size: 13px;
  margin-top: 3px;
}

#miRh .org-card small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

#miRh .org-card em {
  background: #eef6fc;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  max-width: 190px;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  text-align: center;
}

/* Organigrama completo de la empresa (arbol vertical, de arriba hacia abajo) */
#miRh .corg-scroll {
  overflow-x: auto;
  padding: 4px 4px 16px;
  width: 100%;
}

#miRh .corg-legend {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
}

#miRh .corg-legend strong {
  color: var(--brand-dark);
  font-size: 16px;
}

#miRh .corg-legend span {
  color: var(--muted);
  font-size: 12px;
}

#miRh .corg-tree,
#miRh .corg-children {
  display: flex;
  flex-direction: row;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

#miRh .corg-tree {
  margin: 0 auto;
  width: max-content;
}

#miRh .corg-item {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  position: relative;
}

#miRh .corg-node {
  position: relative;
}

/* Linea vertical que baja del nodo padre hacia sus subordinados */
#miRh .corg-item.has-children > .corg-node {
  margin-bottom: 24px;
}

#miRh .corg-item.has-children > .corg-node::after {
  background: #c7d5e0;
  content: "";
  height: 24px;
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  width: 2px;
}

/* Tramo vertical que sube de cada hijo hacia la barra horizontal */
#miRh .corg-children > .corg-item {
  padding-top: 24px;
}

#miRh .corg-children > .corg-item::before {
  background: #c7d5e0;
  content: "";
  height: 24px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
}

/* Barra horizontal que une a los hermanos */
#miRh .corg-children > .corg-item::after {
  background: #c7d5e0;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

#miRh .corg-children > .corg-item:first-child::after {
  left: 50%;
}

#miRh .corg-children > .corg-item:last-child::after {
  right: 50%;
}

#miRh .corg-children > .corg-item:only-child::after {
  display: none;
}

#miRh .corg-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(8, 35, 63, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 0 0;
  width: 172px;
}

#miRh .corg-card.current {
  box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.55), 0 10px 24px rgba(8, 35, 63, 0.12);
}

#miRh .corg-photo {
  align-items: center;
  background: #eef4f8;
  border: 3px solid var(--branch, #2ba3a0);
  border-radius: 50%;
  color: var(--branch, #2ba3a0);
  display: flex;
  font-size: 20px;
  font-weight: 700;
  height: 68px;
  justify-content: center;
  object-fit: cover;
  width: 68px;
}

#miRh .corg-labels {
  margin-top: 12px;
  width: 100%;
}

#miRh .corg-name {
  background: var(--brand-dark, #0e2f4d);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  text-align: center;
}

#miRh .corg-role {
  background: var(--branch, #2ba3a0);
  color: #ffffff;
  font-size: 11.5px;
  overflow-wrap: anywhere;
  padding: 6px 10px;
  text-align: center;
}

@media (max-width: 1200px) {
  #dashboardCorp .corp-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  #dashboardCorp .corp-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  #miRh .mi-rh-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #miRh .mi-rh-section {
    padding: 18px;
  }

  #miRh .mi-rh-summary,
  #miRh .mi-rh-form-grid,
  .workday-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #miRh .org-focus-chart {
    align-items: stretch;
    justify-items: stretch;
    min-height: 0;
    padding: 18px;
  }

  #miRh .org-report-tree,
  #miRh .org-report-tree ul {
    display: grid;
    gap: 14px;
    width: 100%;
  }

  #miRh .org-report-tree,
  #miRh .org-report-item ul {
    border-top: 0;
    padding-top: 0;
  }

  #miRh .org-report-item::before {
    display: none;
  }

  #miRh .org-tree ul {
    margin-left: 14px;
    padding-left: 14px;
  }

  #miRh .org-tree ul .org-tree-item::before {
    left: -14px;
    width: 14px;
  }

  #miRh .org-card,
  #miRh .org-focus-card {
    align-items: flex-start;
    grid-template-columns: 40px minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }

  #miRh .org-card em {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.highlight-row {
  background: rgba(38, 166, 154, 0.12);
}

.inline-select {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  min-width: 240px;
}

.rh-assist-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rh-assist-card {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.rh-assist-card strong {
  color: var(--brand-dark);
}

.rh-assist-card span,
.rh-assist-card small {
  color: var(--muted);
  font-size: 12px;
}

.security-table th,
.security-table td {
  text-align: center;
}

.security-table th:first-child,
.security-table th:nth-child(2),
.security-table td:first-child,
.security-table td:nth-child(2) {
  text-align: left;
}

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

.security-edit-notice {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.security-edit-notice strong {
  color: var(--brand-dark);
}

.security-edit-notice span {
  color: var(--muted);
  font-size: 12px;
}

.vacation-notice-panel {
  max-width: min(760px, calc(100vw - 32px));
}

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

.vacation-notice-summary > div,
.vacation-notice-message {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.vacation-notice-summary span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.vacation-notice-summary strong {
  color: var(--brand-dark);
  display: block;
}

.vacation-notice-message {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.vacation-notice-message p {
  margin: 0;
}

.vacation-notice-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.security-tabs-panel {
  padding: 14px;
}

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

.security-tab-button {
  background: #f7fbfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 44px;
  padding: 10px 14px;
}

.security-tab-button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 84, 128, 0.16);
}

.security-tab-panel {
  display: none;
}

.security-tab-panel.active {
  display: grid;
  gap: 16px;
}

.security-assignment-filter {
  margin-bottom: 14px;
}

.rh-vacation-tabs {
  margin-bottom: 14px;
}

.rh-vacation-filter {
  margin-bottom: 14px;
}

.rh-announcement-filter {
  margin-bottom: 14px;
}

.rh-birthday-grid {
  display: grid;
  gap: 18px;
}

.rh-birthday-table-block {
  overflow-x: auto;
}

.rh-birthday-table-block h3 {
  color: var(--ampar-blue-dark);
  font-size: 16px;
  margin: 0 0 10px;
}

.rh-birthday-table {
  min-width: 760px;
}

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

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

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

  .nav-group {
    min-width: 0;
  }

  .subnav {
    margin-left: 0;
  }

  .metrics,
  .split,
  .client-layout,
  .map-layout,
  .map-city-grid,
  .map-executive-summary,
  .client-kpi-grid,
  .client-filter-grid,
  .sat-grid,
  .traceability-summary,
  .traceability-certificate-grid,
  .traceability-two-col,
  .traceability-notes,
  .dashboard-grid,
  .corp-kpi-grid,
  .corp-filter-grid,
  .corp-dashboard-grid,
  .corp-breakdown-grid,
  .shareholder-summary-grid,
  .shareholder-grid,
  .shareholder-ai-form,
  #miRh .mi-rh-attendance-status-grid {
    grid-template-columns: 1fr;
  }

  .traceability-head,
  .traceability-auth {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .traceability-head {
    display: grid;
  }

  .traceability-title {
    text-align: left;
  }

  .traceability-title h3 {
    font-size: 24px;
  }

  .traceability-main-logo,
  .traceability-notes img {
    width: 220px;
  }

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

  .shareholder-deposit-head {
    align-items: flex-start;
    display: grid;
  }

  .shareholder-sales-card,
  .shareholder-cost-card,
  .shareholder-profit-card,
  .shareholder-secondary-card,
  .shareholder-lab-sales-card,
  .shareholder-cost-kpi-card,
  .shareholder-utility-kpi-card {
    grid-column: auto;
  }

  .vacation-notice-summary {
    grid-template-columns: 1fr;
  }

  .corp-filter-grid .filter-actions {
    align-items: stretch;
    display: grid;
  }

  #miRh .managed-attendance-toolbar {
    grid-template-columns: 1fr;
  }

  #miRh .managed-attendance-toolbar .wide {
    min-width: 0;
  }

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

  .executive-hero {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 18px;
  }

  .topbar,
  .panel-head,
  .record-head {
    display: grid;
  }

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

  .map-executive-summary {
    grid-template-columns: 1fr 1fr;
  }

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

  .nav-group {
    grid-column: 1 / -1;
  }

  .form-grid,
  .detail-grid,
  .vacation-policy-grid,
  .traceability-summary {
    grid-template-columns: 1fr;
  }

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

  .executive-hero {
    padding: 20px;
  }

  .hero-title-row {
    align-items: flex-start;
  }

  .hero-actions,
  .client-filter-actions,
  .client-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .hero-actions button,
  .client-filter-actions button,
  .client-actions button {
    width: 100%;
  }

  .client-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  body {
    background: #ffffff;
    display: block;
  }

  .sidebar,
  .topbar,
  .app,
  .modal-backdrop,
  .modal-head,
  .quote-document-actions {
    display: none !important;
  }

  .modal,
  .modal.open,
  .traceability-panel {
    display: block !important;
    inset: auto;
    position: static;
  }

  .traceability-panel {
    box-shadow: none;
    max-height: none;
    max-width: none;
    padding: 0;
    transform: none;
    width: auto;
  }

  .traceability-preview {
    background: #ffffff;
    border: 0;
    padding: 0;
  }

  .traceability-summary {
    display: none;
  }

  .traceability-sheet {
    border: 0;
    break-after: page;
    max-width: none;
  }
}

.salary-security-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f7fbff;
  color: var(--muted);
  font-size: 0.86rem;
}

.salary-protected-field input:disabled {
  background: #f3f7fb;
  color: var(--muted);
  cursor: not-allowed;
}

.rfm-stack-row {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 12px 14px;
}

.rfm-stack-row[ondblclick] {
  cursor: pointer;
}

.rfm-table th:nth-child(7),
.rfm-table td:nth-child(7),
.rfm-table th:nth-child(8),
.rfm-table td:nth-child(8) {
  max-width: 220px;
}

.rfm-modal-panel {
  max-width: min(1120px, calc(100vw - 32px));
}

.alert-modal-overlay {
  inset: 0;
  isolation: isolate;
  position: fixed;
  z-index: 5000;
}

.alert-modal-overlay .modal-backdrop {
  position: fixed;
  z-index: 0;
}

.alert-modal-overlay .modal-panel {
  position: fixed;
  z-index: 1;
}

.alert-table th:nth-child(6),
.alert-table td:nth-child(6) {
  max-width: 360px;
}

.alert-recommendation-cell {
  line-height: 1.45;
  white-space: normal;
}

.alert-actions {
  min-width: 220px;
}

.rfm-conversation-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.rfm-conversation-entry {
  background: #f7fbff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.rfm-conversation-entry-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rfm-conversation-entry p {
  line-height: 1.5;
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.rfm-conversation-entry span,
.rfm-conversation-entry strong {
  display: block;
}

.rfm-detail-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.rfm-detail-summary article {
  background: #f7fbff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.rfm-detail-summary span,
.rfm-detail-summary strong {
  display: block;
}

.inner-panel {
  margin: 14px 0 0;
}

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

.embedded-panel {
  margin: 0;
}

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

.delivery-ai-note {
  background: #f7fbff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.delivery-ai-note.warn {
  border-left: 4px solid #f59e0b;
}

.delivery-ai-note strong,
.delivery-ai-note span {
  display: block;
}

.delivery-ai-note p {
  margin: 8px 0;
}

.inventory-products-table th:nth-child(2),
.inventory-products-table td:nth-child(2),
.inventory-products-table th:nth-child(8),
.inventory-products-table td:nth-child(8) {
  width: 110px;
}

.inventory-products-table th:nth-child(3),
.inventory-products-table td:nth-child(3),
.inventory-products-table th:nth-child(4),
.inventory-products-table td:nth-child(4),
.inventory-products-table th:nth-child(5),
.inventory-products-table td:nth-child(5) {
  width: 96px;
}

.inventory-products-table th:nth-child(6),
.inventory-products-table td:nth-child(6) {
  max-width: 260px;
}

.inventory-products-table th:nth-child(7),
.inventory-products-table td:nth-child(7),
.inventory-products-table th:nth-child(9),
.inventory-products-table td:nth-child(9) {
  width: 145px;
}

.corp-rh-business-row td {
  background: #eef7fc;
  border-top: 1px solid var(--border);
  color: #0b4a70;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

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

  .rfm-stack-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =========================================================================
   Refinamiento visual corporativo (paleta unificada, sombras, jerarquia)
   Anexado al final: honra el sistema existente y gana por orden de cascada.
   ========================================================================= */

/* Punto 5 — Sombras mas suaves y "flotantes" + subtitulo en gris mas claro */
.client-kpi-card {
  box-shadow: 0 10px 30px rgba(13, 40, 72, 0.06), 0 1px 2px rgba(13, 40, 72, 0.04);
}
.client-kpi-card:hover {
  box-shadow: 0 16px 40px rgba(13, 40, 72, 0.10);
}
#dashboardCorp .client-kpi-card {
  box-shadow: 0 10px 30px rgba(13, 40, 72, 0.06), 0 1px 2px rgba(13, 40, 72, 0.04);
}
#dashboardCorp .client-kpi-card:hover {
  box-shadow: 0 16px 40px rgba(13, 40, 72, 0.10);
}
.client-kpi-card small {
  color: #93a2b3;
  font-weight: 300;
}

/* Punto 1 — Paleta unificada: navy por defecto; color solo con proposito
   (verde = salud, rojo = riesgo, ambar = costo/pendiente). Neutraliza morado y cian. */
.client-kpi-card.prospect,
.client-kpi-card.next {
  border-left-color: var(--ampar-blue);
}
.client-kpi-card.prospect .kpi-icon,
.client-kpi-card.next .kpi-icon {
  background: var(--ampar-blue-light);
  color: var(--brand);
}
.catalog-kpi-card.prospect .kpi-sparkline i,
.catalog-kpi-card.next .kpi-sparkline i {
  background: #9db8d4;
}

/* Punto 4 — Logo con mas aire + estado activo con mejor contraste */
.sidebar {
  padding: 28px 18px;
}
.brand {
  margin-bottom: 26px;
}
.brand-logo {
  padding: 0;
}
.nav-item.active,
.nav-item.is-active,
.nav-group.active .nav-parent,
.nav-group.is-active .nav-parent {
  background: linear-gradient(90deg, #1f77bf, #2f93d6);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(20, 92, 150, 0.45);
}
.subnav-item.active,
.subnav-item.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* Punto 2 — Jerarquia de controles: dropdown "Opciones de Cierre" */
.corp-close-menu {
  display: inline-flex;
  position: relative;
}
.corp-close-menu-btn {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}
.corp-close-caret {
  font-size: 11px;
  transition: transform 0.15s ease;
}
.corp-close-menu.open .corp-close-caret {
  transform: rotate(180deg);
}
.corp-close-menu-list {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(13, 40, 72, 0.14);
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 214px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
}
.corp-close-menu.open .corp-close-menu-list {
  display: flex;
}
.corp-close-menu-list .secondary {
  background: transparent;
  border: 0;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}
.corp-close-menu-list .secondary:hover {
  background: var(--ampar-blue-light);
}

/* =========================================================================
   Homogenizacion del sistema — consistencia de componentes en TODOS los modulos
   ========================================================================= */

/* Foco visible, accesible y uniforme (solo con teclado) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Botones de accion: radio, transicion y estados uniformes */
.primary,
.secondary,
.danger-button {
  border-radius: 9px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(11, 63, 102, 0.18);
}
.primary:hover {
  background: var(--brand-dark);
}
.primary:active,
.secondary:active {
  transform: translateY(1px);
}
.secondary {
  background: #f7fbff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.secondary:hover {
  background: var(--ampar-blue-light);
  border-color: #b8cbdc;
}

/* Campos de formulario: radio y foco uniformes */
input,
select,
textarea {
  border-radius: 9px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 102, 166, 0.14);
  outline: none;
}

/* Tablas: hover de fila consistente en TODOS los modulos (no solo clientes) */
.data-table tbody tr:hover td {
  background: var(--ampar-blue-light);
}

/* Acciones en tabla: radio uniforme */
.table-action {
  border-radius: 8px;
}

/* Paneles: sombra suave y uniforme en todo el sistema */
.panel {
  box-shadow: 0 10px 30px rgba(13, 40, 72, 0.06), 0 1px 2px rgba(13, 40, 72, 0.04);
}

/* Tipografia Inter: renderizado nitido + numerales tabulares alineados */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.client-kpi-card strong,
.data-table td,
.data-table th {
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Rebranding de color — azul #75A4C9 en superficies de FONDO azul.
   Los elementos de fondo claro se conservan. Texto sobre azul -> azul oscuro.
   ========================================================================= */

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #75a4c9 0%, #6b9cc2 100%);
  color: #0a2a45;
}
.brand small {
  color: #0a2a45;
}
.nav-item {
  color: #0a2a45;
}
.subnav-item {
  color: #0a2a45;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.40);
  border-color: transparent;
  color: #0a2a45;
}
.nav-item.active,
.nav-item.is-active,
.nav-group.active .nav-parent,
.nav-group.is-active .nav-parent {
  background: linear-gradient(90deg, #2b6c9c, #3f86bd);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 57, 92, 0.30);
}
.subnav-item.active,
.subnav-item.is-active {
  background: rgba(255, 255, 255, 0.50);
  border-radius: 8px;
  color: #0a2a45;
}
.sidebar-collapse-toggle {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(16, 57, 92, 0.22);
  color: #0a2a45;
}
.sidebar-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.55);
}
body.sidebar-collapsed .nav-item::before {
  color: #0a2a45;
}

/* Encabezado superior */
.topbar {
  background: #75a4c9;
  color: #0a2a45;
}
.topbar h1 {
  color: #0a2a45;
}
.topbar .eyebrow {
  color: #244f70;
}

/* Botones primarios (fondo azul) -> nuevo azul + texto oscuro */
button {
  background: #4f86b3;
  color: #ffffff;
}
button:hover {
  background: #457aa4;
}
.primary {
  background: #4f86b3;
  box-shadow: 0 6px 14px rgba(16, 57, 92, 0.22);
  color: #ffffff;
}
.primary:hover {
  background: #457aa4;
}
.danger-button {
  color: #ffffff;
}

/* Encabezado de tablas (fondo azul) */
.data-table thead {
  background: #75a4c9;
}
.data-table th {
  color: #0a2a45;
}

/* Zona del logo + ERP/CRM sobre recuadro blanco */
.brand {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(16, 57, 92, 0.12);
  margin-bottom: 26px;
  padding: 14px 14px 10px;
}
.brand-logo {
  background: transparent;
  padding: 0;
  width: 100%;
}
.brand small {
  color: #0a2a45;
  width: 100%;
}
.sidebar-collapse-toggle {
  background: #eef4f7;
  border-color: #c8d6df;
  color: #0a2a45;
}
.sidebar-collapse-toggle:hover {
  background: #dce8f0;
}

/* Iconos del menu lateral (linea, alineados a la izquierda del texto) */
.nav-item {
  align-items: center;
  display: flex;
  gap: 11px;
}
.nav-parent {
  justify-content: flex-start;
}
.nav-parent .nav-caret {
  margin-left: auto;
}
.nav-ico {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
}
.nav-ico-svg {
  height: 18px;
  opacity: 0.92;
  width: 18px;
}
.subnav-item .nav-ico-svg {
  height: 16px;
  width: 16px;
}
/* Sidebar colapsado: solo icono, centrado */
body.sidebar-collapsed .nav-item {
  gap: 0;
  justify-content: center;
}
body.sidebar-collapsed .nav-item::before {
  display: none;
}

/* Pills del encabezado (Avisos, Sincronizado): fondo blanco + texto navy fuerte */
.notification-button,
.save-sync-status,
.save-sync-status.saved {
  background: #ffffff;
  border-color: rgba(10, 42, 69, 0.18);
  color: #0a2a45;
}
.notification-button:hover {
  background: #eef4f9;
}
.notification-label,
.notification-icon {
  color: #0a2a45;
}
.notification-badge.is-empty {
  background: #dfe8f0;
  color: #0a2a45;
}

/* =========================================================================
   Responsive — celular y tableta: sidebar off-canvas + hamburguesa
   ========================================================================= */
.mobile-nav-toggle {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(10, 42, 69, 0.18);
  border-radius: 10px;
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  height: 42px;
  justify-content: center;
  min-height: 42px;
  width: 42px;
}
.mobile-nav-toggle span {
  background: #0a2a45;
  border-radius: 2px;
  display: block;
  height: 2.5px;
  width: 20px;
}
.mobile-nav-backdrop {
  background: rgba(10, 42, 69, 0.45);
  display: none;
  inset: 0;
  position: fixed;
  z-index: 1100;
}

@media (max-width: 1024px) {
  body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    box-shadow: 0 0 40px rgba(10, 42, 69, 0.35);
    height: 100dvh;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(86vw, 320px);
    z-index: 1200;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  /* Menu siempre en una sola columna en movil (evita el empalme) */
  .sidebar .nav,
  .sidebar .nav-group,
  .sidebar .subnav {
    display: flex;
    flex-direction: column;
  }
  .sidebar .nav-item {
    white-space: normal;
    width: 100%;
  }
  body.nav-open .mobile-nav-backdrop {
    display: block;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .app {
    padding: 16px 14px;
    width: 100%;
  }
  .topbar {
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
  }
  .topbar h1 {
    font-size: 22px;
  }
  .top-actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }
  .client-kpi-grid,
  .catalog-kpi-grid,
  .sales-kpi-grid,
  .corp-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .corp-filter-grid,
  .filter-actions {
    flex-wrap: wrap;
  }
  .table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .topbar h1 {
    font-size: 18px;
  }
  .client-kpi-grid,
  .catalog-kpi-grid,
  .sales-kpi-grid,
  .corp-kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .brand-logo {
    height: 64px;
  }
}

/* =========================================================================
   Banners hero de modulos: homogeneizados al azul de marca (#75A4C9)
   — se retira el morado/verde/teal; texto blanco sobre azul oscuro->claro.
   ========================================================================= */
.executive-hero {
  background:
    linear-gradient(135deg, #2b6c9c 0%, #4f86b3 52%, #75a4c9 100%),
    radial-gradient(circle at 84% 22%, rgba(255, 255, 255, 0.22), transparent 26%);
}
.clients-hero,
.products-hero,
.logistics-hero,
.deliveries-hero,
.quotes-hero,
.sales-hero,
.operations-hero,
.hr-hero,
.accounting-hero,
.sales-hero.quotes-hero,
.sales-hero.deliveries-hero {
  background: linear-gradient(135deg, #2b6c9c 0%, #4f86b3 52%, #75a4c9 100%);
}
