/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #687387;
  --line: #dce2eb;
  --primary: #2457a6;
  --primary-dark: #1b4380;
  --danger: #b42318;
  --admin-sidebar-width: 240px;
  --shadow-soft: 0 14px 38px rgba(23, 32, 51, 0.08);
  --shadow-lift: 0 18px 44px rgba(23, 32, 51, 0.13);
  --ease-out: 180ms ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

::selection {
  color: #fff;
  background: var(--primary);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 87, 166, 0.22);
  outline-offset: 2px;
}

.admin-shell {
  display: flex;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--admin-sidebar-width);
  width: var(--admin-sidebar-width);
  height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 8%, rgba(82, 143, 214, 0.18), transparent 30%),
    linear-gradient(180deg, #172033 0%, #111827 100%);
  color: #fff;
  padding: 20px;
  box-shadow: 10px 0 30px rgba(23, 32, 51, 0.16);
}

.admin-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 28px;
}

.admin-brand strong {
  font-size: 22px;
}

.admin-brand span,
.admin-topbar span,
.page-heading p {
  color: var(--muted);
}

.admin-sidebar .admin-brand span,
.admin-nav a {
  color: #cbd5e1;
}

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

.admin-nav a {
  border-radius: 6px;
  padding: 10px 12px;
  transition: background var(--ease-out), color var(--ease-out), transform var(--ease-out), box-shadow var(--ease-out);
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 rgba(130, 180, 240, 0.72);
  color: #fff;
  transform: translateX(3px);
  text-decoration: none;
}

.admin-sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.admin-sidebar-footer form {
  margin: 0;
}

.admin-logout-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background var(--ease-out), border-color var(--ease-out), transform var(--ease-out);
}

.admin-logout-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.admin-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.admin-topbar-user {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #f8fafc;
}

.admin-topbar strong {
  font-size: 14px;
}

.tenant-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tenant-switcher label {
  font-size: 13px;
  color: var(--muted);
}

.admin-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  animation: content-enter 260ms ease-out both;
  scrollbar-color: #b8c5d8 transparent;
  scrollbar-width: thin;
}

.admin-content::-webkit-scrollbar {
  width: 10px;
}

.admin-content::-webkit-scrollbar-track {
  background: transparent;
}

.admin-content::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #b8c5d8;
  background-clip: padding-box;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.page-heading p {
  margin: 0;
}

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

.metric-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color var(--ease-out), box-shadow var(--ease-out), transform var(--ease-out);
}

.metric-card:hover {
  border-color: #c7d4e8;
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 30px;
}

.metric-grid--compact .metric-card {
  padding: 14px;
}

.metric-grid--compact .metric-card strong {
  font-size: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.05);
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  font-size: 13px;
  color: var(--muted);
  background: #f9fafc;
}

.admin-table--dense th,
.admin-table--dense td {
  padding: 9px 11px;
}

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

.admin-table tbody tr {
  transition: background var(--ease-out);
}

.admin-table tbody tr:hover {
  background: #f7faff;
}

.admin-form {
  display: grid;
  gap: 18px;
  max-width: 920px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

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

.admin-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.tenant-switcher select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
  transition: border-color var(--ease-out), box-shadow var(--ease-out), transform var(--ease-out);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.tenant-switcher select:focus,
.filter-form input:focus,
.filter-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 87, 166, 0.13);
  outline: none;
}

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

.checkbox-line input {
  width: auto;
}

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

.button,
.admin-form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(36, 87, 166, 0.16);
  font-weight: 700;
  transition: background var(--ease-out), box-shadow var(--ease-out), transform var(--ease-out);
}

.button:visited,
.admin-form input[type="submit"]:visited {
  color: #fff;
}

.button:hover,
.admin-form input[type="submit"]:hover {
  color: #fff;
  background: var(--primary-dark);
  box-shadow: 0 14px 28px rgba(36, 87, 166, 0.22);
  transform: translateY(-1px);
  text-decoration: none;
}

.button:active,
.admin-form input[type="submit"]:active,
.admin-logout-button:active {
  transform: translateY(0);
}

.button.button-secondary,
button.button-secondary,
input.button-secondary,
.admin-form input[type="submit"].button-secondary {
  border: 1px solid #d8e1ee;
  color: var(--text);
  background: #e8edf5;
  box-shadow: none;
}

.button.button-secondary:visited {
  color: var(--text);
}

.button.button-secondary:hover,
button.button-secondary:hover,
input.button-secondary:hover,
.admin-form input[type="submit"].button-secondary:hover {
  border-color: #cbd8e8;
  color: var(--text);
  background: #dbe3ef;
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.08);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.05);
}

.filter-form,
.import-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
}

.filter-form--short {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.6fr) auto;
}

.import-form {
  grid-template-columns: minmax(260px, 1fr) auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.filter-form label,
.import-form label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-form input:not([type="submit"]),
.filter-form select,
.import-form input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

.filter-form__actions {
  display: flex;
  gap: 8px;
}

.filter-form__actions input[type="submit"].button {
  color: #fff;
  background: var(--primary);
}

.filter-form__actions input[type="submit"].button:hover {
  color: #fff;
  background: var(--primary-dark);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #cfd8e6;
  border-radius: 999px;
  padding: 3px 8px;
  color: #344054;
  background: #f7f9fc;
  font-size: 12px;
  font-weight: 700;
  transition: transform var(--ease-out), box-shadow var(--ease-out);
}

.badge:hover {
  transform: translateY(-1px);
}

.badge-success {
  border-color: #b7e3c9;
  color: #166534;
  background: #ecfdf3;
}

.badge-danger {
  border-color: #f3c0bd;
  color: var(--danger);
  background: #fff1f0;
}

.badge-muted {
  margin-left: 6px;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 12px;
}

.section-heading h2,
.config-section h2 {
  margin: 0;
}

.section-note {
  margin: 6px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.section-heading--tight {
  margin-top: 0;
}

.config-section {
  margin-bottom: 28px;
}

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

.panel-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

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

.quick-card {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #f9fafc;
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.05);
  transition: border-color var(--ease-out), background var(--ease-out), box-shadow var(--ease-out), transform var(--ease-out);
}

.quick-card:hover {
  border-color: #c6d3e6;
  background: #f3f6fb;
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
  text-decoration: none;
}

.quick-card span,
.quick-card small {
  color: var(--muted);
}

.quick-card strong {
  font-size: 28px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.05);
}

.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.calendar-weekday,
.calendar-day {
  background: var(--panel);
}

.calendar-weekday {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.calendar-day {
  min-height: 124px;
  padding: 9px;
}

.calendar-day--muted {
  background: #f7f9fc;
}

.calendar-events {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.calendar-event {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  color: var(--text);
  transition: transform var(--ease-out), box-shadow var(--ease-out);
}

.calendar-event:hover {
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.calendar-event--allow {
  border: 1px solid #b7e3c9;
  background: #ecfdf3;
}

.calendar-event--block {
  border: 1px solid #f3c0bd;
  background: #fff1f0;
}

.calendar-event small {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hotspot-cleanup-warning {
  padding: 14px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff9eb;
}

.hotspot-cleanup-warning p {
  margin: 6px 0 10px;
  color: var(--muted);
}

.hotspot-configuration-progress[hidden] {
  display: none;
}

.hotspot-configuration-progress {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  cursor: progress;
}

.hotspot-configuration-progress__panel {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100%, 480px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  color: #fff;
  background: #172033;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.hotspot-configuration-progress__panel strong {
  display: block;
  font-size: 18px;
}

.hotspot-configuration-progress__panel p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

.hotspot-configuration-progress__spinner {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hotspot-configuration-spin 800ms linear infinite;
}

@keyframes hotspot-configuration-spin {
  to { transform: rotate(360deg); }
}

.table-actions {
  min-width: 250px;
}

.table-actions__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.table-action-unavailable {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.table-actions a,
.table-actions a:visited {
  color: var(--primary);
}

.table-actions a:hover {
  color: var(--primary-dark);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.pagination-bar strong {
  color: var(--text);
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pagination-links a,
.pagination-links span,
.pagination-links strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  background: #fff;
}

.pagination-links span {
  color: var(--muted);
  background: #f7f9fc;
}

.pagination-links strong {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: color var(--ease-out), transform var(--ease-out);
}

.link-button:visited {
  color: var(--primary);
}

.link-button:hover {
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.detail-list div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-list dd {
  margin: 0;
}

.form-errors {
  margin: 16px 24px 0;
  border-radius: 8px;
  padding: 12px 14px;
}

.toast-stack {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
  max-width: min(560px, 100%);
  pointer-events: none;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 13px;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.12);
  animation: toast-fade 7s ease both;
  pointer-events: auto;
}

.flash-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 16%, transparent);
}

.flash:hover {
  animation-play-state: paused;
}

.flash-notice {
  border-color: #b7e3c9;
  color: #0f5f2f;
  background: rgba(231, 246, 236, 0.96);
}

.flash-alert,
.form-errors {
  border-color: #f3c0bd;
  color: var(--danger);
  background: rgba(253, 236, 236, 0.96);
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-fade {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  8%,
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .flash {
    animation: none;
  }
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  min-height: 100vh;
  color: #172033;
  background:
    radial-gradient(circle at 16% 18%, rgba(36, 87, 166, 0.16), transparent 30%),
    linear-gradient(135deg, #eef4fb 0%, #f8fafc 48%, #e8eef7 100%);
}

.login-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  padding: 42px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(23, 32, 51, 0.96), rgba(27, 67, 128, 0.92));
  background-position: center;
  background-size: cover;
  color: #fff;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(23, 32, 51, 0.96), rgba(23, 32, 51, 0.72)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 18px);
}

.login-hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  gap: 42px;
  width: min(100%, 760px);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.login-brand__mark {
  display: inline-grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.login-brand__mark img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 30px;
  letter-spacing: 0;
}

.login-brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
}

.login-copy {
  max-width: 720px;
}

.login-eyebrow {
  display: inline-flex;
  margin: 0 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 7px 11px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.login-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: 48px;
  line-height: 1.04;
  letter-spacing: 0;
}

.login-copy p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 18px;
  line-height: 1.55;
}

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

.login-status-grid div {
  min-height: 90px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.login-status-grid span,
.login-status-grid strong {
  display: block;
}

.login-status-grid span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.login-status-grid strong {
  margin-top: 14px;
  font-size: 21px;
}

.login-panel {
  display: grid;
  align-items: center;
  padding: 34px;
}

.login-card {
  width: min(100%, 460px);
  margin: 0 auto;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.16);
}

.login-card__heading {
  margin-bottom: 22px;
}

.login-card__heading p {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.login-card__heading h2 {
  margin: 0;
  font-size: 30px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.login-label-row {
  font-size: 13px;
  font-weight: 800;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.login-label-row label {
  margin: 0;
}

.login-label-row a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 87, 166, 0.13);
  outline: none;
}

.login-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-checkbox input {
  width: 16px;
  height: 16px;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #183b73);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.login-submit:hover {
  background: linear-gradient(135deg, #2d66bd, var(--primary-dark));
}

.login-flash {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 13px;
  font-size: 14px;
  font-weight: 700;
}

.login-flash--notice {
  color: #0f5f2f;
  background: #e7f6ec;
}

.login-flash--alert {
  color: var(--danger);
  background: #fdecec;
}

.login-footnote {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.captive-portal-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(74, 129, 204, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(56, 189, 248, 0.18), transparent 24%),
    linear-gradient(135deg, #eef5ff 0%, #f8fbff 44%, #edf3fb 100%);
}

.captive-portal-main,
.captive-portal-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.captive-panel {
  position: relative;
  width: min(100%, 480px);
  max-width: 480px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(190, 205, 226, 0.86);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(25, 52, 96, 0.16);
  backdrop-filter: blur(16px);
  animation: captive-card-enter 260ms ease-out both;
}

.captive-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #2457a6, #43a1ff, #18a058);
}

.captive-panel--login,
.captive-panel--status {
  display: grid;
  gap: 16px;
}

.captive-panel h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.captive-panel p {
  margin: 0;
  color: var(--muted);
}

.captive-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.captive-brand__logo {
  display: block;
  flex: 0 0 auto;
  width: 52px;
  height: 42px;
  object-fit: contain;
}

.captive-brand strong,
.captive-brand span {
  display: block;
}

.captive-brand strong {
  font-size: 16px;
}

.captive-brand span:not(.captive-brand__mark) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.captive-heading {
  display: grid;
  gap: 5px;
}

.captive-login-heading h1 {
  font-size: 24px;
  line-height: 1.08;
}

.captive-kicker {
  width: fit-content;
  border: 1px solid rgba(36, 87, 166, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--primary);
  background: rgba(36, 87, 166, 0.08);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.captive-panel .admin-form {
  display: grid;
  gap: 10px;
}

.captive-panel .field {
  display: grid;
  gap: 5px;
}

.captive-panel label {
  color: #2b3750;
  font-size: 13px;
  font-weight: 800;
}

.captive-panel input[type="text"],
.captive-panel input[type="password"] {
  min-height: 48px;
  border: 1px solid #cbd6e6;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color var(--ease-out), box-shadow var(--ease-out), transform var(--ease-out);
}

.captive-panel input[type="text"]:focus,
.captive-panel input[type="password"]:focus {
  border-color: rgba(36, 87, 166, 0.64);
  box-shadow: 0 0 0 4px rgba(36, 87, 166, 0.1);
  transform: translateY(-1px);
}

.captive-primary-button,
.captive-disconnect-button {
  width: 100%;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(36, 87, 166, 0.18);
  font-weight: 900;
}

.captive-disconnect-button {
  background: linear-gradient(135deg, #b42318, #dc3d2f);
}

.captive-disconnect-button:hover {
  background: linear-gradient(135deg, #9f1f16, #c83328);
}

.captive-session-data {
  display: grid;
  gap: 10px;
  margin: 0;
}

.captive-session-data div {
  border: 1px solid rgba(220, 226, 235, 0.9);
  border-radius: 8px;
  padding: 12px 13px;
  background: #f8fbff;
}

.captive-session-data dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.captive-session-data dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 800;
}

.captive-status-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid rgba(24, 160, 88, 0.22);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(24, 160, 88, 0.11), rgba(67, 161, 255, 0.09));
}

.captive-status-hero p {
  margin-top: 6px;
}

.captive-status-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 8px;
  border-radius: 50%;
  background: #18a058;
  box-shadow: 0 0 0 7px rgba(24, 160, 88, 0.14), 0 0 22px rgba(24, 160, 88, 0.6);
}

.captive-status-actions {
  display: grid;
  gap: 10px;
}

.captive-status-actions form {
  margin: 0;
}

.captive-status-actions p {
  font-size: 13px;
  line-height: 1.45;
}

.oauth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 0;
}

.oauth-actions::before {
  grid-column: 1 / -1;
  content: "oppure";
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.oauth-actions::before,
.oauth-actions::after {
  white-space: nowrap;
}

.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
  transition: border-color var(--ease-out), box-shadow var(--ease-out), transform var(--ease-out), background var(--ease-out);
}

.oauth-button:hover {
  border-color: rgba(36, 87, 166, 0.28);
  background: #f9fbff;
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.oauth-button strong,
.oauth-button small {
  display: block;
}

.oauth-button strong {
  font-size: 13px;
  white-space: nowrap;
}

.oauth-button small {
  display: none;
}

.oauth-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #fff;
}

.oauth-logo--google {
  border: 1px solid #e5eaf2;
  color: #1a73e8;
  font-size: 23px;
  font-weight: 900;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: inset 4px 0 0 #4285f4, inset 0 4px 0 #ea4335, inset -4px 0 0 #fbbc05, inset 0 -4px 0 #34a853;
}

.oauth-logo--microsoft {
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 6px;
  border: 1px solid #e5eaf2;
}

.oauth-logo--microsoft i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

.oauth-logo--microsoft i:nth-child(1) {
  background: #f25022;
}

.oauth-logo--microsoft i:nth-child(2) {
  background: #7fba00;
}

.oauth-logo--microsoft i:nth-child(3) {
  background: #00a4ef;
}

.oauth-logo--microsoft i:nth-child(4) {
  background: #ffb900;
}

.captive-footnote {
  border-top: 1px solid rgba(220, 226, 235, 0.86);
  padding-top: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.captive-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  border: 1px solid rgba(36, 87, 166, 0.12);
  border-radius: 8px;
  padding: 7px 10px;
  color: #40516d;
  background: linear-gradient(135deg, rgba(36, 87, 166, 0.07), rgba(24, 160, 88, 0.07));
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}

.captive-credit strong {
  color: var(--primary);
  font-size: 14px;
}

.captive-credit small {
  color: var(--muted);
  font-size: 12px;
}

.captive-credit--compact {
  margin-top: -2px;
  padding: 8px 10px;
  background: #f8fbff;
}

@keyframes captive-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 520px) {
  .captive-portal-main,
  .captive-portal-login {
    align-items: start;
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .captive-panel {
    width: 100%;
    padding: 20px;
    box-shadow: 0 16px 42px rgba(25, 52, 96, 0.13);
  }

  .captive-panel--login,
  .captive-panel--status {
    gap: 16px;
  }

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

  .captive-login-heading h1 {
    font-size: 22px;
  }

  .captive-brand {
    gap: 10px;
  }

  .captive-brand__logo {
    width: 48px;
    height: 38px;
  }

  .captive-panel input[type="text"],
  .captive-panel input[type="password"],
  .captive-primary-button,
  .captive-disconnect-button {
    min-height: 46px;
  }

  .oauth-button {
    min-height: 46px;
    padding: 7px;
  }

  .oauth-logo {
    width: 30px;
    height: 30px;
  }

  .captive-status-hero {
    padding: 14px;
  }
}

@media (max-width: 380px) {
  .captive-portal-shell {
    background: #f4f8ff;
  }

  .captive-panel {
    padding: 16px;
  }

  .captive-panel--login,
  .captive-panel--status {
    gap: 14px;
  }

  .captive-panel h1 {
    font-size: 23px;
  }

  .captive-heading p,
  .captive-status-hero p,
  .captive-footnote,
  .captive-status-actions p {
    font-size: 13px;
    line-height: 1.4;
  }

  .captive-brand__logo {
    width: 42px;
    height: 34px;
  }

  .captive-brand strong,
  .oauth-button strong {
    font-size: 14px;
  }

  .captive-brand span:not(.captive-brand__mark),
  .oauth-button small {
    font-size: 11px;
  }

  .oauth-button {
    gap: 6px;
  }

  .oauth-logo {
    width: 26px;
    height: 26px;
  }

  .oauth-logo--google {
    font-size: 17px;
  }

  .captive-credit {
    padding: 8px 9px;
    font-size: 12px;
  }
}

@media (max-width: 350px) {
  .oauth-button strong {
    font-size: 11px;
  }
}

@media (max-height: 700px) and (max-width: 520px) {
  .captive-portal-login {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .captive-panel--login {
    gap: 10px;
    padding: 14px;
  }

  .captive-login-footnote {
    display: none;
  }

  .captive-panel--login .oauth-button {
    min-height: 44px;
  }

  .captive-panel--login input[type="text"],
  .captive-panel--login input[type="password"],
  .captive-panel--login .captive-primary-button {
    min-height: 42px;
  }
}

@media (max-width: 780px) {
  .toast-stack {
    max-width: none;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 28px 20px;
  }

  .login-hero__content {
    gap: 26px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-copy p:last-child {
    font-size: 16px;
  }

  .login-status-grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 20px;
  }

  .login-card {
    padding: 22px;
  }

  .admin-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .admin-sidebar,
  .admin-topbar,
  .page-heading {
    position: static;
  }

  .admin-sidebar {
    width: auto;
    height: auto;
    overflow: visible;
  }

  .admin-main {
    display: block;
    height: auto;
    overflow: visible;
  }

  .admin-content {
    min-height: 0;
    overflow: visible;
  }

  .admin-topbar,
  .page-heading,
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .metric-grid--compact,
  .form-grid,
  .detail-list,
  .quick-grid,
  .schedule-calendar,
  .filter-form,
  .import-form {
    grid-template-columns: 1fr;
  }
}
