:root {
  --brand: #00a8e1;
  --brand-dark: #0c71c3;
  --ink: #253238;
  --muted: #6c7a86;
  --line: #dfeaf1;
  --soft: #f4f9fc;
  --panel: #ffffff;
  --danger: #f44336;
  --success: #00a884;
  --warning: #ffb020;
  --review: #6f5bd7;
  --shadow: 0 18px 45px rgba(37, 50, 56, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef7fb;
  color: var(--ink);
  font-family: "Source Sans Pro", "Segoe UI", Arial, sans-serif;
}

body.auth-locked {
  min-height: 100vh;
  overflow: hidden;
}

body.auth-locked .app-shell,
body.auth-locked .mobile-nav,
body.auth-locked .ai-floating-button,
body.auth-locked .ai-drawer {
  display: none;
}

.login-screen {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(0, 168, 225, 0.13), transparent 34%),
    linear-gradient(180deg, #eef7fb 0%, #f8fcfe 100%);
  display: none;
  min-height: 100vh;
  padding: 24px;
}

body.auth-locked .login-screen {
  display: flex;
}

.login-card {
  background: #fff;
  border: 1px solid #d7e8f1;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(37, 50, 56, 0.16);
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.login-logo {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  height: 76px;
  justify-content: center;
  overflow: hidden;
  width: 120px;
}

.login-logo img {
  display: block;
  height: 74px;
  object-fit: contain;
  width: 118px;
}

.login-card h1 {
  font-size: 28px;
  line-height: 1.05;
}

.login-copy {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
  margin: 8px 0 0;
}

.login-card label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  text-transform: uppercase;
}

.login-card input {
  background: #fff;
  border: 1px solid #bfdceb;
  border-radius: 8px;
  color: var(--ink);
  min-height: 46px;
  padding: 0 14px;
  text-transform: none;
}

.login-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 168, 225, 0.13);
  outline: 0;
}

.login-error {
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.24);
  border-radius: 8px;
  color: #b42318;
  font-weight: 800;
  margin: 0;
  padding: 10px 12px;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 22px 20px 24px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: start;
  color: var(--ink);
  display: grid;
  gap: 8px;
  justify-items: start;
  min-height: 132px;
  text-decoration: none;
  width: 100%;
}

.brand-mark {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  display: inline-flex;
  height: 86px;
  justify-content: flex-start;
  margin-left: 0;
  overflow: hidden;
  width: 138px;
}

.brand-mark img {
  display: block;
  height: 84px;
  object-fit: contain;
  object-position: left center;
  width: 138px;
}

.brand-copy small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  max-width: 170px;
  margin-left: 0;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.brand small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.parent-brand {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

.parent-brand span,
.eyebrow,
.metric span,
.payment-summary span,
.sidebar-card small {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.parent-brand img {
  display: block;
  max-height: 28px;
  max-width: 170px;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.nav-item {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  width: 100%;
}

.nav-item.active,
.nav-item:hover {
  background: #eaf8fe;
  color: var(--brand-dark);
  font-weight: 700;
}

.sidebar-card,
.metric,
.payment-summary article,
.panel,
.day-column,
.integration-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
}

.sidebar-card p,
.hero-strip p,
.alert-row p,
.schedule-list p,
.integration-card p,
.detection-card p,
.empty {
  color: var(--muted);
  margin: 6px 0 0;
}

.main {
  padding: 26px;
}

.topbar,
.section-head,
.panel-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.topbar {
  margin-bottom: 22px;
}

.academy-heading {
  display: grid;
  gap: 8px;
}

.academy-title {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 10px;
  text-align: left;
  width: fit-content;
}

.academy-title img {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 54px;
  object-fit: contain;
  padding: 5px;
  width: 54px;
}

.academy-title span {
  color: var(--brand-dark);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 900;
  line-height: 1.1;
}

.academy-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

.section-description {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  margin: 8px 0 0;
  max-width: 680px;
}

h1 {
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.15;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 6px;
}

.top-actions,
.button-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.top-actions {
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-logo {
  display: block;
  max-height: 34px;
  max-width: 190px;
  object-fit: contain;
}

.primary-button,
.ghost-button,
.whatsapp-button,
.text-button,
.icon-button {
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
}

.primary-button {
  background: var(--brand);
  border: 0;
  color: #fff;
  font-weight: 800;
}

.ghost-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.top-action-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(37, 50, 56, 0.08);
  color: var(--ink);
  display: inline-flex;
  font-weight: 900;
  gap: 9px;
  min-height: 46px;
  padding: 0 14px 0 10px;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.top-action-button span {
  align-items: center;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 30px;
  font-size: 12px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  line-height: 1;
}

.top-action-button:hover,
.top-action-button:focus-visible {
  border-color: #8fc7d8;
  box-shadow: 0 14px 30px rgba(31, 112, 136, 0.16);
  outline: 0;
  transform: translateY(-1px);
}

.top-action-button.profile span {
  background: #2f7f97;
}

.top-action-button.student span {
  background: var(--brand);
}

.top-action-button.teacher span {
  background: #6f5bd7;
}

.top-action-button.backup span {
  background: #425466;
}

.top-action-button.ai span {
  background: #6f5bd7;
}

.top-action-button[data-tooltip]::after {
  background: #253238;
  border-radius: 8px;
  bottom: calc(100% + 10px);
  box-shadow: 0 16px 35px rgba(37, 50, 56, 0.22);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  max-width: min(340px, 70vw);
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-align: left;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  width: max-content;
  z-index: 20;
}

.top-action-button[data-tooltip]::before {
  border: 7px solid transparent;
  border-top-color: #253238;
  bottom: calc(100% - 4px);
  content: "";
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 24px;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 21;
}

.top-action-button[data-tooltip]:hover::after,
.top-action-button[data-tooltip]:hover::before,
.top-action-button[data-tooltip]:focus-visible::after,
.top-action-button[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.whatsapp-button {
  background: var(--success);
  border: 0;
  color: #fff;
  font-weight: 800;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--brand-dark);
  font-weight: 800;
}

.icon-button {
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 24px;
  height: 42px;
  padding: 0;
  width: 42px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-strip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 24px;
}

.stats-grid,
.payment-summary,
.whatsapp-status-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.home-dashboard {
  display: grid;
  gap: 18px;
}

.home-command {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.6fr);
}

.home-brand-card,
.home-kpi,
.home-alert,
.home-course-list article,
.home-lesson-list article,
.home-action-grid button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.home-brand-card {
  align-content: space-between;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  min-height: 216px;
  padding: 22px;
}

.home-logo-frame {
  align-items: center;
  background: linear-gradient(135deg, #f7fcfe, #eef8fb);
  border: 1px solid #d7e8ef;
  border-radius: 8px;
  display: flex;
  min-height: 92px;
  padding: 18px;
}

.home-logo-frame img {
  display: block;
  max-height: 72px;
  max-width: 220px;
  object-fit: contain;
}

.home-brand-card span,
.home-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-brand-card h2 {
  font-size: 28px;
  margin-top: 6px;
}

.home-brand-card p {
  color: var(--muted);
  margin-top: 6px;
}

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

.home-kpi {
  border-top: 4px solid #8fc7d8;
  box-shadow: 0 12px 30px rgba(37, 50, 56, 0.08);
  display: grid;
  min-height: 101px;
  padding: 16px;
}

.home-kpi.accent {
  border-top-color: #00a8e1;
}

.home-kpi.success {
  border-top-color: #1bbf89;
}

.home-kpi.warning {
  border-top-color: #f59f00;
}

.home-kpi.danger {
  border-top-color: #d64545;
}

.home-kpi strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  margin-top: 8px;
}

.home-kpi small {
  color: var(--muted);
  font-weight: 800;
  margin-top: 8px;
}

.home-main-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.55fr);
}

.home-alert-list,
.home-course-list,
.home-lesson-list,
.home-action-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.home-alert {
  align-items: center;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  padding: 12px;
  text-align: left;
}

.home-alert > span {
  background: #00a8e1;
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.home-alert.warning > span {
  background: #f59f00;
}

.home-alert.danger > span {
  background: #d64545;
}

.home-alert strong {
  font-size: 14px;
}

.home-alert small {
  color: var(--muted);
  grid-column: 2 / 3;
}

.home-alert em {
  color: var(--brand-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  grid-column: 3;
  grid-row: 1 / 3;
}

.home-cash-focus {
  background: #f8fcfe;
  border: 1px solid #e0edf3;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}

.home-cash-total span,
.home-trend-head span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-cash-total strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-top: 6px;
}

.home-cash-total small {
  color: var(--muted);
  display: block;
  font-weight: 800;
  margin-top: 8px;
}

.home-cash-breakdown {
  display: grid;
  gap: 10px;
}

.home-cash-track {
  background: #e8f1f5;
  border-radius: 999px;
  display: flex;
  height: 18px;
  overflow: hidden;
}

.home-cash-track span {
  min-width: 3px;
}

.home-cash-track .paid,
.home-cash-items i.paid {
  background: #1bbf89;
}

.home-cash-track .pending,
.home-cash-items i.pending {
  background: #ffcc66;
}

.home-cash-track .overdue,
.home-cash-items i.overdue {
  background: #d64545;
}

.home-cash-items {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-cash-items span {
  align-items: center;
  background: #fff;
  border: 1px solid #e0edf3;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  padding: 9px;
}

.home-cash-items i {
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.home-cash-items strong {
  color: var(--ink);
  margin-left: auto;
}

.home-trend-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.home-trend-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
}

.home-trend-head strong {
  font-size: 13px;
}

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

.home-trend-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) 86px;
}

.home-trend-row span,
.home-trend-row strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.home-trend-row strong {
  color: var(--ink);
  text-align: right;
}

.home-trend-row div {
  background: #eef6fa;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.home-trend-row i {
  background: linear-gradient(90deg, #00a8e1, #1bbf89);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.home-bottom-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.1fr 1fr 0.8fr;
}

.home-course-list article {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.home-course-list span,
.home-lesson-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-lesson-list article {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 58px 1fr;
  padding: 12px;
}

.home-action-grid {
  grid-template-columns: 1fr;
}

.home-action-grid button {
  color: var(--brand-dark);
  font-weight: 900;
  min-height: 42px;
  text-align: left;
  padding: 10px 12px;
}

.whatsapp-status-grid {
  grid-template-columns: 1.3fr 0.7fr;
}

.metric,
.payment-summary article,
.panel,
.day-column,
.integration-card {
  padding: 18px;
}

.metric strong,
.payment-summary strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin: 8px 0;
}

.payment-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.payment-filters button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  min-height: 38px;
  padding: 0 12px;
}

.payment-filters button.active,
.payment-filters button:hover {
  background: #eaf8fe;
  border-color: #bde8f8;
  color: var(--brand-dark);
}

.payment-reminder-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f3fbff 100%);
  border-color: #d9eef6;
  box-shadow: 0 12px 30px rgba(32, 53, 78, 0.07);
  margin-bottom: 14px;
}

.payment-reminder-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.payment-reminder-head h3 {
  margin: 2px 0 6px;
}

.payment-reminder-head p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
}

.payment-reminder-head > strong {
  background: #eaf8fe;
  border: 1px solid #bde8f8;
  border-radius: 999px;
  color: var(--brand-dark);
  flex: 0 0 auto;
  font-size: 13px;
  padding: 8px 12px;
}

.payment-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.payment-reminder-actions button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  min-height: 38px;
  padding: 0 12px;
}

.payment-reminder-actions button:hover {
  border-color: #bde8f8;
  color: var(--brand-dark);
}

.payment-reminder-actions .whatsapp-button {
  background: var(--success);
  border: 0;
  color: #fff;
}

.payment-reminder-actions .whatsapp-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.payment-reminder-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.payment-reminder-item input {
  accent-color: var(--brand);
  height: 18px;
  width: 18px;
}

.payment-reminder-item small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.payment-reminder-item em {
  background: #fff7e6;
  border-radius: 999px;
  color: #9a6400;
  font-style: normal;
  font-weight: 900;
  min-width: 28px;
  padding: 5px 8px;
  text-align: center;
}

.metric small,
.detection-card small {
  color: var(--muted);
}

.profit-hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #eef9f6 48%, #fff5df 100%);
  border: 1px solid #d8ece8;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 188px;
  margin-bottom: 18px;
  padding: 24px;
}

.profitability-controls {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 18px;
}

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

.profit-control-grid label,
.fixed-cost-row label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 6px;
  text-transform: uppercase;
}

.profit-control-grid select,
.fixed-cost-row input,
.occupancy-grid input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  min-height: 40px;
  padding: 0 10px;
}

.profit-hero h2 {
  color: var(--ink);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  margin-bottom: 10px;
}

.profit-hero p:not(.eyebrow),
.profit-panel .panel-head p {
  color: var(--muted);
  margin: 6px 0 0;
}

.profit-donut,
.collection-ring {
  align-items: center;
  aspect-ratio: 1;
  background: conic-gradient(#00a884 var(--value), #ffd166 0, #edf3f6 100%);
  border-radius: 50%;
  display: grid;
  justify-items: center;
  padding: 18px;
  position: relative;
}

.profit-donut::before,
.collection-ring::before {
  background: #fff;
  border-radius: 50%;
  content: "";
  inset: 16px;
  position: absolute;
}

.profit-donut strong,
.profit-donut span,
.collection-ring strong,
.collection-ring span {
  position: relative;
  z-index: 1;
}

.profit-donut strong,
.collection-ring strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.profit-donut span,
.collection-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profit-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.forecast-pill {
  background: #e8fff8;
  border-radius: 999px;
  color: #007a61;
  flex: 0 0 auto;
  padding: 8px 12px;
}

.trend-chart {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 18px;
  min-height: 250px;
}

.trend-chart article {
  align-items: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.trend-bars {
  align-items: end;
  background: #f3f7fa;
  border: 1px solid #e1ecf1;
  border-radius: 8px;
  display: flex;
  gap: 5px;
  height: 180px;
  justify-content: center;
  padding: 10px 9px 0;
  width: 100%;
}

.trend-bars span {
  border-radius: 8px 8px 0 0;
  display: block;
  min-height: 8px;
  width: 26px;
}

.trend-revenue {
  background: linear-gradient(180deg, var(--brand), #00a884);
}

.trend-cost {
  background: linear-gradient(180deg, #f5b85a, #f44336);
}

.trend-chart small {
  color: var(--muted);
  font-weight: 800;
}

.trend-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.trend-legend span {
  background: var(--brand);
  border-radius: 999px;
  height: 10px;
  width: 22px;
}

.trend-legend .cost {
  background: #f5b85a;
  margin-left: 10px;
}

.occupancy-grid,
.fixed-cost-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.occupancy-grid article {
  align-items: center;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 78px;
  padding: 12px;
}

.occupancy-grid small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.occupancy-track {
  background: #e7f0f4;
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
}

.occupancy-track span {
  background: linear-gradient(90deg, var(--brand), #00a884);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.occupancy-grid em {
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 900;
}

.fixed-cost-row {
  align-items: end;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 150px 42px;
  padding: 12px;
}

.teacher-profit-table {
  display: grid;
  margin-top: 16px;
  overflow-x: auto;
}

.teacher-profit-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) 0.55fr 0.55fr 0.7fr 0.4fr;
  min-width: 760px;
  padding: 12px 0;
}

.teacher-profit-row.header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-profit-row:last-child {
  border-bottom: 0;
}

.teacher-profit-row small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.positive-profit {
  color: #007a61;
  font-weight: 900;
}

.negative-profit {
  color: #c22d22;
  font-weight: 900;
}

.profit-alerts {
  display: grid;
  gap: 10px;
  margin: 16px 0 22px;
}

.profit-alerts article {
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  border-left: 5px solid var(--warning);
  border-radius: 8px;
  color: #684300;
  font-weight: 800;
  padding: 12px;
}

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

.zone-hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #eef9f6 55%, #fff5df 100%);
  border: 1px solid #d8ece8;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 24px;
}

.zone-hero h2 {
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1;
  margin-bottom: 8px;
}

.zone-hero p:not(.eyebrow),
.zone-action-panel p {
  color: var(--muted);
  margin: 0;
}

.zone-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  margin-bottom: 18px;
}

.area-map-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  margin-bottom: 18px;
}

.area-map-layout.bottom {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
}

.map-panel {
  overflow: hidden;
  padding: 14px;
}

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

.map-toolbar label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  text-transform: uppercase;
}

.map-toolbar input,
.map-point-form input,
.map-point-form select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  min-height: 40px;
  padding: 0 10px;
}

.map-toolbar input {
  width: 78px;
}

.map-canvas-wrap {
  position: relative;
}

.map-legend {
  align-items: center;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.map-legend.floating {
  bottom: 14px;
  box-shadow: 0 12px 28px rgba(37, 50, 56, 0.14);
  left: 14px;
  margin: 0;
  max-width: calc(100% - 28px);
  position: absolute;
  z-index: 700;
}

.map-legend span {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

.map-legend i {
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(37, 50, 56, 0.16);
  display: inline-block;
  height: 16px;
  width: 16px;
}

.map-legend i.academy {
  background: var(--brand);
}

.map-legend i.school {
  background: var(--success);
}

.map-legend i.competitor {
  background: var(--danger);
}

.map-legend i.radius {
  background: rgba(0, 168, 225, 0.12);
  border-color: var(--brand);
}

.area-map-canvas {
  background: #dfeaf1;
  border-radius: 8px;
  height: min(680px, calc(100vh - 230px));
  min-height: 500px;
  overflow: hidden;
}

.map-marker {
  background: transparent;
  border: 0;
}

.map-marker span {
  align-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(37, 50, 56, 0.25);
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.competitor-marker span {
  border-width: 2px;
  font-size: 11px;
  height: 24px;
  opacity: 0.86;
  width: 24px;
}

.map-side-panel p {
  color: var(--muted);
  margin: 6px 0 0;
}

.school-ranking,
.priority-list,
.map-opportunity-list,
.map-point-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.school-ranking article,
.priority-list article,
.map-opportunity-list article {
  align-items: center;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.school-ranking small,
.priority-list small,
.map-opportunity-list small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.school-ranking span,
.priority-list span,
.map-opportunity-list span {
  background: #e8fff8;
  border-radius: 999px;
  color: #007a61;
  flex: 0 0 auto;
  font-weight: 900;
  padding: 6px 10px;
}

.zone-priority-panel {
  align-content: start;
}

.priority-list article {
  border-left: 5px solid var(--success);
}

.priority-list span {
  background: #eaf8fe;
  color: var(--brand-dark);
  min-width: 40px;
  text-align: center;
}

.zone-action-panel {
  margin-bottom: 18px;
}

.commercial-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.commercial-actions article {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 14px;
}

.commercial-actions strong {
  display: block;
  margin-bottom: 8px;
}

.commercial-actions small {
  color: var(--brand-dark);
  display: block;
  font-weight: 900;
  margin-top: 10px;
}

.map-opportunity-list article {
  align-items: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.map-opportunity-list small {
  grid-column: 1 / -1;
}

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

.map-point-form input:nth-of-type(4),
.map-point-form button {
  grid-column: 1 / -1;
}

.profit-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #8fc7d8;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(35, 48, 68, 0.06);
  padding: 16px;
}

.profit-kpi.primary {
  border-left-color: var(--brand);
}

.profit-kpi.warning {
  border-left-color: var(--warning);
}

.profit-kpi.danger {
  border-left-color: var(--danger);
}

.profit-kpi span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profit-kpi strong {
  color: var(--ink);
  display: block;
  font-size: 26px;
  line-height: 1;
  margin: 10px 0 8px;
}

.profit-kpi small,
.profit-bar-meta small,
.profit-student-list small,
.payment-mix small,
.insight-grid span {
  color: var(--muted);
}

.profit-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  margin-bottom: 18px;
}

.profit-layout.bottom {
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
}

.profit-panel {
  overflow: hidden;
}

.profit-bars,
.profit-student-list,
.payment-mix,
.insight-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.profit-bars article {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  padding: 12px;
}

.profit-bar-head,
.profit-bar-meta,
.profit-student-list article {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.profit-bar-head strong,
.profit-student-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-bar-head span,
.profit-student-list > article > span {
  color: var(--brand-dark);
  flex: 0 0 auto;
  font-weight: 900;
}

.profit-bar-track {
  background: #e7f0f4;
  border-radius: 999px;
  height: 12px;
  margin: 10px 0 8px;
  overflow: hidden;
}

.profit-bar-track span {
  background: linear-gradient(90deg, var(--brand), #00a884 58%, #f5b85a);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 18px;
}

.profit-bar-meta em {
  background: #fff7e6;
  border-radius: 999px;
  color: #9a6400;
  font-style: normal;
  font-weight: 900;
  padding: 4px 8px;
}

.collection-ring {
  margin: 18px auto;
  max-width: 190px;
}

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

.payment-mix article,
.insight-grid article,
.profit-student-list article {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  padding: 12px;
}

.payment-mix strong,
.insight-grid strong {
  color: var(--ink);
  display: block;
  font-size: 22px;
  margin-top: 8px;
}

.profit-student-list article {
  display: flex;
}

.profit-student-list div {
  min-width: 0;
}

.profit-student-list small {
  display: block;
  margin-top: 3px;
}

.insight-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f6fbff 45%, #fff7eb 100%);
}

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

.content-grid,
.whatsapp-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.import-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  margin-bottom: 18px;
}

.import-panel .panel-head {
  align-items: flex-start;
}

.import-panel .panel-head p {
  color: var(--muted);
  margin: 6px 0 0;
}

.import-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  margin: 16px 0;
}

.file-drop {
  align-content: center;
  background: var(--soft);
  border: 1px dashed #b9d7e7;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 18px;
  text-align: center;
}

.file-drop input {
  display: none;
}

.file-drop span {
  color: var(--muted);
}

.quick-import {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 150px;
  padding: 14px;
  resize: vertical;
}

.review-panel {
  align-content: start;
}

.import-review-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  max-height: 390px;
  overflow: auto;
}

.import-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.check-line {
  align-items: center;
  display: flex;
  gap: 8px;
}

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

.import-card-grid {
  color: var(--muted);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

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

.alert-list,
.schedule-list,
.detection-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.detection-list {
  background: linear-gradient(180deg, #eef7fb 0%, #ffffff 100%);
  border: 2px solid #8fc7d8;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(31, 112, 136, 0.14);
  padding: 16px;
}

.alert-row,
.detection-card {
  background: var(--soft);
  border-radius: 8px;
  padding: 14px;
}

.alert-row {
  align-items: flex-start;
  display: grid;
  gap: 12px;
  grid-template-columns: 10px 1fr;
}

.alert-row > span {
  background: var(--warning);
  border-radius: 99px;
  height: 10px;
  margin-top: 6px;
  width: 10px;
}

.alert-row.danger > span {
  background: var(--danger);
}

.schedule-list article {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: 58px 1fr;
  padding: 12px 0;
}

.schedule-list article:last-child {
  border-bottom: 0;
}

time {
  color: var(--brand-dark);
  font-weight: 900;
}

.section-head {
  margin-bottom: 16px;
}

.search,
.select,
.chat-import,
.form-grid input,
.form-grid select,
.form-grid textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.search,
.select,
.form-grid input,
.form-grid select {
  min-height: 44px;
  padding: 0 14px;
}

.form-grid textarea {
  font: inherit;
  min-height: 86px;
  padding: 12px 14px;
  resize: vertical;
}

.search {
  min-width: min(380px, 100%);
}

.list-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 12px;
}

.list-toolbar .search {
  width: min(380px, 100%);
}

.table-panel {
  overflow-x: auto;
  padding: 0;
}

.table {
  min-width: 760px;
}

.teachers-table {
  min-width: 980px;
}

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

.table-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px 18px;
}

.students-table .table-row {
  grid-template-columns: 1fr 0.9fr 0.9fr 0.65fr 0.75fr 0.65fr 250px;
}

.teachers-table .table-row {
  grid-template-columns: 1fr 1fr 1fr 0.9fr 170px;
}

.courses-table .table-row {
  grid-template-columns: 1.2fr 1fr 0.7fr 0.7fr 1.2fr 0.65fr 310px;
}

.payments-table .table-row {
  grid-template-columns: 1.05fr 0.55fr 0.9fr 0.6fr 0.7fr 330px;
}

.payment-cell-method {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payment-method-select {
  background: linear-gradient(180deg, #ffffff 0%, #f4fbfe 100%);
  border: 1px solid #bfdceb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(32, 53, 78, 0.06);
  display: grid;
  position: relative;
}

.payment-method-select::after {
  color: var(--brand-dark);
  content: "v";
  font-size: 17px;
  font-weight: 900;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-54%);
}

.payment-method-select select {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  min-height: 42px;
  padding: 0 34px 0 12px;
  width: 100%;
}

.payment-cell-method small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-table {
  min-width: 940px;
}

.ops-table .table-row {
  grid-template-columns: 0.7fr 1fr 1.2fr 0.55fr 0.7fr 0.7fr;
}

#documentsDashboard .ops-table .table-row {
  grid-template-columns: 1.35fr 0.75fr 0.9fr 0.8fr 220px;
}

.table-row.header {
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-row:last-child {
  border-bottom: 0;
}

.course-control-panel {
  margin-bottom: 14px;
}

.course-filters {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(150px, 0.7fr));
}

.course-filters label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.course-filters input,
.course-filters select {
  min-height: 40px;
}

.course-combobox-field {
  position: relative;
}

.course-combobox {
  display: grid;
  position: relative;
}

.course-suggestion-list {
  background: #fff;
  border: 1px solid #cfdde6;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(32, 53, 78, 0.18);
  display: none;
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 7;
}

.course-combobox:focus-within .course-suggestion-list {
  display: grid;
}

.course-suggestion-list button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  min-height: 36px;
  overflow: hidden;
  padding: 0 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-suggestion-list button:hover,
.course-suggestion-list button:focus {
  background: #eaf8fe;
  color: var(--brand-dark);
  outline: none;
}

.course-suggestion-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 12px 10px;
}

.course-cell-main,
.course-cell-teacher,
.course-cell-students,
.course-cell-schedule {
  display: grid;
  gap: 3px;
}

.student-cell-payment,
.payment-cell-main {
  display: grid;
  gap: 3px;
}

.student-cell-payment small,
.payment-cell-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.course-cell-main small,
.course-cell-teacher small,
.course-cell-students small,
.course-cell-schedule small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.course-cell-modality {
  background: #eef8fb;
  border: 1px solid #d7e8ef;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  justify-self: start;
  padding: 6px 10px;
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.course-actions .row-action,
.course-actions .danger-button {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 8px;
}

.table-row strong,
.table-row span {
  min-width: 0;
}

.table-row strong small,
.table-row span small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-empty {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.ops-kpi-grid,
.pipeline-grid,
.attendance-grid,
.portal-preview-layout,
.ops-two-columns {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

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

.pipeline-grid {
  align-items: start;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-flow {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.pipeline-flow-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.pipeline-flow-head h2 {
  font-size: 20px;
}

.pipeline-flow-track {
  --pipeline-progress: 0%;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  overflow-x: auto;
  padding: 6px 2px 12px;
  position: relative;
}

.pipeline-flow-track::before,
.pipeline-flow-track::after {
  content: "";
  height: 3px;
  left: 24px;
  position: absolute;
  right: 24px;
  top: 24px;
}

.pipeline-flow-track::before {
  background: #dbeaf0;
}

.pipeline-flow-track::after {
  background: linear-gradient(90deg, #00a8e1, #1bbf89 58%, #ffb84d);
  max-width: calc(100% - 48px);
  width: var(--pipeline-progress);
}

.pipeline-node {
  align-content: start;
  --stage-accent: #00a8e1;
  --stage-soft: #eaf8fe;
  background: var(--stage-soft);
  border: 1px solid #d7e8ef;
  border-top: 3px solid var(--stage-accent);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 6px;
  justify-items: start;
  min-height: 104px;
  padding: 12px 14px;
  position: relative;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
  z-index: 1;
}

.pipeline-node:nth-child(1) {
  --stage-accent: #00a8e1;
  --stage-soft: #eaf8fe;
}

.pipeline-node:nth-child(2) {
  --stage-accent: #7c5cff;
  --stage-soft: #f0edff;
}

.pipeline-node:nth-child(3) {
  --stage-accent: #f59f00;
  --stage-soft: #fff6df;
}

.pipeline-node:nth-child(4) {
  --stage-accent: #1bbf89;
  --stage-soft: #e8fbf4;
}

.pipeline-node:nth-child(5) {
  --stage-accent: #0c8f64;
  --stage-soft: #e3f8ef;
}

.pipeline-node:nth-child(6) {
  --stage-accent: #d64545;
  --stage-soft: #fff0f0;
}

.pipeline-node:hover,
.pipeline-node.selected {
  background: #ffffff;
  border-color: var(--stage-accent);
  border-top-color: var(--stage-accent);
  box-shadow: 0 14px 28px rgba(23, 74, 92, 0.12);
  transform: translateY(-2px);
}

.pipeline-node.muted,
.pipeline-column.muted {
  opacity: 0.45;
}

.pipeline-node-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.pipeline-node-index,
.pipeline-node-count {
  align-items: center;
  background: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: var(--stage-accent);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.pipeline-node-count {
  background: #ffffff;
  background: color-mix(in srgb, var(--stage-accent) 16%, #ffffff);
  border-color: #ffffff;
  border-color: color-mix(in srgb, var(--stage-accent) 22%, #ffffff);
  min-width: 28px;
  padding: 0 8px;
  width: auto;
}

.pipeline-node strong {
  color: var(--stage-accent);
  font-size: 18px;
  line-height: 1.1;
}

.pipeline-node small {
  color: var(--muted);
  font-weight: 800;
}

.pipeline-column {
  align-content: start;
  --stage-accent: #00a8e1;
  --stage-soft: #eaf8fe;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 8px;
  min-height: 200px;
  padding: 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.pipeline-column:nth-child(1) {
  --stage-accent: #00a8e1;
  --stage-soft: #eaf8fe;
}

.pipeline-column:nth-child(2) {
  --stage-accent: #7c5cff;
  --stage-soft: #f0edff;
}

.pipeline-column:nth-child(3) {
  --stage-accent: #f59f00;
  --stage-soft: #fff6df;
}

.pipeline-column:nth-child(4) {
  --stage-accent: #1bbf89;
  --stage-soft: #e8fbf4;
}

.pipeline-column:nth-child(5) {
  --stage-accent: #0c8f64;
  --stage-soft: #e3f8ef;
}

.pipeline-column:nth-child(6) {
  --stage-accent: #d64545;
  --stage-soft: #fff0f0;
}

.pipeline-column.selected {
  border-color: var(--stage-accent);
  box-shadow: 0 10px 22px rgba(23, 74, 92, 0.09);
}

.pipeline-column-head {
  align-items: center;
  border-bottom: 2px solid var(--stage-accent);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 0 0 8px;
}

.pipeline-column-head h2 {
  color: var(--stage-accent);
  font-size: 15px;
  line-height: 1.1;
}

.pipeline-column-head span:not(.status) {
  color: var(--muted);
  display: block;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.pipeline-column .status {
  background: var(--stage-soft);
  color: var(--stage-accent);
  min-width: 28px;
}

.pipeline-step-label {
  color: var(--stage-accent);
  color: color-mix(in srgb, var(--stage-accent) 72%, #425466);
  display: block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.pipeline-board-title {
  align-items: end;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 2px 0 10px;
}

.pipeline-board-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.pipeline-board-title strong {
  color: var(--ink);
  font-size: 16px;
}

.pipeline-column .button-row.compact {
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-column .ops-card {
  border-radius: 8px;
  gap: 6px;
  padding: 10px;
}

.pipeline-column .ops-card strong {
  font-size: 14px;
}

.pipeline-column .ops-card p,
.pipeline-column .ops-card small {
  font-size: 12px;
  line-height: 1.35;
}

.pipeline-column .row-action {
  border-radius: 7px;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 8px;
}

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

.readiness-list,
.ops-checklist,
.task-list,
.channel-grid,
.template-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.readiness-list article,
.task-list article,
.channel-grid article {
  align-items: center;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px 12px;
}

.readiness-list article.ready {
  background: #f3fffb;
  border-color: #cdeee4;
}

.readiness-list small,
.task-list span,
.channel-grid span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-top: 3px;
}

.ops-checklist span {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  padding: 10px 12px;
}

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

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

.template-grid button {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  text-align: left;
}

.template-grid button:hover,
.template-grid button:focus-visible {
  border-color: #8fc7d8;
  outline: 0;
}

.template-grid span {
  color: var(--muted);
  font-size: 13px;
}

.document-template-card {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-left: 4px solid #9fb7c2;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-height: 110px;
  padding: 14px;
}

.document-template-card.configured {
  background: #f3fffb;
  border-left-color: #20a37a;
}

.document-template-card strong,
.document-template-card span,
.document-template-card small {
  display: block;
}

.document-template-card span {
  color: var(--ink);
  font-weight: 800;
  margin-top: 5px;
}

.document-template-card small {
  color: var(--muted);
  margin-top: 4px;
}

.template-grid .document-template-card button {
  display: inline-flex;
  min-height: 34px;
  padding: 7px 10px;
  width: auto;
}

.document-upload-button {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  justify-self: start;
}

.document-upload-button input {
  display: none;
}

.drive-modal-card {
  max-width: 760px;
}

.drive-loading,
.drive-setup-state {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  padding: 18px;
}

.drive-setup-state h3,
.drive-setup-state p {
  margin-bottom: 10px;
}

.drive-setup-state code {
  background: #eef5f7;
  border-radius: 6px;
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
}

.drive-connected-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.drive-file-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  max-height: 440px;
  overflow: auto;
}

.drive-file-list article {
  align-items: center;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  padding: 11px;
}

.drive-file-icon {
  align-items: center;
  background: #eaf8f0;
  border: 1px solid #ccebd8;
  border-radius: 7px;
  color: #087443;
  display: flex;
  font-size: 12px;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.drive-file-list small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.document-template-list-panel {
  margin-top: 16px;
}

.document-model-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.document-model-list article {
  align-items: center;
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 12px;
}

.document-model-icon {
  align-items: center;
  background: #e9f8ff;
  border: 1px solid #ccebf8;
  border-radius: 7px;
  color: var(--brand-dark);
  display: flex;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.document-model-list span,
.document-model-list small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.document-model-list span {
  color: var(--ink);
  font-weight: 800;
}

.business-attachment {
  align-items: center;
  background: #eef8fc;
  border: 1px solid #d3eaf3;
  border-radius: 7px;
  display: flex;
  gap: 8px;
  grid-column: 2;
  padding: 8px 10px;
}

.business-attachment span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.business-outbox-list article:has(.business-attachment) .business-payment-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
}

@media (max-width: 700px) {
  .document-model-list article {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .document-model-list .row-actions {
    grid-column: 1 / -1;
  }

  .business-attachment,
  .business-outbox-list article:has(.business-attachment) .business-payment-actions {
    grid-column: 1;
    grid-row: auto;
  }
}

.ops-action-panel {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.ops-action-panel p {
  color: var(--muted);
  margin: 6px 0 0;
}

.ops-card,
.attendance-row {
  background: #f8fbfc;
  border: 1px solid #e3eef3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.ops-card p,
.ops-card small,
.attendance-class p {
  color: var(--muted);
  margin: 0;
}

.ops-card small {
  font-weight: 800;
}

.portal-preview-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr) minmax(280px, 0.7fr);
}

.portal-family-list,
.document-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.attendance-class {
  display: grid;
  gap: 10px;
}

.attendance-row {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(250px, auto);
}

.attendance-row .row-actions {
  justify-content: end;
}

.status {
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  padding: 6px 10px;
  width: fit-content;
}

.status-button {
  cursor: pointer;
}

.claim-status-wrap {
  display: inline-flex;
  position: relative;
  width: fit-content;
}

.claim-tooltip {
  background: var(--ink);
  border-radius: 8px;
  bottom: calc(100% + 8px);
  box-shadow: 0 10px 25px rgba(37, 50, 56, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  left: 0;
  line-height: 1.35;
  max-width: 260px;
  min-width: 210px;
  opacity: 0;
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  transform: translateY(4px);
  transition: 0.12s ease;
  visibility: hidden;
  z-index: 20;
}

.claim-status-wrap:hover .claim-tooltip,
.claim-status-wrap:focus-within .claim-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.status.paid,
.status.active {
  background: #e8fff8;
  color: #007a61;
}

.status.pending,
.status.claimed {
  background: #fff7e6;
  color: #9a6400;
}

.status.overdue,
.status.debtor {
  background: #fff0ee;
  color: #c22d22;
}

.status.review {
  background: #f0edff;
  color: var(--review);
}

.row-action {
  background: #eaf8fe;
  border: 0;
  border-radius: 8px;
  color: var(--brand-dark);
  font-weight: 800;
  min-height: 36px;
}

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

.row-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-button {
  background: #fff0ee;
  border: 1px solid #ffd0ca;
  border-radius: 8px;
  color: #c22d22;
  font-weight: 900;
  min-height: 44px;
  padding: 0 14px;
}

.modal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.student-name-link {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.student-name-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions .row-action {
  padding: 0 10px;
}

.student-profile-hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef8fb 52%, #fff8ec 100%);
  border: 1px solid #d8e8ef;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(35, 48, 68, 0.08);
  margin-bottom: 18px;
  overflow: hidden;
  padding: 18px;
}

.teacher-profile-hero {
  background: linear-gradient(135deg, #ffffff 0%, #edf8f5 54%, #f8f1ff 100%);
}

.teacher-profile-page .profile-block {
  border-left-color: #16865f;
}

.teacher-profile-page .student-profile-tags > span:not(.status) {
  background: #effbf6;
  border-color: #cceee1;
  color: #16865f;
}

.teacher-profile-page .profile-lessons article {
  background: #effbf6;
  border-color: #cceee1;
}

.teacher-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.student-profile-topline {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.student-profile-head {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr;
}

.student-avatar {
  align-items: center;
  background: #253238;
  border: 4px solid #fff;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(37, 50, 56, 0.18);
  color: #fff;
  display: inline-flex;
  font-size: 28px;
  font-weight: 900;
  height: 78px;
  justify-content: center;
  width: 78px;
}

.student-profile-head h2 {
  font-size: 32px;
  margin: 0;
}

.student-profile-tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.student-profile-tags > span:not(.status) {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #cfeef7;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 6px 10px;
}

.student-profile-actions {
  display: flex;
  gap: 8px;
}

.student-profile-actions .row-action:first-child {
  background: var(--brand);
  color: #fff;
}

.student-snapshot {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.student-snapshot article {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(207, 238, 247, 0.95);
  border-radius: 8px;
  padding: 12px;
}

.student-snapshot span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.student-snapshot strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.profile-block {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(35, 48, 68, 0.06);
  padding: 18px;
}

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

.profile-block h3 {
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.profile-block dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-block dl div {
  border-bottom: 1px solid #edf3f6;
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
}

.profile-block dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-block dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-block dd {
  color: var(--ink);
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-block p {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
}

.profile-lessons {
  display: grid;
  gap: 10px;
}

.profile-lessons article {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

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

.teacher-only-calendar {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  overflow-x: auto;
}

.teacher-calendar-day {
  background: #f8fbfa;
  border: 1px solid #cceee1;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 12px;
}

.teacher-calendar-day-head {
  align-items: center;
  border-bottom: 1px solid #d8f2e7;
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
}

.teacher-calendar-day-head strong {
  color: #16865f;
  font-size: 14px;
}

.teacher-calendar-day-head span {
  align-items: center;
  background: #effbf6;
  border: 1px solid #cceee1;
  border-radius: 999px;
  color: #16865f;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  min-width: 26px;
}

.teacher-calendar-day p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.teacher-calendar-lesson {
  --lesson-color: #16865f;
  --lesson-bg: #effbf6;
  background: var(--lesson-bg);
  border: 1px solid rgba(22, 134, 95, 0.18);
  border-left: 4px solid var(--lesson-color);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.teacher-calendar-lesson time {
  color: var(--lesson-color);
  font-weight: 900;
}

.teacher-calendar-lesson span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

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

.payroll-section-head h3 {
  margin-bottom: 4px;
}

.payroll-section-head p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.payroll-year-control {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 6px;
  padding: 5px;
}

.payroll-year-control button,
.payroll-year-control select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  min-height: 36px;
  padding: 0 10px;
}

.payroll-year-control button {
  min-width: 36px;
}

.teacher-payroll-months article {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #e2a32c;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.payroll-month-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.teacher-payroll-months article.paid {
  border-left-color: #16865f;
}

.teacher-payroll-months strong {
  color: var(--ink);
}

.teacher-payroll-months span,
.teacher-payroll-months em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.teacher-payroll-months label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 5px;
  text-transform: uppercase;
}

.teacher-payroll-months input,
.teacher-payroll-months select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  min-height: 38px;
  padding: 0 10px;
}

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

.payroll-control-grid .full-field {
  grid-column: 1 / -1;
}

.profile-lessons span,
.profile-lessons p {
  color: var(--muted);
  font-weight: 800;
}

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

.report-section-head p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 4px 0 0;
}

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

.student-report-list article {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  padding: 14px;
}

.student-report-list article > p {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

.student-report-list strong {
  color: var(--ink);
  display: block;
}

.student-report-list span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-top: 4px;
}

.calendar-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  overflow-x: auto;
  padding-bottom: 4px;
}

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


.segmented-control {
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  padding: 4px;
}

.segmented-control button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  min-height: 34px;
  padding: 0 12px;
}

.segmented-control button.active {
  background: #fff;
  box-shadow: 0 8px 18px rgba(22, 34, 51, 0.08);
  color: var(--brand-dark);
}

.calendar-toolbar {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f1fbff 58%, #fff8ec 100%);
  border: 1px solid #dcecf3;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(32, 53, 78, 0.08);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  margin: 0 0 14px;
  padding: 16px;
}

.period-control {
  align-items: center;
  display: flex;
  gap: 10px;
}

.period-control strong {
  color: var(--ink);
  font-size: 20px;
  text-transform: capitalize;
}

.period-control button,
.date-jumpers button {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  min-height: 38px;
  padding: 0 12px;
}

.period-control button:hover,
.date-jumpers button:hover {
  background: #eaf8fe;
}

.date-jumpers {
  display: flex;
  gap: 8px;
}

.date-jumpers select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  min-height: 38px;
  padding: 0 10px;
}

#calendarTeacherFilter {
  min-width: 190px;
}

.date-jumpers select:disabled {
  opacity: 0.45;
}

.calendar-toolbar > span {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.day-column {
  align-content: start;
  background: #fff;
  border: 1px solid #e0e8ee;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(35, 48, 68, 0.07);
  display: grid;
  gap: 12px;
  min-height: 430px;
  padding: 12px;
}

.today-day-column {
  border-color: rgba(39, 161, 195, 0.55);
  box-shadow: 0 14px 34px rgba(39, 161, 195, 0.16);
}

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

.day-column-head h3 {
  margin: 0;
}

.day-column-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-column-head > span {
  align-items: center;
  background: #eef8fb;
  border: 1px solid #cfeef7;
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  min-width: 30px;
}

.lesson {
  --lesson-color: var(--brand);
  --lesson-bg: #f2fbff;
  background: var(--lesson-bg);
  border: 1px solid rgba(32, 53, 78, 0.08);
  border-left: 5px solid var(--lesson-color);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 5px;
  padding: 12px 12px 12px 13px;
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.lesson:hover {
  box-shadow: 0 12px 24px rgba(32, 53, 78, 0.12);
  transform: translateY(-2px);
}

.lesson time {
  color: var(--lesson-color);
  font-size: 13px;
  font-weight: 900;
}

.lesson span {
  color: var(--muted);
}

.lesson-detail-modal-card {
  max-width: 980px;
  width: min(980px, calc(100vw - 28px));
}

#lessonDetailModal {
  max-width: min(980px, calc(100vw - 28px));
  width: min(980px, calc(100vw - 28px));
}

.lesson-detail-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.lesson-detail-toolbar > span {
  color: var(--muted);
  font-weight: 900;
  margin-right: auto;
}

.lesson-student-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.lesson-student-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--student-code-color, transparent);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) minmax(230px, 0.9fr) minmax(112px, auto);
  min-width: 0;
  padding: 12px;
}

.lesson-student-row.has-student-code {
  background: color-mix(in srgb, var(--student-code-color) 8%, #ffffff);
}

.lesson-student-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lesson-student-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-student-main em {
  color: var(--student-code-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.lesson-color-control {
  display: flex;
  gap: 7px;
  justify-content: center;
}

.lesson-color-control button {
  background: var(--student-code-color);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px #cfdde6;
  height: 24px;
  min-height: 24px;
  padding: 0;
  width: 24px;
}

.lesson-color-control button.active {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--student-code-color) 28%, #ffffff), 0 0 0 1px var(--student-code-color) inset;
}

.lesson-color-control .clear-color {
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.color-preview {
  background: var(--student-code-color);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px #cfdde6;
  height: 28px;
  width: 28px;
}

.color-legend-card {
  max-width: 760px;
  width: 100%;
}

#colorLegendModal {
  max-width: min(760px, calc(100vw - 28px));
  overflow-x: hidden;
  width: min(760px, calc(100vw - 28px));
}

.color-legend-list {
  background: #f7fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.color-legend-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 34px 62px minmax(0, 1fr);
  min-width: 0;
}

.color-legend-row input[type="color"] {
  height: 34px;
  padding: 3px;
  width: 54px;
}

.color-legend-row input:not([type="color"]) {
  min-height: 34px;
  min-width: 0;
  width: 100%;
}

.lesson-attendance-control {
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  padding: 4px;
}

.lesson-attendance-control button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-height: 34px;
  min-width: 0;
  padding: 0 8px;
}

.lesson-attendance-control button.active {
  background: #fff;
  box-shadow: 0 8px 18px rgba(22, 34, 51, 0.08);
  color: var(--brand-dark);
}

.lesson-payment-check {
  align-items: center;
  background: #f9fcfd;
  border: 1px solid #dcecf3;
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  white-space: nowrap;
}

.lesson-payment-check input {
  accent-color: var(--brand);
  height: 16px;
  width: 16px;
}

.tone-blue {
  --lesson-color: #1976d2;
  --lesson-bg: #eef7ff;
}

.tone-green {
  --lesson-color: #16865f;
  --lesson-bg: #effbf6;
}

.tone-violet {
  --lesson-color: #7a54d8;
  --lesson-bg: #f5f1ff;
}

.tone-amber {
  --lesson-color: #b86d00;
  --lesson-bg: #fff7e9;
}

.tone-cyan {
  --lesson-color: #0787a4;
  --lesson-bg: #edfaff;
}

@media (max-width: 860px) {
  .lesson-student-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .lesson-color-control {
    justify-content: flex-start;
  }

  .lesson-payment-check {
    justify-content: flex-start;
  }
}

.month-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  overflow-x: auto;
  padding-bottom: 4px;
}

.month-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
  text-transform: uppercase;
}

.month-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(32, 53, 78, 0.05);
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 10px;
}

.today-month-day {
  border-color: rgba(39, 161, 195, 0.55);
  box-shadow: 0 12px 28px rgba(39, 161, 195, 0.15);
}

.empty-month-day {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  min-height: 116px;
}

.month-day-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.month-day-head strong {
  color: var(--brand-dark);
}

.month-day-head span {
  background: #f1f5f8;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  min-width: 22px;
  padding: 3px 7px;
  text-align: center;
}

.month-day button,
.month-day small {
  --lesson-color: var(--brand);
  --lesson-bg: var(--soft);
  background: var(--lesson-bg);
  border-left: 3px solid var(--lesson-color);
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  display: grid;
  font-size: 12px;
  gap: 2px;
  padding: 5px 6px;
  text-align: left;
}

.month-day button time {
  color: var(--lesson-color);
  font-weight: 900;
}

.month-day button span {
  font-weight: 800;
}

.month-lesson-teacher {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-day small {
  background: #f7f8fa;
  border-left: 0;
  color: var(--muted);
}

.month-day button:hover {
  background: #eaf8fe;
  color: var(--brand-dark);
}

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

.year-month {
  background: linear-gradient(180deg, #fff 0%, #f9fbfd 100%);
  border: 1px solid #e0e8ee;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(32, 53, 78, 0.06);
  display: grid;
  gap: 8px;
  padding: 16px;
}

.year-month span {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 900;
}

.year-month small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.year-month i {
  background: #edf1f5;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
  position: relative;
}

.year-month i::after {
  background: linear-gradient(90deg, var(--brand), #f5b85a);
  border-radius: inherit;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: var(--load);
}

.integration-card {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.status-dot {
  background: var(--warning);
  border-radius: 99px;
  flex: 0 0 auto;
  height: 12px;
  margin-top: 4px;
  width: 12px;
}

.status-dot.connected {
  background: var(--success);
}

.chat-import {
  min-height: 190px;
  padding: 14px;
  resize: vertical;
  width: 100%;
}

.dev-import {
  display: none;
}

.connection-flow {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.whatsapp-control-panel {
  align-content: start;
}

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

.recipient-search-card {
  background: #eef7fb;
  border: 2px solid #8fc7d8;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(31, 112, 136, 0.12);
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
}

.recipient-search-card .field-label {
  color: #1f4f5f;
  font-size: 13px;
  margin: 0;
}

.recipient-search-box {
  align-items: center;
  background: #fff;
  border: 2px solid #2f7f97;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(31, 112, 136, 0.14);
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 56px;
  padding: 0 14px;
}

.recipient-search-box span {
  align-items: center;
  background: #2f7f97;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 19px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.recipient-search-box:focus-within {
  box-shadow: 0 0 0 4px rgba(143, 199, 216, 0.32), 0 14px 30px rgba(31, 112, 136, 0.16);
}

.quick-message {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  text-align: left;
}

.quick-message.active,
.quick-message:hover {
  border-color: var(--success);
  box-shadow: inset 0 0 0 1px var(--success);
}

.quick-message strong {
  font-size: 16px;
}

.quick-message span {
  color: var(--muted);
  font-size: 13px;
}

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

.whatsapp-recipient-search {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-weight: 800;
  min-height: 50px;
  min-width: 0;
  padding: 0;
  width: 100%;
}

.whatsapp-recipient-search:focus {
  box-shadow: none;
  outline: 0;
}

.recipient-results {
  background: #fff;
  border: 1px solid #d8e8ee;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 8px;
}

.recipient-results button {
  background: #f8fbfd;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
}

.recipient-results button.active,
.recipient-results button:hover {
  border-color: var(--success);
  background: #f2fbf7;
  box-shadow: inset 0 0 0 1px var(--success);
}

.recipient-results span {
  color: var(--muted);
  font-size: 13px;
}

.custom-message-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 120px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.template-help {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.template-reset {
  justify-self: start;
  min-height: 32px;
  padding: 0;
}

.connection-step {
  align-items: flex-start;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 34px 1fr;
  padding: 14px;
}

.connection-step > span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.connection-step.done {
  border-color: #bcebdc;
}

.connection-step.done > span {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.connection-step p {
  color: var(--muted);
  margin: 5px 0 0;
}

.connection-settings {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin: 16px 0;
}

.connection-settings label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.connection-settings input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 14px;
}

.phone-preview {
  background: #e7f7ee;
  border: 1px solid #ccebdc;
  border-radius: 8px;
  min-height: 430px;
  padding: 16px;
}

.phone-preview .button-row {
  display: grid;
  grid-template-columns: 1fr;
}

.phone-top {
  background: #075e54;
  border-radius: 8px 8px 0 0;
  color: #fff;
  font-weight: 800;
  margin-bottom: 16px;
  padding: 14px;
}

.field-label {
  color: #426256;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin: 12px 0 6px;
  text-transform: uppercase;
}

.select {
  width: 100%;
}

.message-bubble {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  line-height: 1.45;
  margin: 18px 0;
  padding: 16px;
  white-space: pre-line;
}

.whatsapp-queue-panel {
  background: #fff;
  border: 1px solid #bfe4d3;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 168, 132, 0.1);
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
}

.queue-empty,
.queue-current,
.queue-head {
  display: grid;
  gap: 3px;
}

.queue-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.queue-head span,
.queue-empty span,
.queue-current span {
  color: var(--muted);
  font-size: 13px;
}

.queue-head span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.queue-head strong {
  background: #e7f7ee;
  border-radius: 999px;
  color: #087b63;
  font-size: 13px;
  padding: 5px 9px;
}

.queue-current {
  background: #f5fbf8;
  border: 1px solid #d5efe2;
  border-radius: 8px;
  padding: 10px;
}

.business-kpi-grid,
.business-workspace {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.business-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  margin-bottom: 18px;
}

.business-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.business-connect-panel .panel-head,
.business-ai-panel .panel-head {
  align-items: flex-start;
}

.business-connect-panel .panel-head p,
.business-ai-panel .panel-head p,
.business-workspace .panel-head p,
.business-automation-panel .panel-head p {
  color: var(--muted);
  margin: 6px 0 0;
}

.business-connect-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.business-connect-grid label,
.business-switch-list label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  text-transform: uppercase;
}

.business-connect-grid .full-field {
  grid-column: 1 / -1;
}

.business-connect-grid input {
  background: #fff;
  border: 1px solid #bfdceb;
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  text-transform: none;
}

.business-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.business-qr-box {
  align-items: center;
  background: #f4f9fc;
  border: 1px solid #d9e8ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 92px minmax(0, 1fr);
  margin-top: 16px;
  padding: 14px;
}

.business-qr {
  align-items: center;
  background:
    linear-gradient(90deg, #1f4f5f 8px, transparent 8px) 0 0 / 18px 18px,
    linear-gradient(#1f4f5f 8px, transparent 8px) 0 0 / 18px 18px,
    #fff;
  border: 1px solid #bcd7e4;
  border-radius: 8px;
  display: flex;
  height: 82px;
  justify-content: center;
}

.business-qr span {
  background: #fff;
  border-radius: 999px;
  color: var(--brand-dark);
  font-weight: 900;
  padding: 8px 10px;
}

.business-qr-box strong,
.business-inbox-list strong,
.business-template-list strong,
.business-automation-grid strong {
  color: var(--ink);
}

.business-qr-box p {
  color: var(--muted);
  font-weight: 700;
  margin: 5px 0 0;
}

.business-switch-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.business-switch-list label {
  align-items: center;
  background: #f8fbfd;
  border: 1px solid #d9e8ef;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
}

.business-switch-list input {
  accent-color: var(--brand);
  height: 18px;
  width: 18px;
}

.business-ai-draft {
  background: #102a33;
  border-radius: 8px;
  color: #effbff;
  font-weight: 700;
  line-height: 1.45;
  margin-top: 12px;
  min-height: 128px;
  padding: 14px;
  white-space: pre-line;
}

.business-inbox-list,
.business-template-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.business-payment-panel,
.business-outbox-panel {
  grid-column: 1 / -1;
}

.business-payment-list,
.business-outbox-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.business-payment-list article,
.business-outbox-list article {
  align-items: center;
  background: #f8fbfd;
  border: 1px solid #dcebf2;
  border-left: 4px solid #9fb7c2;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, .75fr) minmax(240px, 1.4fr) auto;
  padding: 12px;
}

.business-outbox-list article.sent {
  background: #f4faf7;
  border-left-color: #20a37a;
}

.business-payment-list article.priority {
  background: #f1fbff;
  border-left-color: var(--brand);
}

.business-payment-person span,
.business-payment-person small {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 3px;
}

.business-payment-list p,
.business-outbox-list p {
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
  white-space: pre-line;
}

.business-payment-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.business-payment-actions small {
  color: var(--muted);
  flex-basis: 100%;
  font-weight: 800;
  text-align: right;
}

.business-inbox-list article,
.business-template-list article {
  align-items: center;
  background: #f8fbfd;
  border: 1px solid #dcebf2;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.business-inbox-list span,
.business-template-list span {
  color: var(--brand-dark);
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin-top: 3px;
}

.business-inbox-list p,
.business-template-list p {
  color: var(--muted);
  font-weight: 700;
  margin: 6px 0 0;
}

.business-inbox-actions {
  align-items: end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.business-inbox-actions small {
  color: var(--muted);
  font-weight: 800;
}

.business-inbox-actions em {
  background: #e9f8ff;
  border: 1px solid #ccebf8;
  border-radius: 999px;
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 900;
  padding: 5px 9px;
}

.business-automation-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.business-automation-grid button {
  background: #f8fbfd;
  border: 1px solid #dcebf2;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  text-align: left;
}

.business-automation-grid button.active {
  background: #f1fbf7;
  border-color: var(--success);
  box-shadow: inset 0 0 0 1px var(--success);
}

.business-automation-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.wide {
  width: 100%;
}

.detection-card {
  align-items: center;
  background: #f5fbfd;
  border: 1px solid #c7e2ea;
  border-left: 5px solid #2f7f97;
  box-shadow: 0 10px 24px rgba(31, 112, 136, 0.08);
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.detection-list-head {
  align-items: center;
  background: #1f4f5f;
  border-radius: 8px;
  color: #fff;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 2px;
  padding: 13px 14px;
}

.detection-list-head::before {
  background: #8fd7e8;
  border-radius: 999px;
  content: "";
  height: 12px;
  width: 12px;
}

.detection-list-head > div {
  display: grid;
  gap: 3px;
  margin-right: auto;
}

.detection-list-head span {
  color: #cdeef6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detection-list-head strong {
  color: #fff;
  font-size: 18px;
}

.detection-clear-button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  min-height: 36px;
}

.detection-clear-button:hover,
.detection-clear-button:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #1f4f5f;
  outline: 0;
}

.detection-card-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detection-card-title span {
  background: #2f7f97;
  border: 1px solid #2f7f97;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}

.detection-card strong {
  color: #183640;
}

.detection-card p {
  color: #355e68;
  font-weight: 700;
}

.detection-card small {
  color: #2f7f97;
  font-weight: 700;
}

.button-row.compact {
  flex: 0 0 auto;
}

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

.modal {
  border: 0;
  border-radius: 8px;
  max-height: calc(100vh - 32px);
  max-width: min(620px, calc(100vw - 28px));
  overflow: auto;
  padding: 0;
  width: 620px;
}

.modal::backdrop {
  background: rgba(37, 50, 56, 0.35);
}

.modal-card {
  display: grid;
  gap: 18px;
  max-width: 100%;
  overflow: hidden;
  padding: 20px;
}

#paymentNoteForm .full-field {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  min-width: 0;
  text-transform: uppercase;
  width: 100%;
}

#paymentNoteForm .full-field span {
  display: block;
}

#paymentNoteForm textarea {
  background: #fff;
  border: 1px solid #bfdceb;
  border-radius: 8px;
  display: block;
  color: var(--ink);
  min-height: 150px;
  padding: 14px;
  resize: vertical;
  text-transform: none;
  width: 100%;
}

#paymentNoteStudent {
  color: var(--muted);
  font-weight: 800;
  margin: 6px 0 0;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.ai-drawer {
  bottom: 86px;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  width: var(--ai-width, min(560px, calc(100vw - 28px)));
  z-index: 8;
}

.ai-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ai-drawer-card {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  background: #fbfdff;
  border: 1px solid #d9e6ee;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: var(--ai-height, min(680px, calc(100vh - 112px)));
  max-height: min(780px, calc(100vh - 112px));
  min-height: 440px;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.ai-drawer.resizing .ai-drawer-card {
  user-select: none;
}

.ai-resize-handle {
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: nwse-resize;
  height: 24px;
  left: 10px;
  padding: 0;
  position: absolute;
  top: 10px;
  width: 24px;
  z-index: 2;
}

.ai-resize-handle::before {
  border-left: 2px solid #a8bdc8;
  border-top: 2px solid #a8bdc8;
  border-radius: 5px 0 0 0;
  content: "";
  height: 12px;
  left: 6px;
  position: absolute;
  top: 6px;
  width: 12px;
}

.ai-resize-handle:hover,
.ai-resize-handle:focus-visible {
  background: #eef6f7;
  outline: 0;
}

.ai-drawer-head {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e6eef3;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  padding: 15px 16px 13px 42px;
}

.ai-drawer-head span {
  color: #64748b;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-drawer-head h2 {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.05;
  margin-top: 2px;
}

.ai-drawer-head .icon-button {
  background: #f8fafc;
  border-color: #dbe7ee;
  color: #334155;
}

.ai-privacy-panel {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #edf3f7;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 16px;
}

.ai-safe-status {
  align-items: center;
  color: #334155;
  display: flex;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
}

.ai-safe-status span {
  background: #0f766e;
  border-radius: 999px;
  box-shadow: inset 0 0 0 4px #dff7f4;
  height: 18px;
  width: 18px;
}

.ai-privacy-panel small {
  background: #ecfeff;
  border: 1px solid #c8f3f4;
  border-radius: 999px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  text-align: right;
  white-space: nowrap;
}

.ai-response {
  align-content: start;
  background: #f6f8fb;
  border-bottom: 1px solid #e6eef3;
  border-top: 1px solid #edf3f7;
  display: grid;
  gap: 9px;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
}

.ai-empty-state,
.ai-answer,
.ai-user-message,
.ai-error {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  display: grid;
  gap: 5px;
  padding: 11px 13px;
}

.ai-answer {
  border-color: #e2e8f0;
  border-left: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  justify-self: start;
  max-width: 92%;
}

.ai-empty-state {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f8fcfc);
  border-color: #d9e8e7;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  justify-items: center;
  justify-self: center;
  max-width: 340px;
  padding: 22px 20px;
  text-align: center;
}

.ai-empty-mark {
  align-items: center;
  background: #0f766e;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  margin-bottom: 2px;
  width: 38px;
}

.ai-empty-state strong {
  color: #0f172a;
  font-size: 15px;
}

.ai-empty-state p {
  color: #64748b;
  max-width: 260px;
}

.ai-empty-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 6px;
}

.ai-empty-chips button {
  background: #eefafa;
  border: 1px solid #c8ece9;
  border-radius: 999px;
  color: #0f766e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  min-height: 30px;
  padding: 5px 9px;
}

.ai-empty-chips button:hover {
  background: #dff7f4;
  border-color: #98d9d3;
}

.ai-user-message {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  justify-self: end;
  max-width: 82%;
}

.ai-error {
  background: #fff7f6;
  border-color: #ffd6d1;
  border-left: 5px solid var(--danger);
}

.ai-empty-state p,
.ai-answer p,
.ai-user-message p,
.ai-error p {
  color: #526173;
  line-height: 1.35;
  margin: 0;
  white-space: pre-line;
}

.ai-answer strong,
.ai-user-message strong,
.ai-error strong {
  color: inherit;
  font-size: 12px;
  line-height: 1;
}

.ai-user-message p {
  color: #fff;
}

.ai-error p {
  color: #8f241d;
}

.ai-answer small {
  color: #0f766e;
  font-weight: 800;
}

.ai-billing-link {
  align-items: center;
  background: #111827;
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  text-decoration: none;
}

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

.ai-action-list article {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.ai-action-list small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.ai-prompt {
  background: transparent;
  border: 0;
  min-height: 42px;
  padding: 11px 12px;
  resize: none;
  width: 100%;
}

.ai-composer {
  align-items: end;
  background: #ffffff;
  border: 1px solid #dbe7ee;
  border-radius: 16px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin: 12px 16px 16px;
  padding: 4px;
}

.ai-composer:focus-within {
  border-color: #67c7c1;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.ai-send-button {
  background: #0f766e;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 900;
  margin: 0;
  min-height: 38px;
  padding: 0 14px;
}

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

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

.mobile-nav {
  display: none;
}

.ai-floating-button {
  align-items: center;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  bottom: 24px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  color: #fff;
  display: inline-flex;
  gap: 9px;
  min-height: 50px;
  padding: 0 17px 0 10px;
  position: fixed;
  right: 24px;
  z-index: 7;
}

.ai-floating-button span {
  align-items: center;
  background: #0f766e;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 34px;
}

.ai-floating-button strong {
  font-size: 15px;
  line-height: 1;
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  bottom: 24px;
  color: #fff;
  left: 50%;
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: 0.2s ease;
  z-index: 5;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 16px 86px;
  }

  .topbar,
  .section-head,
  .hero-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .student-profile-head,
  .student-profile-grid,
  .teacher-summary,
  .teacher-only-calendar,
  .teacher-week-list,
  .teacher-payroll-months {
    grid-template-columns: 1fr;
  }

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

  .student-profile-actions {
    flex-direction: column;
  }

  .payroll-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pipeline-flow-head {
    align-items: stretch;
    flex-direction: column;
  }

  .report-section-head,
  .student-report-list article {
    grid-template-columns: 1fr;
  }

  .home-command,
  .home-main-grid,
  .home-bottom-grid {
    grid-template-columns: 1fr;
  }

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

  .report-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .payroll-year-control {
    justify-content: space-between;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .top-action-button {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

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

  .calendar-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .date-jumpers,
  .period-control {
    width: 100%;
  }

  .date-jumpers select,
  .date-jumpers button,
  .period-control button {
    flex: 1;
  }

  .calendar-toolbar > span {
    text-align: left;
  }

  .calendar-grid {
    grid-template-columns: repeat(5, minmax(230px, 82vw));
  }

  .month-grid {
    grid-template-columns: repeat(7, minmax(132px, 1fr));
  }

  .year-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }

  .top-logo {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .stats-grid,
  .payment-summary,
  .ops-kpi-grid,
  .profit-kpi-grid,
  .map-kpi-grid,
  .business-kpi-grid,
  .profitability-controls,
  .profit-control-grid,
  .profit-layout,
  .profit-layout.bottom,
  .zone-layout,
  .area-map-layout,
  .area-map-layout.bottom,
  .commercial-actions,
  .course-filters,
  .payment-reminder-list,
  .portal-preview-layout,
  .attendance-grid,
  .ops-two-columns,
  .content-grid,
  .business-layout,
  .business-workspace,
  .import-layout,
  .whatsapp-layout,
  .whatsapp-status-grid {
    grid-template-columns: 1fr;
  }

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

  .business-payment-list article,
  .business-outbox-list article {
    grid-template-columns: 1fr;
  }

  .business-payment-actions {
    justify-content: flex-start;
  }

  .business-payment-actions small {
    text-align: left;
  }

  .mobile-nav {
    background: #fff;
    border-top: 1px solid var(--line);
    bottom: 0;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(8, 1fr);
    left: 0;
    padding: 8px;
    position: fixed;
    right: 0;
    z-index: 4;
  }

  .ai-floating-button {
    bottom: 92px;
    min-height: 46px;
    right: 14px;
  }

  .ai-drawer {
    bottom: 112px;
    left: auto;
    right: 10px;
    max-width: calc(100vw - 20px);
    width: var(--ai-width, min(560px, calc(100vw - 20px)));
  }

  .ai-drawer-card {
    border-radius: 18px;
    height: var(--ai-height, min(640px, calc(100vh - 132px)));
    max-height: calc(100vh - 132px);
    min-height: 420px;
  }

  .ai-response {
    min-height: 0;
  }

  .ai-drawer-head h2 {
    font-size: 22px;
  }

  .ai-privacy-panel {
    align-items: center;
    flex-direction: row;
  }

  .ai-privacy-panel small {
    text-align: right;
  }

  .mobile-nav button {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    min-height: 42px;
  }

  .mobile-nav button.active {
    background: #eaf8fe;
    color: var(--brand-dark);
  }

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

  .profit-donut {
    max-width: 190px;
  }

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

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

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

@media (max-width: 620px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background:
      radial-gradient(circle at 12% -6%, rgba(0, 168, 225, 0.12), transparent 28%),
      linear-gradient(180deg, #eef9fd 0%, #f6fbfd 44%, #eef7fb 100%);
  }

  .main {
    padding: 14px 12px 108px;
  }

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

  .home-brand-card,
  .home-kpi,
  .home-alert-panel,
  .home-economy-panel,
  .home-course-panel,
  .home-today-panel,
  .home-action-panel {
    padding: 14px;
  }

  .home-alert {
    grid-template-columns: 10px 1fr;
  }

  .home-alert em {
    grid-column: 2;
    grid-row: auto;
  }

  .home-cash-items {
    grid-template-columns: 1fr;
  }

  .home-trend-row {
    grid-template-columns: 32px minmax(0, 1fr) 74px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 18px;
  }

  .academy-title {
    gap: 10px;
  }

  .academy-title img {
    height: 44px;
    width: 44px;
  }

  .academy-title span {
    font-size: 20px;
  }

  h1 {
    font-size: 26px;
    line-height: 1.08;
  }

  .section-head {
    gap: 7px;
    margin-bottom: 14px;
  }

  .section-head h2,
  .panel-head h2 {
    font-size: 26px;
    line-height: 1.08;
  }

  .panel,
  .hero-strip,
  .profit-hero,
  .zone-hero {
    border-color: #d8e8f0;
    box-shadow: 0 12px 32px rgba(37, 50, 56, 0.07);
    padding: 16px;
  }

  .metric,
  .payment-summary article,
  .profit-kpi {
    min-height: 0;
    padding: 14px;
  }

  .stats-grid,
  .content-grid,
  .profit-kpi-grid,
  .map-kpi-grid,
  .payment-summary,
  .profit-control-grid,
  .payment-mix,
  .insight-grid,
  .whatsapp-status-grid {
    gap: 12px;
  }

  .panel-head {
    gap: 10px;
  }

  .panel-head .text-button#downloadTemplateBtn {
    align-self: flex-start;
    background: #eaf8fe;
    border: 1px solid #bde8f8;
    border-radius: 8px;
    font-size: 12px;
    min-height: 34px;
    padding: 0 10px;
    white-space: nowrap;
  }

  #alumnos .import-layout {
    display: none;
  }

  .top-actions {
    gap: 8px;
  }

  .top-action-button {
    border-color: #d8e8f0;
    box-shadow: 0 10px 24px rgba(37, 50, 56, 0.07);
    font-size: 12px;
    gap: 7px;
    min-height: 44px;
    padding: 0 10px 0 8px;
  }

  .top-action-button.backup {
    font-size: 12px;
    line-height: 1.05;
  }

  .top-action-button span {
    border-radius: 7px;
    flex-basis: 28px;
    font-size: 10px;
    height: 28px;
  }

  .mobile-nav {
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(191, 216, 228, 0.9);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px rgba(30, 50, 60, 0.14);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 9px 10px max(11px, env(safe-area-inset-bottom));
    scroll-padding: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav button {
    align-items: center;
    background: #f5fbfe;
    border: 1px solid #dcecf3;
    border-radius: 14px;
    color: #5f6f7b;
    display: grid;
    flex: 0 0 auto;
    gap: 4px;
    justify-items: center;
    min-height: 60px;
    min-width: 74px;
    padding: 7px 8px;
    scroll-snap-align: start;
  }

  .mobile-nav button span {
    align-items: center;
    background: #eaf8fe;
    border-radius: 10px;
    color: var(--brand-dark);
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    height: 26px;
    justify-content: center;
    width: 34px;
  }

  .mobile-nav button strong {
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    max-width: 58px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav button.active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    box-shadow: 0 12px 22px rgba(12, 113, 195, 0.24);
    color: #fff;
  }

  .mobile-nav button.active span {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
  }

  .student-profile-hero {
    padding: 14px;
  }

  .student-profile-topline,
  .student-profile-head {
    align-items: stretch;
  }

  .student-avatar {
    height: 62px;
    width: 62px;
    font-size: 22px;
  }

  .student-snapshot {
    grid-template-columns: 1fr;
  }

  .teachers-table,
  .courses-table,
  .payments-table {
    min-width: 0;
  }

  .teachers-table .table-row.header,
  .courses-table .table-row.header,
  .payments-table .table-row.header {
    display: none;
  }

  .teachers-table .table-row,
  .courses-table .table-row,
  .payments-table .table-row {
    align-items: start;
    background: #fff;
    border: 1px solid #bfd8e4;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(37, 50, 56, 0.08);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    margin: 12px 10px;
    padding: 12px;
  }

  .teachers-table .teacher-cell-main,
  .courses-table .course-cell-main,
  .payments-table .payment-cell-main {
    grid-column: 1 / -1;
  }

  .teachers-table .teacher-cell-contact,
  .teachers-table .teacher-cell-specialty,
  .teachers-table .teacher-cell-hours,
  .courses-table .course-cell-teacher,
  .courses-table .course-cell-modality,
  .courses-table .course-cell-students,
  .courses-table .course-cell-schedule,
  .payments-table .payment-cell-amount,
  .payments-table .payment-cell-method,
  .payments-table .payment-cell-due {
    color: var(--muted);
    font-size: 13px;
  }

  .teacher-cell-contact::before,
  .payment-cell-amount::before {
    content: "Contacto";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .payment-cell-amount::before {
    content: "Importe";
  }

  .payment-cell-method::before {
    content: "Forma pago";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .course-cell-teacher::before {
    content: "Profesor";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .course-cell-modality::before {
    content: "Modalidad";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .teacher-cell-specialty::before,
  .course-cell-students::before,
  .payment-cell-due::before {
    content: "Especialidad";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .payment-cell-due::before {
    content: "Vence";
  }

  .course-cell-students::before {
    content: "Alumnos";
  }

  .teacher-cell-hours::before,
  .course-cell-schedule::before,
  .payment-cell-status::before {
    content: "Horario";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .payment-cell-status::before {
    content: "Estado";
  }

  .course-cell-schedule::before {
    content: "Horario";
  }

  .teachers-table .row-actions,
  .courses-table .row-actions,
  .payments-table .row-actions {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .payments-table .row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .courses-table .row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teachers-table .row-action,
  .courses-table .row-action,
  .courses-table .danger-button,
  .payments-table .row-action {
    font-size: 12px;
    min-height: 38px;
    padding: 0 8px;
    width: 100%;
  }

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

  .students-table .table-row.header {
    display: none;
  }

  .students-table .table-row {
    align-items: start;
    background: #fff;
    border: 1px solid #bfd8e4;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(37, 50, 56, 0.08);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    margin: 12px 10px;
    padding: 12px;
  }

  .students-table .student-cell-main {
    grid-column: 1 / -1;
  }

  .students-table .student-name-link {
    font-size: 17px;
  }

  .students-table .student-cell-contact,
  .students-table .student-cell-group,
  .students-table .student-cell-whatsapp {
    color: var(--muted);
    font-size: 13px;
  }

  .students-table .student-cell-contact::before {
    content: "Familia";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .students-table .student-cell-group::before {
    content: "Grupo";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .students-table .student-cell-whatsapp {
    grid-column: 1 / -1;
  }

  .students-table .student-cell-whatsapp::before {
    content: "WhatsApp";
    color: var(--brand-dark);
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .students-table .student-cell-payment,
  .students-table .student-cell-status {
    justify-self: end;
  }

  .students-table .row-actions {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .students-table .row-action {
    font-size: 12px;
    min-height: 38px;
    padding: 0 8px;
    width: 100%;
  }

  h2 {
    font-size: 21px;
  }

  .profit-kpi-grid,
  .map-kpi-grid,
  .business-kpi-grid,
  .business-connect-grid,
  .profit-control-grid,
  .payment-mix,
  .insight-grid,
  .map-point-form,
  .business-automation-grid {
    grid-template-columns: 1fr;
  }

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

  .metric strong,
  .profit-kpi strong {
    font-size: 24px;
  }

  .metric small,
  .profit-kpi small {
    line-height: 1.25;
  }

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

  .profitability-controls {
    align-items: stretch;
  }

  .profit-hero h2,
  .zone-hero h2 {
    font-size: 30px;
    line-height: 1.08;
  }

  .profit-hero p:not(.eyebrow),
  .zone-hero p:not(.eyebrow),
  .whatsapp-status-card p {
    font-size: 16px;
    line-height: 1.35;
  }

  .collection-ring,
  .profit-donut {
    max-width: 170px;
  }

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

  .payment-summary article {
    padding: 14px;
  }

  .trend-chart {
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    min-height: 0;
  }

  .trend-chart article {
    background: #f8fbfc;
    border: 1px solid #dcecf3;
    border-radius: 8px;
    gap: 6px;
    padding: 8px 6px;
  }

  .trend-bars {
    border: 0;
    height: 86px;
    padding: 8px 6px 0;
  }

  .trend-bars span {
    width: 16px;
  }

  .trend-chart strong {
    font-size: 13px;
  }

  .trend-chart small {
    font-size: 11px;
  }

  .trend-legend {
    font-size: 12px;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .forecast-pill {
    align-self: flex-start;
    font-size: 12px;
    padding: 7px 10px;
    white-space: normal;
  }

  .trend-panel .panel-head {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .trend-panel .panel-head h2 {
    font-size: 24px;
    line-height: 1.05;
    text-align: left;
  }

  .trend-panel .panel-head p {
    font-size: 14px;
    line-height: 1.35;
    max-width: 36ch;
    text-align: center;
  }

  .trend-panel .forecast-pill {
    justify-self: center;
  }

  .calendar-panel,
  .calendar-toolbar,
  .calendar-grid,
  .month-grid,
  .year-grid {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .calendar-toolbar {
    padding: 12px;
  }

  .calendar-actions,
  .segmented-control,
  .date-jumpers,
  .period-control {
    min-width: 0;
  }

  .period-control {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .period-control strong {
    font-size: 17px;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .date-jumpers select,
  #calendarTeacherFilter {
    min-width: 0;
    width: 100%;
  }

  #calendarTeacherFilter,
  #calendarTodayBtn {
    grid-column: 1 / -1;
  }

  .period-control button,
  .date-jumpers button,
  .segmented-control button {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
  }

  .calendar-grid,
  .calendar-grid.week-view {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible;
  }

  .lesson-detail-toolbar {
    align-items: stretch;
    display: grid;
  }

  .lesson-student-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .lesson-payment-check {
    justify-content: flex-start;
  }

  .month-grid,
  .year-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible;
  }

  .month-head,
  .empty-month-day {
    display: none;
  }

  .day-column {
    min-width: 0;
    min-height: 0;
  }

  .calendar-day {
    min-height: 0;
  }

  .calendar-toolbar,
  .date-jumpers,
  .period-control {
    gap: 8px;
  }

  .calendar-toolbar > span {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .area-map-canvas {
    height: 360px;
    min-height: 360px;
  }

  .map-legend.floating {
    bottom: 10px;
    gap: 6px;
    left: 10px;
    max-width: calc(100% - 20px);
    padding: 8px;
  }

  .map-legend span {
    font-size: 11px;
  }

  .whatsapp-control-panel,
  .recipient-search-card {
    padding: 16px;
  }

  .recipient-search-box {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 54px;
    padding: 8px;
  }

  .recipient-search-box span {
    height: 34px;
    width: 34px;
  }

  .recipient-results {
    max-height: 280px;
  }

  .recipient-results button {
    padding: 12px;
  }

  .whatsapp-fields textarea {
    min-height: 170px;
  }

  .metric strong,
  .payment-summary strong,
  .profit-kpi strong {
    font-size: 24px;
  }

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

  .quick-message-grid {
    grid-template-columns: 1fr;
  }

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

  .button-row,
  .detection-card {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .ai-drawer {
    left: 10px;
    max-width: none;
    right: 10px;
    width: auto;
  }

  .ai-drawer-card {
    height: min(620px, calc(100vh - 132px));
  }

  .ai-drawer-head {
    padding-left: 16px;
  }

  .ai-resize-handle {
    display: none;
  }
}
