:root {
  --navy: #063b6d;
  --blue: #0f5f96;
  --cyan: #00a7d8;
  --orange: #ff8a2a;
  --magenta: #c037b7;
  --purple: #7254d8;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --sidebar-width: 268px;
  --bottom-nav-height: 74px;
  --font-stack: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --white: #ffffff;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root,
[data-theme="light"] {
  --navy-950: #042744;
  --cyan-soft: #dff6fc;
  --bg: #f5fafc;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --line: #d8e6ef;
  --line-strong: #bad2e4;
  --text: #13324a;
  --muted: #657d90;
  --muted-2: #8ca0b0;
  --success: #0d7a48;
  --success-bg: #e8f8ef;
  --warning: #996100;
  --warning-bg: #fff4d7;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --info-bg: #e8f5fb;
  --neutral-bg: #eef3f7;
  --neutral-text: #415b70;
  --purple-bg: #f2efff;
  --purple-text: #5842b7;
  --page-bg:
    radial-gradient(circle at top left, rgba(0, 167, 216, 0.13), transparent 32rem),
    linear-gradient(180deg, #fbfdfe 0%, var(--bg) 45%, #eef7fb 100%);
  --button-primary-bg: var(--navy);
  --button-primary-text: #ffffff;
  --button-secondary-bg: #edf6fb;
  --button-secondary-text: var(--navy);
  --button-ghost-text: var(--navy);
  --input-bg: #ffffff;
  --focus-ring: rgba(0, 167, 216, 0.16);
  --focus-outline: rgba(0, 167, 216, 0.42);
  --brand-mark-border: rgba(0, 167, 216, 0.25);
  --brand-mark-bg:
    linear-gradient(135deg, rgba(0, 167, 216, 0.18), rgba(255, 255, 255, 0.92)),
    #ffffff;
  --brand-mark-shadow: 0 10px 30px rgba(6, 59, 109, 0.1);
  --hero-bg:
    linear-gradient(135deg, rgba(6, 59, 109, 0.96), rgba(15, 95, 150, 0.88)),
    radial-gradient(circle at 80% 20%, rgba(0, 167, 216, 0.5), transparent 20rem);
  --hero-border: rgba(216, 230, 239, 0.78);
  --hero-text: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.82);
  --hero-chip-bg: rgba(255, 255, 255, 0.1);
  --hero-chip-border: rgba(255, 255, 255, 0.16);
  --decorative-ring: rgba(255, 255, 255, 0.24);
  --stat-orb: rgba(0, 167, 216, 0.09);
  --glass-surface: rgba(255, 255, 255, 0.86);
  --sidebar-bg: rgba(255, 255, 255, 0.82);
  --topbar-bg: rgba(245, 250, 252, 0.9);
  --nav-hover-bg: #f1f8fc;
  --nav-active-bg: linear-gradient(135deg, #e9f8fd, #f6fbfe);
  --card-bg: rgba(255, 255, 255, 0.92);
  --state-icon-bg: var(--cyan-soft);
  --skeleton-shine: rgba(255, 255, 255, 0.72);
  --skeleton-line: #eef5f9;
  --spinner-track: #d9edf6;
  --button-spinner-track: rgba(255, 255, 255, 0.45);
  --button-spinner-head: #ffffff;
  --toast-bg: rgba(255, 255, 255, 0.96);
  --modal-backdrop: rgba(4, 39, 68, 0.42);
  --bottom-nav-bg: rgba(255, 255, 255, 0.94);
  --mobile-more-bg: rgba(255, 255, 255, 0.98);
  --shadow-sm: 0 8px 24px rgba(6, 59, 109, 0.08);
  --shadow-md: 0 18px 48px rgba(6, 59, 109, 0.14);
}

[data-theme="dark"] {
  --navy: #dff7ff;
  --blue: #83d9f8;
  --navy-950: #071b2d;
  --cyan-soft: #123c52;
  --bg: #071b2d;
  --surface: #102b42;
  --surface-soft: #0c2439;
  --line: rgba(141, 190, 217, 0.22);
  --line-strong: rgba(141, 190, 217, 0.36);
  --text: #eef7fb;
  --muted: #a8bed0;
  --muted-2: #7893a8;
  --success: #7ee0a4;
  --success-bg: rgba(25, 135, 84, 0.18);
  --warning: #ffd37a;
  --warning-bg: rgba(255, 179, 71, 0.18);
  --danger: #ff9a90;
  --danger-bg: rgba(220, 53, 69, 0.18);
  --info-bg: rgba(0, 167, 216, 0.16);
  --neutral-bg: rgba(168, 190, 208, 0.13);
  --neutral-text: #c7d7e4;
  --purple-bg: rgba(114, 84, 216, 0.2);
  --purple-text: #c9befb;
  --page-bg:
    radial-gradient(circle at top left, rgba(0, 167, 216, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(114, 84, 216, 0.14), transparent 30rem),
    linear-gradient(180deg, #071b2d 0%, #0a2034 48%, #081827 100%);
  --button-primary-bg: linear-gradient(135deg, #0f5f96, #00a7d8);
  --button-primary-text: #f7fcff;
  --button-secondary-bg: rgba(0, 167, 216, 0.15);
  --button-secondary-text: #dff7ff;
  --button-ghost-text: #dff7ff;
  --input-bg: rgba(255, 255, 255, 0.055);
  --focus-ring: rgba(0, 167, 216, 0.24);
  --focus-outline: rgba(0, 167, 216, 0.58);
  --brand-mark-border: rgba(0, 167, 216, 0.38);
  --brand-mark-bg:
    linear-gradient(135deg, rgba(0, 167, 216, 0.26), rgba(255, 255, 255, 0.08)),
    #0b263d;
  --brand-mark-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  --hero-bg:
    linear-gradient(135deg, rgba(3, 23, 39, 0.98), rgba(6, 59, 109, 0.82)),
    radial-gradient(circle at 82% 18%, rgba(0, 167, 216, 0.34), transparent 21rem);
  --hero-border: rgba(141, 190, 217, 0.25);
  --hero-text: #f5fbff;
  --hero-muted: rgba(226, 243, 252, 0.82);
  --hero-chip-bg: rgba(255, 255, 255, 0.07);
  --hero-chip-border: rgba(255, 255, 255, 0.14);
  --decorative-ring: rgba(255, 255, 255, 0.16);
  --stat-orb: rgba(0, 167, 216, 0.12);
  --glass-surface: rgba(16, 43, 66, 0.84);
  --sidebar-bg: rgba(8, 27, 45, 0.86);
  --topbar-bg: rgba(7, 27, 45, 0.88);
  --nav-hover-bg: rgba(0, 167, 216, 0.11);
  --nav-active-bg: linear-gradient(135deg, rgba(0, 167, 216, 0.2), rgba(15, 95, 150, 0.16));
  --card-bg: rgba(16, 43, 66, 0.88);
  --state-icon-bg: rgba(0, 167, 216, 0.16);
  --skeleton-shine: rgba(255, 255, 255, 0.08);
  --skeleton-line: rgba(255, 255, 255, 0.075);
  --spinner-track: rgba(255, 255, 255, 0.16);
  --button-spinner-track: rgba(255, 255, 255, 0.34);
  --button-spinner-head: #ffffff;
  --toast-bg: rgba(12, 36, 57, 0.96);
  --modal-backdrop: rgba(2, 10, 18, 0.64);
  --bottom-nav-bg: rgba(8, 27, 45, 0.94);
  --mobile-more-bg: rgba(12, 36, 57, 0.98);
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 22px 58px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-stack);
  transition: background 180ms ease, color 180ms ease;
}

body.modal-open {
  overflow: hidden;
}

.sidebar,
.topbar,
.mobile-header,
.mobile-bottom-nav,
.mobile-more,
.login-panel,
.stat-card,
.action-card,
.data-card,
.filter-card,
.empty-state,
.error-state,
.loading-state,
.modal-card,
.toast,
input,
select,
textarea {
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
}

.btn-ghost {
  background: transparent;
  color: var(--button-ghost-text);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  padding: 7px 11px 7px 7px;
  box-shadow: none;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
}

.theme-toggle-track {
  width: 48px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px;
  transition: background 180ms ease, border-color 180ms ease;
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
}

.theme-toggle-thumb svg {
  width: 14px;
  height: 14px;
}

.theme-toggle-label {
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.theme-toggle-compact {
  width: 42px;
  min-width: 42px;
  height: 42px;
  justify-content: center;
  padding: 0;
}

.theme-toggle-compact .theme-toggle-track {
  width: 30px;
  height: 30px;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
}

.theme-toggle-compact .theme-toggle-thumb {
  transform: none;
}

.theme-toggle-compact .theme-toggle-label {
  display: none;
}

.theme-toggle-wide {
  width: 100%;
  justify-content: space-between;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  color-scheme: dark;
  padding: 12px 14px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

select option {
  background: #ffffff;
  color: #13324a;
}

[data-theme="dark"] select option {
  background: #102b42;
  color: #eef7fb;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color-scheme: light;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-outline);
  outline-offset: 3px;
}

svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

noscript {
  display: block;
  padding: 16px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 800;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--brand-mark-border);
  border-radius: 16px;
  background: var(--brand-mark-bg);
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.03em;
  box-shadow: var(--brand-mark-shadow);
}

.brand-logo {
  max-width: 178px;
  max-height: 54px;
  object-fit: contain;
}

.brand-logo-mark {
  width: 54px;
  height: auto;
  flex: 0 0 auto;
}

.official-logo.brand-logo-mark {
  width: 54px !important;
  max-width: 54px !important;
  flex: 0 0 54px;
  flex-basis: 54px !important;
  height: auto !important;
}

.sidebar .official-logo.official-logo-mark.brand-logo-mark {
  width: 54px !important;
  max-width: 54px !important;
  flex: 0 0 54px;
  height: auto !important;
}

.brand-copy {
  min-width: 0;
  overflow: hidden;
}

.brand-name {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-caption {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 54px);
}

.login-hero {
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--hero-border);
  border-radius: 34px;
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow-md);
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -130px auto;
  width: 340px;
  height: 340px;
  border: 1px solid var(--decorative-ring);
  border-radius: 52px;
  transform: rotate(18deg);
}

.login-hero .brand-mark,
.login-hero .brand-logo {
  background: var(--brand-mark-bg);
}

.login-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 64px 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.login-hero p {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0;
  color: var(--hero-muted);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 600;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.hero-metric {
  border: 1px solid var(--hero-chip-border);
  border-radius: 18px;
  background: var(--hero-chip-bg);
  padding: 14px;
  backdrop-filter: blur(14px);
}

.hero-metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.hero-metric span {
  color: var(--hero-muted);
  font-size: 12px;
  font-weight: 700;
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--glass-surface);
  box-shadow: var(--shadow-md);
  padding: clamp(24px, 4vw, 38px);
  backdrop-filter: blur(18px);
}

.login-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.login-panel h2 {
  margin: 28px 0 8px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.1;
}

.login-panel > p {
  margin: 0 0 26px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
}

.form-grid,
.filter-grid,
.draft-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 650;
}

.role-field {
  display: grid;
  gap: 10px;
}

.role-field-label {
  color: rgba(207, 220, 242, 0.86);
  font-size: 13px;
  font-weight: 850;
}

.role-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--input-bg);
}

.role-segment-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.role-segment-button.active {
  border-color: var(--line-strong);
  background: var(--button-secondary-bg);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.form-footer {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.login-error,
.inline-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
  line-height: 1.35;
}

.auth-note {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 167, 216, 0.1), transparent 30rem),
    radial-gradient(circle at 96% 12%, rgba(114, 84, 216, 0.08), transparent 24rem);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(3, 18, 38, 0.08), transparent 38%),
    var(--sidebar-bg);
  padding: 22px 18px;
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.sidebar > .brand-lockup-logo {
  min-height: 58px;
  flex: 0 0 auto;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  padding: 12px 13px;
  font-weight: 850;
  text-align: left;
  box-shadow: none;
}

.nav-button:hover {
  background: var(--nav-hover-bg);
  color: var(--navy);
  box-shadow: none;
}

.nav-button.active {
  border-color: var(--line-strong);
  background: var(--nav-active-bg);
  color: var(--navy);
  box-shadow: inset 4px 0 0 var(--cyan);
}

.nav-button svg {
  color: currentColor;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.user-chip {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 14px;
}

.user-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.user-chip strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
}

.main-frame {
  min-width: 0;
  padding-bottom: 34px;
}

.mobile-header {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 167, 216, 0.06), transparent 42%),
    var(--topbar-bg);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 4vw, 34px);
}

.topbar-title {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cyan);
}

.topbar h1,
.page-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p,
.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px clamp(20px, 4vw, 34px) 44px;
}

.view-stack {
  animation: viewIn 210ms ease both;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 18%, rgba(0, 167, 216, 0.18), transparent 20rem),
    linear-gradient(135deg, var(--card-bg), var(--surface-soft));
  box-shadow: var(--shadow-md);
  padding: clamp(18px, 3vw, 28px);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -110px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(0, 167, 216, 0.16);
  border-radius: 46%;
  transform: rotate(24deg);
  background: conic-gradient(from 210deg, rgba(255, 138, 42, 0.2), rgba(192, 55, 183, 0.16), rgba(0, 167, 216, 0.18), transparent 65%);
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.dashboard-hero p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}

.stat-card,
.action-card,
.data-card,
.filter-card,
.empty-state,
.error-state,
.loading-state,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 92px;
  border-radius: 0 0 0 90px;
  background: var(--stat-orb);
}

.stat-card span {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  color: var(--navy);
  font-size: 34px;
  line-height: 1;
}

.stat-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.action-card {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  color: var(--text);
  text-align: left;
}

.action-card:hover {
  border-color: var(--line-strong);
}

.action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--cyan-soft);
  color: var(--navy);
}

.action-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.action-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

.panel {
  display: grid;
  gap: 18px;
}

.filter-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: start;
}

.filter-grid .search-button {
  align-self: start;
  width: 100%;
  min-height: 49px;
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-group {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  min-height: 58px;
  display: grid;
  gap: 3px;
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
  text-align: left;
}

.tab-button strong {
  color: var(--text);
  font-size: 14px;
}

.tab-button span {
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tab-button.active {
  border-color: var(--cyan);
  background: var(--nav-active-bg);
  color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--cyan);
}

.supervisor-tab-panel {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.data-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  animation: cardIn 220ms ease both;
}

.data-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cyan);
}

.data-card.card-warning::before {
  background: var(--orange);
}

.data-card.card-success::before {
  background: var(--success);
}

.data-card.card-danger::before {
  background: var(--danger);
}

.data-card.card-purple::before {
  background: var(--purple);
}

.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title {
  min-width: 0;
}

.card-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.card-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.kv-item {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kv-item strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 850;
  overflow-wrap: break-word;
  word-break: normal;
}

.supervisor-stack {
  display: grid;
  gap: 18px;
}

.supervisor-metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title-row h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.08;
}

.class-summary-card {
  grid-column: 1 / -1;
}

.class-summary-list {
  display: grid;
  gap: 8px;
}

.class-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.class-summary-row span {
  color: var(--muted);
  font-weight: 800;
}

.class-summary-row strong {
  color: var(--text);
  font-size: 18px;
}

.productivity-history-card {
  grid-column: 1 / -1;
}

.supervisor-kpi-card {
  grid-column: 1 / -1;
}

.supervisor-analysis-card {
  grid-column: 1 / -1;
}

.operational-contract-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 14px;
  margin-top: 16px;
}

.operational-contract-list .data-card {
  min-height: 100%;
}

.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.kpi-mini-grid .stat-card {
  min-height: 118px;
  padding: 14px;
  border-radius: 16px;
}

.kpi-mini-grid .stat-card strong {
  font-size: clamp(22px, 3vw, 34px);
}

.productivity-chart {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 10px;
}

.productivity-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1.4;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 6 8;
}

.chart-bar {
  fill: rgba(0, 184, 230, 0.22);
}

.chart-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--cyan);
  stroke-width: 3;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.history-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.1fr) repeat(5, minmax(86px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.history-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.history-row strong {
  color: var(--text);
}

.history-head {
  background: transparent;
}

.supervisor-carga {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.compact-items {
  display: grid;
  gap: 8px;
}

.compact-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.compact-item strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.compact-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.contract-material-card {
  grid-column: 1 / -1;
}

.material-items {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.material-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(86px, 0.65fr));
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
}

.material-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.material-main strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}

.material-main span,
.material-info small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.material-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.material-info strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.grouped-contract-card {
  grid-column: span 2;
}

.contract-os-list {
  display: grid;
  gap: 10px;
}

.contract-os-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 10px;
}

.contract-os-row.read-only {
  grid-template-columns: minmax(0, 1fr) auto;
}

.contract-os-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.contract-os-main strong {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.contract-os-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.compact-action {
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
  justify-self: start;
}

.badge-info,
.status-info {
  background: var(--info-bg);
  color: var(--navy);
}

.badge-success,
.status-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning,
.status-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger,
.status-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-neutral,
.status-neutral {
  background: var(--neutral-bg);
  color: var(--neutral-text);
}

.badge-purple {
  background: var(--purple-bg);
  color: var(--purple-text);
}

.empty-state,
.error-state,
.loading-state {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  text-align: center;
}

.state-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--state-icon-bg);
  color: var(--navy);
}

.error-state .state-icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.empty-state h3,
.error-state h3,
.loading-state h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.empty-state p,
.error-state p,
.loading-state p {
  max-width: 430px;
  margin: 8px auto 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.skeleton-card {
  height: 174px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, transparent, var(--skeleton-shine), transparent),
    linear-gradient(var(--skeleton-line) 26px, transparent 0),
    linear-gradient(var(--skeleton-line) 15px, transparent 0),
    linear-gradient(var(--skeleton-line) 14px, transparent 0),
    var(--card-bg);
  background-size: 190px 100%, 54% 26px, 84% 15px, 64% 14px, 100% 100%;
  background-position: -190px 0, 18px 18px, 18px 62px, 18px 96px, 0 0;
  background-repeat: no-repeat;
  animation: skeleton 1.2s ease-in-out infinite;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--spinner-track);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 780ms linear infinite;
}

.button-spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid var(--button-spinner-track);
  border-top-color: var(--button-spinner-head);
  border-radius: 50%;
  animation: spin 780ms linear infinite;
  vertical-align: -3px;
}

.detail-box {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.route-contract-card .kv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-contract-detail {
  display: grid;
  gap: 14px;
}

.route-os-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.route-os-detail-list .data-card {
  min-height: 100%;
}

.campo-form,
.campo-detail,
.campo-section {
  display: grid;
  gap: 16px;
}

.campo-base-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.campo-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
}

.campo-section .section-title-row h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.campo-item-list {
  display: grid;
  gap: 10px;
}

.campo-item-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-bg);
  padding: 12px;
}

.compact-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.compact-field input,
.compact-field select {
  min-height: 42px;
}

.supervisor-card-actions .btn-secondary {
  flex: 1 1 150px;
  justify-content: center;
}

.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--toast-bg);
  padding: 13px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 200ms ease both;
}

.toast strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.toast span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.toast-success {
  border-color: rgba(13, 122, 72, 0.2);
}

.toast-warning {
  border-color: rgba(255, 138, 42, 0.25);
}

.toast-error {
  border-color: rgba(180, 35, 24, 0.22);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--modal-backdrop);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
}

.mobile-bottom-nav,
.mobile-more {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes skeleton {
  to {
    background-position: calc(100% + 190px) 0, 18px 18px, 18px 62px, 18px 96px, 0 0;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .dashboard-grid,
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    background: var(--page-bg);
  }

  .login-page {
    display: block;
    min-height: 100vh;
    width: 100%;
    padding: 18px;
  }

  .login-hero {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: auto;
    padding: 22px;
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
  }

  .login-hero > *,
  .login-panel > * {
    min-width: 0;
  }

  .login-hero h1 {
    margin: 34px 0 12px;
    max-width: 100%;
    font-size: 34px;
    overflow-wrap: anywhere;
  }

  .login-hero p,
  .login-panel h2,
  .login-panel p,
  .brand-name {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .login-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 16px;
    border-radius: 24px;
    padding: 22px;
  }

  .layout {
    display: block;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 18px);
  }

  .sidebar,
  .topbar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 16;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--topbar-bg);
    padding: 12px 14px;
    backdrop-filter: blur(16px);
  }

  .mobile-header .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    font-size: 11px;
  }

  .mobile-header .brand-logo-mark,
  .mobile-header .official-logo.brand-logo-mark {
    width: 40px !important;
    max-width: 40px !important;
    flex-basis: 40px !important;
  }

  .mobile-header .brand-name {
    font-size: 16px;
  }

  .mobile-header .brand-caption {
    font-size: 11px;
  }

  .content {
    padding: 18px 14px 26px;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .dashboard-hero button {
    width: 100%;
  }

  .page-header {
    display: grid;
    gap: 12px;
  }

  .topbar h1,
  .page-header h2 {
    font-size: 25px;
  }

  .dashboard-grid,
  .action-grid,
  .cards-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .kv {
    grid-template-columns: 1fr;
  }

  .material-row {
    grid-template-columns: 1fr;
  }

  .grouped-contract-card {
    grid-column: auto;
  }

  .contract-os-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-action {
    width: 100%;
    justify-content: center;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid .search-button {
    margin-top: 0;
  }

  .campo-base-grid,
  .campo-item-row {
    grid-template-columns: 1fr;
  }

  .tab-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-button {
    min-width: 0;
  }

  .history-row {
    grid-template-columns: 1fr 1fr;
  }

  .history-head {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 18;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bottom-nav-bg);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }

  .bottom-button {
    min-height: 58px;
    display: grid;
    place-items: center;
    gap: 3px;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 900;
    box-shadow: none;
  }

  .bottom-button svg {
    width: 19px;
    height: 19px;
  }

  .bottom-button.active {
    background: var(--state-icon-bg);
    color: var(--navy);
  }

  .mobile-more {
    position: fixed;
    inset: auto 10px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 8px) 10px;
    z-index: 19;
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(0, 167, 216, 0.08), transparent 42%),
      var(--mobile-more-bg);
    padding: 10px;
    box-shadow: var(--shadow-md);
    transform-origin: bottom center;
    animation: cardIn 180ms ease both;
  }

  .mobile-more::before {
    content: "";
    width: 42px;
    height: 4px;
    justify-self: center;
    border-radius: 999px;
    background: var(--line-strong);
  }

  .mobile-more-head {
    display: grid;
    gap: 2px;
    padding: 4px 6px 8px;
  }

  .mobile-more-head strong {
    color: var(--text);
    font-size: 15px;
  }

  .mobile-more-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-more[hidden] {
    display: none;
  }

  .toast-host {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 420px) {
  .login-page {
    padding: 12px;
  }

  .login-hero {
    padding: 18px;
  }

  .login-hero h1 {
    font-size: 30px;
  }

  .login-panel h2 {
    font-size: 26px;
  }

  .data-card,
  .filter-card,
  .stat-card,
  .action-card {
    border-radius: 16px;
  }
}

.premium-login-page {
  --login-bg: #020a1c;
  --login-bg-soft: #03122a;
  --login-surface: rgba(7, 23, 48, 0.86);
  --login-surface-strong: rgba(9, 27, 55, 0.9);
  --login-border: rgba(116, 151, 220, 0.22);
  --login-border-strong: rgba(119, 160, 230, 0.34);
  --login-text: #f5f9ff;
  --login-muted: #a8b7cf;
  --login-input: rgba(3, 15, 34, 0.66);
  --login-input-focus: rgba(0, 167, 216, 0.14);
  --login-shadow: 0 34px 110px rgba(0, 0, 0, 0.42);
  --login-gradient: linear-gradient(92deg, #1434ff 0%, #096af7 56%, #18c3e8 100%);
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: none;
  place-items: center;
  margin: 0;
  padding: clamp(20px, 2.9vw, 48px);
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 10%, rgba(0, 70, 160, 0.22), transparent 31rem),
    radial-gradient(circle at 96% 94%, rgba(3, 64, 150, 0.22), transparent 28rem),
    linear-gradient(135deg, var(--login-bg) 0%, #020d21 45%, #031026 100%);
  color: var(--login-text);
}

[data-theme="light"] .premium-login-page {
  --login-panel-bg: #ffffff;
  --login-panel-text: #073b6c;
  --login-panel-muted: #5f7690;
  --login-panel-border: rgba(6, 59, 109, 0.14);
  --login-panel-input: #f8fbfd;
  --login-panel-input-text: #13324a;
  --login-panel-input-muted: #71869a;
  --login-panel-shadow: 0 24px 70px rgba(6, 59, 109, 0.16);
}

[data-theme="dark"] .premium-login-page {
  --login-panel-bg: rgba(7, 24, 52, 0.76);
  --login-panel-text: #f5f9ff;
  --login-panel-muted: #9eb3cc;
  --login-panel-border: var(--login-border);
  --login-panel-input: var(--login-input);
  --login-panel-input-text: #f5f9ff;
  --login-panel-input-muted: #8aa1bb;
  --login-panel-shadow: var(--login-shadow);
}

.login-shell {
  position: relative;
  isolation: isolate;
  width: min(1575px, 94vw);
  min-height: min(850px, 91dvh);
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(470px, 0.98fr);
  overflow: hidden;
  border: 1px solid rgba(126, 165, 232, 0.34);
  border-radius: 30px;
  background:
    radial-gradient(circle at 16% 8%, rgba(26, 73, 145, 0.2), transparent 35rem),
    radial-gradient(circle at 84% 58%, rgba(18, 55, 109, 0.2), transparent 30rem),
    linear-gradient(135deg, rgba(5, 19, 43, 0.96), rgba(3, 12, 29, 0.97));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
}

.premium-brand-panel {
  min-height: auto;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: clamp(52px, 5.5vw, 92px) clamp(44px, 5.4vw, 90px);
  background:
    radial-gradient(circle at 22% 18%, rgba(0, 167, 216, 0.13), transparent 28rem),
    linear-gradient(135deg, rgba(9, 44, 91, 0.28), transparent 46%),
    transparent;
  box-shadow: none;
}

.premium-brand-panel::before {
  content: "";
  position: absolute;
  left: -22%;
  top: -14%;
  width: min(60vw, 840px);
  aspect-ratio: 0.9;
  border-radius: 48% 0 0 52%;
  transform: rotate(23deg);
  background:
    radial-gradient(ellipse at 42% 46%, transparent 0 45%, rgba(5, 22, 52, 0.58) 46% 54%, transparent 55%),
    conic-gradient(from 205deg, rgba(255, 138, 42, 0.72), rgba(192, 55, 183, 0.64), rgba(114, 84, 216, 0.45), rgba(0, 90, 210, 0.32), transparent 62%);
  opacity: 0.58;
  filter: saturate(1.06);
  z-index: -1;
}

.premium-brand-panel::after {
  content: "";
  position: absolute;
  inset: -6% auto auto 42%;
  width: min(28vw, 460px);
  aspect-ratio: 1;
  border: 1px solid rgba(0, 110, 240, 0.18);
  border-radius: 0;
  transform: skewX(-18deg) rotate(2deg);
  background:
    linear-gradient(132deg, transparent 28%, rgba(0, 80, 190, 0.18) 29% 31%, transparent 32%),
    linear-gradient(132deg, transparent 58%, rgba(0, 167, 216, 0.12) 59% 61%, transparent 62%);
  opacity: 0.68;
  z-index: -1;
}

.abstract-layer,
.abstract-layer span {
  position: absolute;
  pointer-events: none;
}

.abstract-layer {
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.abstract-ribbon {
  width: 680px;
  height: 680px;
  border: 1px solid rgba(0, 167, 216, 0.12);
  border-radius: 50%;
  opacity: 0.46;
}

.ribbon-one {
  left: -350px;
  top: -30px;
  transform: rotate(-18deg);
  background:
    radial-gradient(circle at 52% 54%, transparent 0 54%, rgba(3, 17, 41, 0.76) 55% 64%, transparent 65%),
    conic-gradient(from 190deg, rgba(255, 138, 42, 0.55), rgba(192, 55, 183, 0.58), rgba(114, 84, 216, 0.36), rgba(0, 104, 235, 0.28), transparent 66%);
}

.ribbon-two {
  left: -270px;
  bottom: -335px;
  transform: rotate(18deg);
  background:
    radial-gradient(circle at 48% 48%, transparent 0 56%, rgba(3, 17, 41, 0.72) 57% 67%, transparent 68%),
    conic-gradient(from 260deg, rgba(0, 104, 235, 0.42), rgba(0, 167, 216, 0.18), transparent 48%);
}

.abstract-line {
  width: 420px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 167, 216, 0.32), transparent);
}

.line-one {
  right: 8%;
  top: 22%;
  transform: rotate(-42deg);
}

.line-two {
  right: 18%;
  bottom: 22%;
  transform: rotate(-24deg);
}

.brand-panel-content {
  width: min(620px, 100%);
  max-width: 620px;
  margin-left: clamp(46px, 6.4vw, 110px);
}

.hero-logo-wrap {
  display: grid;
  justify-items: center;
  width: min(350px, 100%);
  margin: 0 0 clamp(26px, 3vw, 38px) clamp(48px, 5.2vw, 90px);
}

.official-logo {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.official-logo-hero {
  width: clamp(150px, 12vw, 190px);
  height: auto;
}

.official-logo-card {
  width: min(292px, 72vw);
  height: auto;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}

.login-brand-mark {
  width: clamp(82px, 7.2vw, 112px);
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.login-brand span {
  color: #18b8f4;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 850;
  letter-spacing: 0.22em;
  line-height: 1;
  white-space: nowrap;
}

.hero-wordmark {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 18px;
}

.hero-wordmark-main {
  color: #ffffff;
  font-size: clamp(34px, 3.7vw, 54px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.22em;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.hero-wordmark-sub {
  color: #18b8f4;
  font-size: clamp(13px, 1.35vw, 19px);
  font-weight: 750;
  letter-spacing: 0.66em;
  padding-left: 0.66em;
}

.premium-headline {
  display: grid;
  gap: 0;
  max-width: 640px;
  color: #ffffff;
  font-size: clamp(38px, 3.02vw, 50px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.018em;
}

.headline-gradient {
  width: fit-content;
  background: linear-gradient(92deg, #ff8a2a 0%, #f133c4 32%, #7254d8 58%, #00a7d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.headline-rule {
  display: block;
  width: 224px;
  height: 3px;
  margin: 26px 0 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a2a 0%, #f133c4 42%, #124cff 74%, #00a7d8 100%);
  box-shadow: 0 0 24px rgba(0, 167, 216, 0.18);
}

.hero-description {
  max-width: 470px;
  margin: 0;
  color: rgba(212, 226, 246, 0.82);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}

.premium-login-page .hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(34px, 4.7vw, 62px);
}

.mobile-benefits {
  display: none;
}

.premium-login-page .hero-metric {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  backdrop-filter: none;
}

.hero-metric-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 167, 216, 0.32);
  border-radius: 13px;
  color: #00a7d8;
  background: rgba(0, 167, 216, 0.08);
}

.premium-login-page .hero-metric:nth-child(1) .hero-metric-icon {
  border-color: rgba(255, 138, 42, 0.5);
  color: #ff8a2a;
}

.premium-login-page .hero-metric:nth-child(2) .hero-metric-icon {
  border-color: rgba(192, 55, 183, 0.5);
  color: #c037b7;
}

.hero-metric-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.premium-login-page .hero-metric strong {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.premium-login-page .hero-metric span span,
.hero-metric-copy > span {
  color: rgba(226, 243, 252, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.login-panel-zone {
  position: relative;
  display: grid;
  align-content: center;
  padding: clamp(36px, 4vw, 48px) clamp(72px, 6.8vw, 110px) clamp(36px, 4vw, 48px) clamp(10px, 1vw, 14px);
}

.login-theme-row {
  position: absolute;
  top: clamp(18px, 2.5vw, 30px);
  right: clamp(22px, 3vw, 42px);
  z-index: 2;
  display: none;
}

.premium-login-card {
  width: min(580px, 100%);
  justify-self: center;
  border: 1px solid rgba(125, 159, 220, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 0%, rgba(45, 99, 170, 0.17), transparent 19rem),
    linear-gradient(145deg, rgba(12, 33, 67, 0.84), rgba(5, 17, 39, 0.82)),
    var(--login-panel-bg);
  color: var(--login-panel-text);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: clamp(30px, 2.7vw, 36px) clamp(48px, 4.2vw, 62px);
  backdrop-filter: blur(20px);
}

.premium-login-card .login-panel-head {
  margin-bottom: 28px;
}

.premium-login-card h2 {
  margin: 0 0 14px;
  color: var(--login-panel-text);
  font-size: clamp(28px, 1.95vw, 34px);
  font-weight: 820;
  line-height: 1.08;
}

.premium-login-card > p {
  max-width: 390px;
  margin: 0 0 24px;
  color: rgba(207, 220, 242, 0.8);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.55;
}

.premium-login-form {
  display: grid;
  gap: 14px;
}

.premium-field label {
  margin-bottom: 11px;
  color: rgba(207, 220, 242, 0.86);
  font-size: 13px;
  font-weight: 700;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell input {
  min-height: 56px;
  border: 1px solid rgba(133, 165, 220, 0.2);
  border-radius: 12px;
  background: rgba(4, 17, 39, 0.58);
  color: var(--login-panel-input-text);
  padding: 15px 54px;
}

.input-shell input::placeholder {
  color: var(--login-panel-input-muted);
}

.input-shell input:focus {
  border-color: #00a7d8;
  box-shadow: 0 0 0 4px rgba(0, 167, 216, 0.12);
  background: var(--login-panel-input);
}

.input-icon,
.password-toggle {
  position: absolute;
  z-index: 1;
  color: var(--login-panel-input-muted);
}

.input-icon {
  left: 18px;
  display: grid;
  place-items: center;
}

.password-toggle {
  right: 8px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.password-toggle:hover {
  color: #00a7d8;
  background: rgba(0, 167, 216, 0.1);
  box-shadow: none;
}

.login-submit {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  border-radius: 12px;
  background: var(--login-gradient);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 97, 255, 0.24);
  font-size: 16px;
  font-weight: 800;
}

.login-submit:hover {
  box-shadow: 0 20px 46px rgba(0, 167, 216, 0.26);
}

.security-divider {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  gap: 14px;
  margin: 24px 0 14px;
}

.security-divider span {
  height: 1px;
  background: var(--login-panel-border);
}

.security-divider i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 167, 216, 0.32);
  border-radius: 999px;
  color: #00a7d8;
  background: rgba(0, 167, 216, 0.08);
  font-style: normal;
}

.premium-login-card .auth-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0;
  border: 1px solid rgba(133, 165, 220, 0.18);
  border-radius: 12px;
  background: rgba(9, 29, 61, 0.66);
  color: rgba(207, 220, 242, 0.82);
  padding: 14px 18px;
}

.auth-note-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #00a7d8;
}

.premium-login-card .auth-note p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.premium-login-card .auth-note strong {
  font-weight: 760;
}

.premium-login-card .login-error {
  color: var(--danger);
}

[data-theme="light"] .premium-login-card {
  border-color: rgba(6, 59, 109, 0.14);
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 167, 216, 0.12), transparent 19rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.96));
  color: var(--login-panel-text);
  box-shadow: var(--login-panel-shadow);
}

[data-theme="light"] .premium-login-card > p,
[data-theme="light"] .premium-field label,
[data-theme="light"] .role-field-label,
[data-theme="light"] .premium-login-card .auth-note {
  color: var(--login-panel-muted);
}

[data-theme="light"] .input-shell input {
  border-color: var(--login-panel-border);
  background: var(--login-panel-input);
  color: var(--login-panel-input-text);
}

[data-theme="light"] .premium-login-card .auth-note {
  border-color: var(--login-panel-border);
  background: #f8fbfd;
}

@media (max-width: 1180px) {
  .login-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  }

  .premium-brand-panel {
    padding: 42px;
  }

  .premium-headline {
    font-size: clamp(38px, 5vw, 58px);
  }

  .premium-login-page .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .premium-login-page {
    display: block;
    width: 100vw;
    min-height: 100dvh;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    overflow-x: hidden;
  }

  .login-shell {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: 100dvh;
    display: block;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 12% 0%, rgba(0, 167, 216, 0.18), transparent 20rem),
      linear-gradient(180deg, var(--login-bg) 0%, var(--login-bg-soft) 100%);
    box-shadow: none;
  }

  .premium-brand-panel {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    display: block;
    padding: 16px 18px 4px;
    background: transparent;
    overflow: visible;
  }

  .premium-brand-panel::after,
  .abstract-layer {
    display: none;
  }

  .brand-panel-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: left;
    box-sizing: border-box;
  }

  .hero-logo-wrap {
    width: 100%;
    max-width: 100%;
    justify-items: start;
    margin: 0 0 10px;
  }

  .official-logo-hero {
    width: min(170px, 48vw);
    max-width: 100%;
    object-fit: contain;
  }

  .hero-wordmark {
    justify-items: start;
    gap: 3px;
    margin-top: 6px;
  }

  .hero-wordmark-main {
    font-size: clamp(23px, 7.4vw, 31px);
  }

  .hero-wordmark-sub {
    font-size: clamp(9px, 2.9vw, 12px);
  }

  .product-kicker {
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.24em;
  }

  .premium-headline {
    gap: 1px;
    max-width: 100%;
    font-size: clamp(26px, 7.6vw, 34px);
    line-height: 1.04;
    overflow-wrap: normal;
    word-break: normal;
  }

  .premium-headline > span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: normal;
  }

  .headline-rule {
    width: min(150px, 48vw);
    height: 2px;
    margin: 12px 0 10px;
  }

  .hero-description {
    max-width: 100%;
    font-size: 12.5px;
    line-height: 1.38;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
  }

  .premium-login-page .hero-metrics {
    display: none;
  }

  .login-panel-zone {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }

  .login-theme-row {
    position: absolute;
    top: 22px;
    right: 18px;
  }

  .premium-login-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-self: center;
    box-sizing: border-box;
    border-radius: 20px;
    padding: 18px;
  }

  .premium-login-card .login-panel-head {
    margin-bottom: 12px;
  }

  .login-brand {
    gap: 10px;
  }

  .login-brand-mark {
    width: min(76px, 22vw);
  }

  .login-brand span {
    font-size: clamp(11px, 3.2vw, 13px);
    letter-spacing: 0.18em;
    white-space: normal;
  }

  .premium-login-card h2 {
    margin-bottom: 9px;
    font-size: clamp(23px, 7vw, 28px);
    overflow-wrap: normal;
  }

  .premium-login-card > p {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.42;
    overflow-wrap: break-word;
  }

  .premium-login-form {
    gap: 11px;
  }

  .premium-field label {
    margin-bottom: 7px;
  }

  .input-shell input {
    min-height: 54px;
    padding: 13px 50px;
  }

  .login-submit {
    min-height: 54px;
  }

  .security-divider {
    margin: 16px 0 10px;
  }

  .premium-login-card .auth-note {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .auth-note-icon {
    width: 32px;
    height: 32px;
  }

  .premium-login-card .auth-note p {
    font-size: 12px;
  }

  .mobile-benefits {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    box-sizing: border-box;
  }

  .mobile-benefits .hero-metric {
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(133, 165, 220, 0.16);
    border-radius: 15px;
    background: rgba(9, 29, 61, 0.46);
    padding: 9px 12px;
    text-align: left;
  }

  .mobile-benefits .hero-metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .mobile-benefits .hero-metric-copy {
    justify-items: start;
    gap: 2px;
  }

  .mobile-benefits .hero-metric strong {
    font-size: 13px;
  }

  .mobile-benefits .hero-metric-copy > span {
    font-size: 10px;
    line-height: 1.2;
    overflow-wrap: break-word;
  }
}

@media (max-width: 420px) {
  .premium-login-page {
    padding: 0;
  }

  .premium-brand-panel {
    padding: 14px 16px 4px;
  }

  .login-panel-zone {
    padding-inline: 12px;
  }

  .premium-login-card {
    padding: 16px;
    border-radius: 18px;
  }

  .premium-headline {
    font-size: clamp(25px, 7.8vw, 31px);
  }

  .official-logo-hero {
    width: min(154px, 47vw);
  }

  .official-logo-card {
    width: min(170px, 56vw);
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}


/* ---- Visao do administrador (so consulta) */
.visao-banner {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 16px;
  background: var(--warning-bg);
  color: var(--warning);
  border-bottom: 1px solid var(--warning);
  font-size: 0.92rem;
}

.admin-block {
  margin-top: 20px;
}

.admin-block h3,
.admin-group h4 {
  margin: 0 0 10px;
}

.admin-group {
  margin-bottom: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.admin-person {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 52px;
  padding: 10px 14px;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border, #d4e1ea);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}

.admin-person span {
  font-size: 0.82rem;
  opacity: 0.75;
}

.admin-person:hover,
.admin-person:focus-visible {
  border-color: var(--warning);
  outline: none;
}


/* ---- Resumo por classe clicavel */
.class-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}

.class-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.class-chip span {
  color: var(--muted);
  font-weight: 800;
}

.class-chip strong {
  font-size: 22px;
}

.class-chip:hover,
.class-chip:focus-visible,
.class-chip.active {
  border-color: var(--warning, #996100);
  outline: none;
}

.class-chip.active {
  background: var(--warning-bg);
}

.class-chip.active span,
.class-chip.active strong {
  color: var(--warning);
}

.class-detail {
  margin-top: 14px;
}

.class-detail-title {
  margin: 0 0 12px;
}

.class-hint {
  margin: 8px 2px;
  color: var(--muted);
}


/* ================================================================
   Legibilidade e toque: tela para quem esta na rua (sol, polegar)
   ================================================================ */
body {
  font-size: 16px;
  line-height: 1.45;
}

.eyebrow,
.stat-card span,
.tab-button span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

.kv-item,
.field-hint,
.badge,
.status-pill,
.user-chip span,
.compact-item span,
.history-row span,
.contract-os-main span,
.brand-caption,
.field label,
.result-meta,
.card-title p,
.toast span,
.material-info strong,
.material-main span {
  font-size: 14px;
}

.kv-item strong {
  font-size: 16px;
}

.bottom-button {
  font-size: 13px;
}

.btn-secondary,
.btn-primary,
.login-submit,
.nav-button,
.tab-button,
select,
input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 48px;
}

.tab-button strong {
  font-size: 16px;
}

/* ---- Cores com significado fixo: verde ate 7 dias, amarelo 8-15, vermelho acima de 15 ou em cobranca */
.tom-success { --tom: var(--success); --tom-bg: var(--success-bg); }
.tom-warning { --tom: var(--warning); --tom-bg: var(--warning-bg); }
.tom-danger  { --tom: var(--danger);  --tom-bg: var(--danger-bg); }
.tom-info    { --tom: var(--accent, #0a8fb8); --tom-bg: var(--surface-soft); }

.legenda-prazos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.legenda-item {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tom);
  background: var(--tom-bg);
  border: 1px solid var(--tom);
}

/* ---- Cartao de terminal: numero grande, dias em destaque */
.terminal-list {
  display: grid;
  gap: 10px;
}

.terminal-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "main dias" "foot foot";
  gap: 8px 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--tom);
  border-radius: 14px;
  background: var(--surface);
}

.terminal-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.terminal-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.terminal-desc {
  font-size: 14px;
  color: var(--muted);
}

.terminal-dias {
  grid-area: dias;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 12px;
  color: var(--tom);
  background: var(--tom-bg);
}

.terminal-dias strong {
  font-size: 28px;
  line-height: 1;
}

.terminal-dias span {
  font-size: 13px;
  font-weight: 700;
}

.terminal-foot {
  grid-area: foot;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.terminal-aviso {
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.class-chip small {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.class-chip.tem-vencido {
  border-left: 6px solid var(--danger);
}

/* ---- Inicio do tecnico ("Meu dia") e da equipe do supervisor */
.meu-dia-aviso {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--tom);
  border-radius: 16px;
  color: var(--tom);
  background: var(--tom-bg);
}

.meu-dia-aviso strong {
  font-size: 20px;
}

.meu-dia-aviso span {
  font-size: 16px;
}

.meu-dia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.meu-dia-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 132px;
  padding: 16px 18px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--tom);
  border-radius: 16px;
  font: inherit;
}

button.meu-dia-tile {
  cursor: pointer;
}

button.meu-dia-tile:hover,
button.meu-dia-tile:focus-visible {
  outline: 2px solid var(--tom);
  outline-offset: 2px;
}

.meu-dia-numero {
  font-size: 48px;
  line-height: 1;
  color: var(--tom);
}

.meu-dia-rotulo {
  font-size: 18px;
  font-weight: 800;
}

.meu-dia-desc {
  font-size: 14px;
  color: var(--muted);
}

.meu-dia-rota {
  width: 100%;
  justify-content: center;
}

.atencao-lista {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.atencao-linha {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--tom);
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
}

.atencao-linha:hover,
.atencao-linha:focus-visible {
  outline: 2px solid var(--tom);
  outline-offset: 2px;
}

.atencao-bolinha {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tom);
}

.atencao-texto {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.atencao-texto strong {
  font-size: 16px;
}

.atencao-texto span {
  font-size: 14px;
  color: var(--tom);
  font-weight: 700;
}

.atencao-carga {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.atencao-carga strong {
  font-size: 22px;
}

.atencao-carga span {
  font-size: 13px;
  color: var(--muted);
}


/* ---- Blocos explicados da tela inicial e ficha do tecnico */
.bloco-modulo {
  margin: 0 0 22px;
}

.bloco-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.bloco-cab h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.bloco-explica {
  margin: 0;
  max-width: 62ch;
  font-size: 15px;
  color: var(--muted);
}

.bloco-nota {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--warning);
  background: var(--warning-bg);
}

/* ---- Celular: os 3 numeros de cada bloco ficam lado a lado (cabem numa olhada) */
@media (max-width: 520px) {
  .bloco-modulo .meu-dia-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .bloco-modulo .meu-dia-tile {
    min-height: 0;
    padding: 12px 10px;
  }

  .bloco-modulo .meu-dia-numero {
    font-size: 30px;
  }

  .bloco-modulo .meu-dia-rotulo {
    font-size: 15px;
    line-height: 1.2;
  }

  .bloco-modulo .meu-dia-desc {
    font-size: 13px;
    line-height: 1.25;
  }
}


/* ---- Rota: um cartao por contrato, como o tecnico ja conhece do TOA */
.atalhos-dia {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.rota-lista {
  display: grid;
  gap: 12px;
}

.rota-card,
.rota-os {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--tom);
  border-radius: 14px;
  background: var(--surface);
}

.rota-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rota-turno {
  font-size: 15px;
  font-weight: 800;
  color: var(--tom);
}

.rota-cliente {
  font-size: 19px;
  line-height: 1.25;
}

.rota-sub,
.rota-endereco,
.rota-tempo {
  font-size: 15px;
  color: var(--muted);
}

.rota-terminais {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.rota-terminais-resumo {
  font-size: 15px;
  font-weight: 800;
  margin-right: 4px;
}

.terminal-chip {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.terminal-chip.instalado {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success);
}

.terminal-chip.retirado {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning);
}

.rota-resumo-detalhe {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--muted);
}

.rota-os {
  margin-bottom: 12px;
}

.rota-obs {
  margin: 4px 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px;
  background: var(--surface-soft);
}

.rota-os-terminais h4 {
  margin: 8px 0 4px;
}

.terminal-linhas {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.terminal-titulo {
  font-weight: 800;
  font-size: 14px;
}

.terminal-titulo.instalado { color: var(--success); }
.terminal-titulo.retirado { color: var(--warning); }

.terminal-linha {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border-left: 4px solid var(--line);
}

.terminal-linha.instalado { border-left-color: var(--success); }
.terminal-linha.retirado { border-left-color: var(--warning); }

.terminal-linha strong { font-size: 16px; }
.terminal-linha span { font-size: 14px; color: var(--muted); }

a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  text-decoration: none;
  color: inherit;
}


/* ---- Materiais e alertas */
.material-linhas {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.material-linha {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border-left: 4px solid var(--tom);
}

.material-linha strong { font-size: 16px; }
.material-linha span { font-size: 14px; font-weight: 700; color: var(--tom); }

.bloco-nota.sucesso {
  color: var(--success);
  background: var(--success-bg);
}


/* ---- Resultado: indicadores detalhados recolhidos, aviso de entrada */
.mais-detalhes {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.mais-detalhes > summary {
  min-height: 48px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
}

.mais-detalhes[open] > summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.mais-detalhes > :not(summary) {
  margin: 0 12px 12px;
}

.alerta-entrada p {
  margin: 0 0 8px;
  font-size: 17px;
}
