:root {
  --primary: #e30613;
  --primary-hover: #c20511;
  --secondary: #111111;
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --gray: #9ca3af;
  --dark-gray: #4b5563;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --ink: var(--secondary);
  --ink-soft: var(--dark-gray);
  --paper: var(--background);
  --paper-deep: #f5f5f5;
  --line: var(--border);
  --teal: var(--primary);
  --teal-soft: #dcfce7;
  --coral: var(--danger);
  --coral-soft: #fee2e2;
  --amber: var(--warning);
  --amber-soft: #fef3c7;
  --charcoal: var(--secondary);
  --shadow: 0 16px 34px rgba(17, 17, 17, 0.08);
  --font: 'Aptos', 'Segoe UI Variable', 'Trebuchet MS', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.eyebrow-light {
  color: #fecdd3;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(370px, 0.85fr);
}
.auth-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  color: #ffffff;
  background: var(--charcoal);
}
.auth-visual::before,
.auth-visual::after {
  position: absolute;
  z-index: -1;
  content: '';
}
.auth-visual::before {
  width: min(62vw, 800px);
  height: min(62vw, 800px);
  right: -22%;
  bottom: -35%;
  border: 1px solid rgba(255, 253, 248, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 0 44px rgba(227, 6, 19, 0.2),
    0 0 0 88px rgba(59, 130, 246, 0.12);
}
.auth-visual::after {
  top: 22%;
  right: 10%;
  width: 18px;
  height: 18px;
  border: 4px solid var(--primary);
}
.auth-visual-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(255, 253, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 253, 248, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
}
.auth-visual-content {
  max-width: 560px;
  padding-top: min(19vh, 174px);
}
.auth-visual h1 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(3rem, 6vw, 6.4rem);
  font-weight: 800;
  line-height: 0.94;
}
.signal-stack {
  display: flex;
  gap: 11px;
  margin-top: 54px;
}
.signal {
  display: block;
  width: 58px;
  height: 8px;
}
.signal-teal {
  background: var(--primary);
}
.signal-amber {
  width: 36px;
  background: var(--info);
}
.signal-coral {
  width: 22px;
  background: var(--success);
}
.auth-time {
  position: absolute;
  right: clamp(32px, 5vw, 72px);
  bottom: clamp(28px, 5vw, 68px);
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 800;
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(28px, 8vw, 112px);
  background: rgba(255, 255, 255, 0.96);
}
.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
}
.brand-lockup {
  margin-bottom: 58px;
}
.brand-lockup:has(img:not([hidden])) {
  display: block;
  width: 164px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.brand-lockup img {
  display: block;
  width: 164px;
  height: auto;
}
.brand-lockup:has(img:not([hidden])) > span:last-child,
.sidebar-brand:has(img:not([hidden])) > span:last-child {
  display: none;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
}
.auth-card {
  width: min(100%, 410px);
  animation: fade-rise 420ms ease both;
}
.auth-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1;
}
.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}
.compact-stack {
  margin-top: 0;
}
label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
}
input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}
input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15);
}
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.check-label {
  display: inline-flex;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.check-label input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
}
.primary-button,
.quiet-button,
.install-app-button,
.text-button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  padding: 9px 14px;
  font-weight: 800;
  letter-spacing: 0;
}
.primary-button {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 8px 14px rgba(227, 6, 19, 0.2);
}
.primary-button:hover {
  background: var(--primary-hover);
}
.quiet-button {
  color: #ffffff;
  background: var(--secondary);
}
.quiet-button:hover {
  background: #2a2a2a;
}
.install-app-button {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: #ffffff;
}
.install-app-button:hover {
  color: #ffffff;
  background: var(--primary);
}
.auth-install-button {
  width: max-content;
  margin: 16px 0 4px;
}
.compact-install-button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.75rem;
}
.text-button {
  min-height: auto;
  padding: 2px;
  color: var(--teal);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.align-start {
  justify-self: start;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  height: 100dvh;
  flex-direction: column;
  padding: 28px 18px 18px;
  color: #ffffff;
  background: var(--charcoal);
}
.sidebar-brand {
  padding: 0 8px;
}
.sidebar-brand:has(img:not([hidden])) {
  width: 164px;
  padding: 6px 8px 7px;
  border-left: 3px solid var(--primary);
}
.sidebar-brand .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 0.65rem;
}
.sidebar-brand img {
  display: block;
  width: 145px;
  height: auto;
}
.nav-list {
  display: grid;
  gap: 5px;
  margin-top: 52px;
  overflow-y: auto;
}
.nav-item {
  min-height: 42px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 10px 12px;
  color: #ffffff;
  background: transparent;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 750;
}
.nav-item:hover,
.nav-item.active {
  border-left-color: #ffffff;
  color: #ffffff;
  background: var(--primary);
}
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid #2a2a2a;
  font-size: 0.78rem;
}
.sidebar-footer a {
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}
.connection-status {
  color: var(--success);
}

.workspace {
  min-width: 0;
  padding: 0 clamp(18px, 3.5vw, 56px) 52px;
}
.topbar {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.topbar h1,
.view-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  line-height: 1.05;
}
.account-menu,
.account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.account-identity {
  gap: 9px;
}
.account-identity strong,
.account-identity small {
  display: block;
}
.account-identity strong {
  font-size: 0.86rem;
}
.account-identity small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}
.notification-wrap {
  position: relative;
}
.notification-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 800;
}
.notification-count {
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  font-size: 0.63rem;
}
.notification-menu {
  position: absolute;
  z-index: 7;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.notification-menu .panel-heading {
  align-items: baseline;
}
.notification-list {
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow-y: auto;
  margin-top: 12px;
}
.notification-entry {
  width: 100%;
  border: 0;
  border-left: 3px solid var(--line);
  padding: 9px 8px;
  color: inherit;
  background: transparent;
  text-align: left;
}
.notification-entry.unread {
  border-left-color: var(--primary);
  background: var(--paper);
}
.notification-entry small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}
.initials {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  font-size: 0.73rem;
  font-weight: 900;
}
.mobile-nav-button {
  display: none;
}
.view {
  padding-top: clamp(24px, 3vw, 42px);
  animation: fade-rise 300ms ease both;
}
.view-heading,
.panel-heading,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.view-heading {
  margin-bottom: 24px;
}
.view-heading h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}
.metric-card {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  padding: 18px;
  box-shadow: var(--shadow);
  text-align: left;
}
.metric-card span {
  font-size: 0.78rem;
  font-weight: 800;
}
.metric-card strong {
  font-size: clamp(1.72rem, 2.5vw, 2.35rem);
  line-height: 1;
}
.metric-card small {
  font-size: 0.72rem;
}
.metric-card:not(article):hover {
  transform: translateY(-2px);
  transition: transform 160ms ease;
}
.metric-teal {
  color: #166534;
  background: var(--teal-soft);
}
.metric-coral {
  color: #991b1b;
  background: var(--coral-soft);
}
.metric-amber {
  color: #92400e;
  background: var(--amber-soft);
}
.metric-charcoal {
  color: #ffffff;
  background: var(--charcoal);
}
.metric-sand {
  color: #1d4ed8;
  background: #dbeafe;
}
.metric-ink {
  color: #ffffff;
  background: var(--dark-gray);
}

.dashboard-layout,
.request-columns,
.roles-layout,
.operational-grid,
.settings-layout,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}
.request-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.roles-layout {
  grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1.3fr);
}
.operational-grid,
.settings-layout,
.profile-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}
.map-panel {
  margin-top: 16px;
}
.geofence-map {
  min-height: 280px;
  height: min(52vh, 420px);
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}
.settings-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.profile-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}
.profile-hero-card {
  padding: 22px 26px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.profile-hero-content {
  display: flex;
  align-items: center;
  gap: 24px;
}
.profile-avatar-large {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(227, 6, 19, 0.25);
  flex-shrink: 0;
}
.profile-hero-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.profile-hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-hero-title-row h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.profile-hero-email {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0;
}
.profile-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.badge-item strong {
  color: var(--ink);
}
.profile-grid-container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: start;
}
.profile-grid-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.form-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.audit-layout {
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr) minmax(260px, 1fr);
}
.data-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(16px, 2.2vw, 26px);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.04);
}
.compact-form {
  margin-top: 20px;
}
.support-copy {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}
.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}
.segmented-control.four-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 600px) {
  .segmented-control.four-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.segmented-control label {
  display: block;
  position: relative;
  cursor: pointer;
}
.segmented-control input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}
.segmented-control span {
  display: block;
  min-height: 42px;
  padding: 11px 10px;
  color: var(--ink-soft);
  background: var(--surface);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.segmented-control label + label span {
  border-left: 1px solid var(--line);
}
.segmented-control input:checked + span {
  color: #ffffff;
  background: var(--primary);
}
.segmented-control input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--paper-deep);
  color: var(--gray);
}
.location-readout {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--line);
  padding: 8px 9px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}
.filter-bar .primary-button {
  min-height: 44px;
}
.section-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 2px;
}
.section-tab {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 0.73rem;
  font-weight: 800;
}
.section-tab.active,
.section-tab:hover {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}
.table-heading {
  padding: clamp(16px, 2.2vw, 26px) clamp(16px, 2.2vw, 26px) 0;
}
.table-panel .table-heading + .table-wrap {
  margin-top: 16px;
}
.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}
.statistics-panel {
  margin-top: 0;
}
.month-input {
  width: auto;
  min-width: 156px;
}
.calendar-events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.calendar-event {
  display: grid;
  gap: 6px;
  min-height: 110px;
  border-left: 4px solid var(--primary);
  padding: 12px;
  background: var(--paper);
}
.calendar-event.holiday {
  border-left-color: var(--amber);
}
.calendar-event.vacation,
.calendar-event.license {
  border-left-color: var(--success);
}
.calendar-event small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}
.report-actions,
.inline-actions,
.form-pair {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.form-pair > label {
  flex: 1 1 100px;
}
.settings-layout .data-panel,
.profile-layout .data-panel {
  align-self: start;
}
.profile-summary {
  display: grid;
  gap: 7px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.profile-summary strong {
  font-size: 1.18rem;
}
.profile-summary small {
  color: var(--ink-soft);
  font-size: 0.76rem;
}
.profile-subheading {
  margin-top: 26px;
}
.system-status {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.system-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}
.system-log-list {
  display: grid;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  margin-top: 16px;
}
.system-log-entry {
  overflow: auto;
  border-left: 3px solid var(--dark-gray);
  padding: 8px 9px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.67rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
}
textarea:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15);
}
.panel-heading h3 {
  margin: 0;
  font-size: 1.1rem;
}
.chart-legend {
  display: flex;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
}
.legend-entry::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  content: '';
  vertical-align: 1px;
}
.entry-teal::before {
  background: var(--teal);
}
.entry-amber::before {
  background: var(--amber);
}
.attendance-chart {
  display: grid;
  min-height: 224px;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  align-items: end;
  gap: clamp(7px, 1.4vw, 15px);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.chart-day {
  display: grid;
  height: 194px;
  grid-template-rows: 1fr auto;
  gap: 9px;
  align-items: end;
  text-align: center;
}
.chart-columns {
  display: flex;
  height: 154px;
  align-items: end;
  justify-content: center;
  gap: 4px;
}
.chart-bar {
  width: min(18px, 42%);
  min-height: 3px;
  background: var(--teal);
}
.chart-bar.late {
  background: var(--amber);
}
.chart-day small {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
}
.activity-list,
.roster-list,
.request-list,
.sessions-list,
.role-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.activity-row,
.roster-row,
.request-row,
.session-row,
.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.activity-row:last-child,
.roster-row:last-child,
.request-row:last-child,
.session-row:last-child,
.role-row:last-child {
  border-bottom: 0;
}
.row-name {
  display: block;
  font-size: 0.84rem;
  font-weight: 850;
}
.row-meta {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.73rem;
}
.event-pill,
.status-pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 3px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}
.event-pill,
.status-active {
  color: #166534;
  background: var(--teal-soft);
}
.event-pill {
  color: #1d4ed8;
  background: #dbeafe;
}
.status-pending {
  color: #76520c;
  background: var(--amber-soft);
}
.status-inactive,
.status-rejected {
  color: #82352d;
  background: var(--coral-soft);
}
.status-approved {
  color: #166534;
  background: var(--teal-soft);
}
.count-badge {
  color: #ffffff;
  background: var(--charcoal);
}
.roster-panel {
  margin-top: 16px;
}
.empty-state {
  margin: 10px 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}
th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
th {
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: uppercase;
}
td {
  font-size: 0.82rem;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: var(--paper);
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}
.small-button {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 8px;
  color: var(--ink);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
}
.small-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.role-row {
  width: 100%;
  border: 0;
  padding: 13px 10px;
  background: transparent;
  text-align: left;
}
.role-row.active {
  color: #ffffff;
  background: var(--charcoal);
}
.role-row small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}
.role-row.active small {
  color: var(--gray);
}
.permissions-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}
.permission-category-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: var(--paper);
}
.permission-category-title {
  margin: 0 0 12px 0;
  font-size: 0.92rem;
  font-weight: 850;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.permission-category-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 12px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.permission-option:hover {
  border-color: var(--teal);
  background: var(--paper);
}
.permission-option input {
  margin-top: 3px;
  width: 17px;
  min-height: 17px;
  accent-color: var(--teal);
  cursor: pointer;
}
.permission-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.permission-option-title {
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.3;
}
.permission-code-tag {
  font-size: 0.7rem;
  color: var(--ink-soft);
  font-family: monospace;
}
.session-row {
  align-items: flex-start;
}
.session-row .quiet-button {
  min-height: 31px;
  padding: 5px 8px;
  font-size: 0.72rem;
}
.request-row {
  align-items: flex-start;
}
.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}
.approve-button {
  border-color: var(--success);
  color: #15803d;
}
.reject-button {
  border-color: var(--danger);
  color: #b91c1c;
}

.app-message {
  margin-top: 18px;
  border-left: 4px solid var(--amber);
  padding: 11px 13px;
  color: #92400e;
  background: var(--amber-soft);
  font-size: 0.83rem;
  font-weight: 700;
}
.dialog {
  width: min(670px, calc(100% - 28px));
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.27);
}
.compact-dialog {
  width: min(440px, calc(100% - 28px));
}
.dialog::backdrop {
  background: rgba(17, 17, 17, 0.55);
}
.dialog-content {
  display: grid;
  gap: 24px;
  padding: clamp(22px, 4vw, 36px);
}
.dialog-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}
.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.dialog-wide {
  grid-column: 1 / -1;
}
.dialog-actions {
  justify-content: flex-end;
}
.qr-display {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.qr-display img {
  width: min(260px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  padding: 10px;
  background: #ffffff;
}
.qr-display .support-copy {
  margin: 0;
}
.qr-token {
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  padding: 8px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 0.72rem;
}
.import-result {
  border-left: 4px solid var(--info);
  padding: 10px 12px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 0.82rem;
  font-weight: 700;
}
.toast {
  position: fixed;
  z-index: 10;
  right: 20px;
  bottom: 20px;
  max-width: min(400px, calc(100vw - 40px));
  border-left: 4px solid var(--success);
  padding: 12px 15px;
  color: #166534;
  background: var(--teal-soft);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 800;
}
.toast.error {
  border-left-color: var(--coral);
  color: #991b1b;
  background: var(--coral-soft);
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* QR Scanner Styles */
.qr-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qr-input-wrapper input {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.875rem;
}

.qr-input-wrapper input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.icon-button {
  min-height: 40px;
  min-width: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-button:hover {
  border-color: var(--teal);
  background: rgba(227, 6, 19, 0.05);
  color: var(--teal);
}

.icon-button:active {
  background: rgba(227, 6, 19, 0.1);
}

#qr-reader {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  min-height: 280px;
  background: #000000;
  border-radius: 4px;
  overflow: hidden;
}

#qr-reader video {
  max-width: 100%;
  max-height: 280px;
  object-fit: cover;
}

#qr-reader canvas {
  display: none;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric-card {
    min-height: 126px;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 260px;
  }
  .auth-visual-content {
    padding-top: 30px;
  }
  .auth-visual h1 {
    font-size: clamp(2.8rem, 10vw, 4.5rem);
  }
  .auth-time {
    right: 30px;
    bottom: 28px;
  }
  .auth-panel {
    min-height: calc(100dvh - 260px);
    padding: 46px max(24px, 8vw);
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 8;
    width: min(280px, 88vw);
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    display: flex;
  }
  .mobile-nav-button {
    display: inline-flex;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 7px 10px;
    color: var(--ink);
    background: var(--surface);
    font-weight: 800;
  }
  .workspace {
    padding: 0 20px 38px;
  }
  .topbar {
    min-height: 86px;
  }
  .dashboard-layout,
  .request-columns,
  .roles-layout,
  .operational-grid,
  .settings-layout,
  .profile-layout,
  .profile-grid-container,
  .audit-layout {
    grid-template-columns: 1fr;
  }
  .form-row-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .auth-visual {
    min-height: 226px;
    padding: 28px;
  }
  .auth-visual h1 {
    font-size: 2.65rem;
  }
  .auth-time {
    right: 28px;
    bottom: 24px;
  }
  .auth-panel {
    padding: 38px 24px;
  }
  .brand-lockup {
    margin-bottom: 40px;
  }
  .workspace {
    padding: 0 16px 32px;
  }
  .topbar {
    display: grid;
    min-height: 0;
    grid-template-areas:
      'navigation title'
      'account account';
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px 10px;
    padding: 16px 0;
  }
  .mobile-nav-button {
    grid-area: navigation;
    min-height: 42px;
  }
  .topbar > div:first-of-type {
    grid-area: title;
    min-width: 0;
  }
  .topbar h1 {
    font-size: 1.38rem;
  }
  .account-menu {
    width: 100%;
    grid-area: account;
    justify-content: flex-end;
    gap: 7px;
  }
  .account-identity span:last-child {
    display: none;
  }
  .quiet-button {
    padding-inline: 9px;
  }
  .view {
    padding-top: 20px;
  }
  .view-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }
  .view-heading > button,
  .view-heading > select,
  .view-heading > .inline-actions,
  .view-heading > .report-actions {
    width: 100%;
  }
  .view-heading > .inline-actions > button,
  .view-heading > .report-actions > button {
    flex: 1 1 110px;
  }
  .section-tabs {
    margin-right: -2px;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .section-tabs::-webkit-scrollbar {
    display: none;
  }
  .data-panel {
    padding: 14px;
  }
  .profile-hero-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 14px;
  }
  .profile-hero-title-row,
  .profile-hero-badges {
    justify-content: center;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .metric-card {
    min-height: 116px;
    padding: 14px;
  }
  .metric-card strong {
    font-size: 1.65rem;
  }
  .chart-legend {
    display: none;
  }
  .attendance-chart {
    gap: 4px;
  }
  .chart-day {
    height: 170px;
  }
  .chart-columns {
    height: 130px;
  }
  .dialog-grid {
    grid-template-columns: 1fr;
  }
  .dialog-wide {
    grid-column: auto;
  }
  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .dialog-actions button {
    width: 100%;
  }
  .notification-button {
    min-height: 32px;
    padding-inline: 7px;
    font-size: 0.69rem;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .location-readout {
    align-items: flex-start;
    flex-direction: column;
  }
  .geofence-map {
    min-height: 230px;
    height: min(44vh, 300px);
  }
  .month-input {
    min-width: 0;
  }
}

/* --- ESTILOS DE ANUNCIOS Y DASHBOARD ADAPTADO --- */
.announcement-dashboard-panel {
  margin-top: 18px;
  margin-bottom: 18px;
}

.dashboard-announcements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.announcement-card-hero {
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 6px;
  padding: 16px 18px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.announcement-card-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.announcement-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.announcement-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
}

.announcement-card-date {
  font-size: 0.74rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.announcement-card-title {
  margin: 6px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.announcement-card-body {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-line;
}

/* PORTAL EMPLEADO LAYOUT */
.employee-dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.employee-sidebar-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quick-check-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.quick-check-status {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
}

.full-width {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .employee-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* WEB PUSH NOTIFICATIONS UI */
.notification-push-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.push-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.push-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.push-status-dot.blocked {
  background: #ef4444;
}

.push-status-text {
  flex: 1;
  font-weight: 500;
  color: var(--ink);
}

.push-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .push-device-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.push-device-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.push-device-info strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.push-device-info small {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.notification-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: var(--paper-deep);
}

.notification-item.unread {
  background: rgba(227, 6, 19, 0.04);
  border-left: 3px solid var(--primary);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.notification-header strong {
  font-size: 0.85rem;
  color: var(--ink);
}

.notification-header small {
  font-size: 0.72rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.notification-body {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
}

