:root {
  color-scheme: dark;
  --bg: #060b14;
  --bg-soft: #0b1220;
  --panel: rgba(15, 25, 43, 0.9);
  --panel-strong: rgba(18, 29, 50, 0.98);
  --text: #f5f7fb;
  --muted: #9aa7bd;
  --line: rgba(132, 153, 188, 0.18);
  --accent: #5a4bff;
  --accent-strong: #776bff;
  --green: #22d48f;
  --red: #ff4e5f;
  --warning: #f5a524;
  --blue: #1e9bff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --main-grid-gap: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 8%, rgba(80, 70, 255, 0.26), transparent 19rem),
    radial-gradient(circle at 22% 0%, rgba(0, 140, 255, 0.14), transparent 20rem),
    linear-gradient(135deg, #050914 0%, #07101d 44%, #050914 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 70% 12%, #000 0, transparent 42%);
}

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

button,
select,
textarea {
  border-radius: 8px;
}

button {
  min-height: 36px;
  border: 1px solid rgba(119, 107, 255, 0.36);
  background: linear-gradient(135deg, #5147ff, #2d35d9);
  box-shadow: 0 10px 24px rgba(80, 70, 255, 0.23);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

button:hover {
  border-color: rgba(146, 139, 255, 0.72);
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.secondary,
.segment {
  background: rgba(17, 27, 46, 0.86);
  box-shadow: none;
  color: #cfd7ff;
}

select,
textarea {
  border: 1px solid var(--line);
  background: rgba(9, 17, 31, 0.96);
  color: var(--text);
  outline: 0;
}

select {
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
}

textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  resize: vertical;
  padding: 10px;
}

input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 17, 31, 0.96);
  color: var(--text);
  outline: 0;
  padding: 0 12px;
}

.hidden {
  display: none !important;
}

.auth-view {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(90, 75, 255, 0.28), transparent 22rem),
    rgba(3, 8, 16, 0.94);
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 29, 50, 0.98), rgba(8, 15, 28, 0.98));
  box-shadow: var(--shadow);
  padding: 26px;
}

.auth-card img {
  width: 220px;
  max-width: 80%;
  justify-self: center;
}

.auth-card h1 {
  text-align: center;
}

.auth-copy,
.auth-error {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.auth-error {
  min-height: 18px;
  color: var(--red);
  font-weight: 800;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: #c4cee2;
  font-size: 13px;
  font-weight: 800;
}

.auth-card label[hidden] {
  display: none !important;
}

.dashboard {
  position: relative;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 12, 23, 0.86);
  padding: 14px 12px;
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 12, 23, 0.9);
  place-items: center;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

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

.sidebar-logout {
  margin-top: auto;
}

.nav-button {
  display: grid;
  min-height: 50px;
  align-items: center;
  grid-template-columns: 32px minmax(0, 1fr);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #c7d2e8;
  font-size: 14px;
  padding: 0 12px;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(30, 155, 255, 0.48);
  background: linear-gradient(90deg, rgba(30, 155, 255, 0.2), rgba(90, 75, 255, 0.08));
  color: #fff;
}

.nav-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(154, 167, 189, 0.42);
  border-radius: 6px;
  color: #b9dcff;
  font-size: 10px;
  font-weight: 900;
}

.brand img {
  display: block;
  width: min(210px, 82%);
  max-height: 46px;
  height: auto;
  object-fit: contain;
}

.session-box {
  display: none;
}

.system-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 24, 42, 0.82);
  padding: 13px 14px;
}

.system-card span {
  color: #c5ccdb;
  font-weight: 800;
}

.system-card strong {
  color: var(--green);
}

.content {
  display: flex;
  height: 100vh;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 6px 14px 14px;
}

.topbar {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(250px, 1.35fr) minmax(220px, 0.8fr) minmax(250px, 1fr);
  gap: var(--main-grid-gap);
  flex-shrink: 0;
  min-height: 58px;
  margin-left: 0;
  margin-bottom: 8px;
}

.title-card {
  display: grid;
  width: 100%;
  height: 58px;
  place-items: center;
  border: 1px solid transparent;
  text-align: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(20px, 1.75vw, 28px);
  line-height: 1;
}

.top-actions {
  display: contents;
  align-items: center;
  flex-shrink: 0;
}

.clock-card {
  display: grid;
  width: 100%;
  height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.86);
  color: #dce7ff;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 800;
  line-height: 1.25;
  padding: 0 14px;
  text-align: center;
}

#refreshButton {
  width: 100%;
  height: 58px;
  padding: 0 16px;
}

.session-actions {
  display: grid;
  width: 100%;
  height: 58px;
  grid-template-columns: 1fr;
  gap: 8px;
}

.session-actions button {
  height: 58px;
  min-width: 0;
  overflow: hidden;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#usersButton[hidden],
#whitelistButton[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 15, 0.68);
  backdrop-filter: blur(6px);
  padding: 24px;
}

.users-modal {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 29, 50, 0.98), rgba(8, 15, 28, 0.98));
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.modal-header h2 {
  margin: 0;
}

.icon-close {
  flex: 0 0 auto;
  width: 42px;
  padding: 0;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(170px, 0.72fr);
  gap: 10px;
}

.user-form button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 190px;
}

.users-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.user-row {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 170px auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 23, 40, 0.68);
  padding: 10px;
}

.user-row strong,
.user-row span {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

.role-pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(119, 107, 255, 0.18);
  color: #cfd7ff;
  font-size: 11px;
  font-weight: 900;
  padding: 0 9px;
  text-transform: uppercase;
}

.danger-button {
  border-color: rgba(255, 78, 95, 0.38);
  background: rgba(255, 78, 95, 0.12);
  box-shadow: none;
  color: #ff9aa4;
}

.module-notice {
  margin: 0;
  border: 1px solid rgba(30, 155, 255, 0.28);
  border-radius: 8px;
  background: rgba(30, 155, 255, 0.08);
  color: #b9dcff;
  font-size: 13px;
  line-height: 1.45;
  padding: 11px 13px;
}

.whitelist-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(170px, 0.8fr) 130px;
  gap: 10px;
}

.whitelist-form textarea {
  min-height: 64px;
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
}

.whitelist-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.whitelist-row {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 0.7fr) 92px minmax(150px, 1.2fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 23, 40, 0.68);
  padding: 10px;
}

.whitelist-row > * {
  min-width: 0;
}

.whitelist-row strong,
.whitelist-row span {
  overflow-wrap: anywhere;
}

.whitelist-actions {
  display: flex;
  gap: 7px;
}

.status-pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(34, 212, 143, 0.14);
  color: #79efbe;
  font-size: 11px;
  font-weight: 900;
  padding: 0 9px;
  text-transform: uppercase;
}

.status-pill.inactive {
  background: rgba(154, 167, 189, 0.12);
  color: var(--muted);
}

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

.icon-button {
  width: 48px;
  padding: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--main-grid-gap);
  flex-shrink: 0;
  margin-left: 0;
  margin-bottom: 14px;
}

.reminder-panel {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  gap: 18px;
  min-height: 108px;
  flex-shrink: 0;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 78, 95, 0.68);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 165, 36, 0.1), transparent 16rem),
    linear-gradient(180deg, rgba(21, 24, 37, 0.96), rgba(9, 14, 25, 0.96));
  box-shadow: 0 0 24px rgba(255, 78, 95, 0.08);
  padding: 14px 18px;
}

.reminder-panel.empty {
  border-color: var(--line);
  box-shadow: none;
}

.reminder-copy {
  display: grid;
  gap: 5px;
}

.reminder-kicker {
  color: #ff6674;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reminder-copy strong {
  color: #f5f7fb;
  font-size: clamp(15px, 1.25vw, 20px);
}

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

.digital-timer {
  --digit-on: #ff9800;
  --digit-light: #ffad12;
  --digit-dark: #f27a00;
  --digit-glow: rgba(255, 136, 0, 0.72);
  --digit-off: rgba(90, 54, 7, 0.34);
  display: inline-flex;
  align-items: center;
  gap: 0.055em;
  color: #ffab16;
  white-space: nowrap;
}

.digital-timer.timer-phase-green {
  --digit-on: #26d77d;
  --digit-light: #63f0a5;
  --digit-dark: #0ba657;
  --digit-glow: rgba(38, 215, 125, 0.68);
  --digit-off: rgba(12, 74, 44, 0.35);
}

.digital-timer.timer-phase-amber {
  --digit-on: #ff9800;
  --digit-light: #ffad12;
  --digit-dark: #f27a00;
  --digit-glow: rgba(255, 136, 0, 0.72);
  --digit-off: rgba(90, 54, 7, 0.34);
}

.digital-timer.timer-phase-red {
  --digit-on: #ff394d;
  --digit-light: #ff7180;
  --digit-dark: #d70d24;
  --digit-glow: rgba(255, 57, 77, 0.72);
  --digit-off: rgba(95, 18, 28, 0.38);
}

.digital-timer.timer-final-warning {
  animation: timerFinalBlink 560ms steps(1, end) infinite;
}

@keyframes timerFinalBlink {
  0%,
  48% {
    opacity: 1;
    filter: brightness(1.18);
  }

  49%,
  100% {
    opacity: 0.2;
    filter: brightness(0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .digital-timer.timer-final-warning {
    animation-duration: 1100ms;
  }
}

.digital-digit {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 1em;
  flex: 0 0 auto;
}

.digital-digit-fraction {
  margin-inline: -0.055em;
  transform: scale(0.72);
  transform-origin: center bottom;
}

.digital-segment {
  position: absolute;
  display: block;
  background: var(--digit-off);
  filter: saturate(0.75);
  transition: background-color 35ms linear, box-shadow 35ms linear;
}

.digital-segment.on {
  background: linear-gradient(180deg, var(--digit-light), var(--digit-on) 50%, var(--digit-dark));
  box-shadow:
    0 0 0.035em var(--digit-light),
    0 0 0.14em var(--digit-glow);
  filter: none;
}

.segment-a,
.segment-d,
.segment-g {
  left: 14%;
  width: 72%;
  height: 11%;
  clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%);
}

.segment-a {
  top: 0;
}

.segment-g {
  top: 44.5%;
}

.segment-d {
  bottom: 0;
}

.segment-b,
.segment-c,
.segment-e,
.segment-f {
  width: 14%;
  height: 40%;
  clip-path: polygon(50% 0, 100% 9%, 100% 91%, 50% 100%, 0 91%, 0 9%);
}

.segment-b,
.segment-c {
  right: 0;
}

.segment-e,
.segment-f {
  left: 0;
}

.segment-b,
.segment-f {
  top: 5%;
}

.segment-c,
.segment-e {
  bottom: 5%;
}

.digital-colon {
  position: relative;
  display: inline-block;
  width: 0.16em;
  height: 1em;
  flex: 0 0 auto;
}

.digital-colon i,
.digital-decimal i {
  position: absolute;
  display: block;
  width: 0.13em;
  height: 0.13em;
  border-radius: 18%;
  background: var(--digit-on);
  box-shadow: 0 0 0.12em var(--digit-glow);
}

.digital-colon i:first-child {
  top: 29%;
}

.digital-colon i:last-child {
  bottom: 29%;
}

.digital-decimal {
  position: relative;
  display: inline-block;
  width: 0.16em;
  height: 1em;
  flex: 0 0 auto;
}

.digital-decimal i {
  bottom: 0.03em;
  left: 0.01em;
}

.primary-timer {
  font-size: clamp(42px, 4.1vw, 68px);
  line-height: 1;
  text-align: center;
}

.reminder-contact {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.reminder-contact > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reminder-contact > strong {
  color: #fff;
  font-size: clamp(15px, 1.15vw, 19px);
}

.reminder-map {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(30, 155, 255, 0.44);
  border-radius: 8px;
  background: rgba(30, 155, 255, 0.12);
  color: #92caff;
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
  text-decoration: none;
}

.reminder-map:hover {
  border-color: rgba(30, 155, 255, 0.82);
  background: rgba(30, 155, 255, 0.2);
}

.reminder-map.disabled {
  cursor: not-allowed;
  opacity: 0.38;
  pointer-events: none;
}

.map-symbol {
  color: #52b5ff;
  font-size: 21px;
  line-height: 1;
}

.reminder-settings {
  display: grid;
  gap: 12px;
}

.settings-modal {
  width: min(760px, calc(100vw - 48px));
}

.settings-section {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.45fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 23, 40, 0.68);
  padding: 16px;
}

.settings-section h3,
.settings-section p {
  margin: 0;
}

.settings-section h3 {
  margin-top: 4px;
  font-size: 17px;
}

.settings-section p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-label {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.time-setting {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
}

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

.reminder-settings input {
  width: 100%;
}

.reminder-settings button {
  min-height: 34px;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
}

.settings-footer button {
  min-width: 210px;
}

.metric {
  display: grid;
  gap: 4px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 37, 63, 0.82), rgba(13, 23, 40, 0.88));
  padding: 12px 14px;
}

.metric span {
  color: #c4cee2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  color: #fff;
  font-size: 30px;
  line-height: 1.08;
}

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

.metric.danger {
  box-shadow: inset 4px 0 0 rgba(255, 78, 95, 0.8);
}

.metric.warning {
  box-shadow: inset 4px 0 0 rgba(245, 165, 36, 0.8);
}

.metric.info {
  box-shadow: inset 4px 0 0 rgba(30, 155, 255, 0.8);
}

.metric.success {
  box-shadow: inset 4px 0 0 rgba(34, 212, 143, 0.8);
}

.panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  width: calc(100% + 28px);
  margin-right: -14px;
  margin-left: -14px;
  border: 1px solid var(--line);
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: rgba(11, 20, 36, 0.78);
  box-shadow: var(--shadow);
  padding: 12px;
}

.panel-toolbar,
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-toolbar {
  flex-shrink: 0;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.segmented {
  display: flex;
  gap: 8px;
}

.segment {
  min-height: 34px;
  padding: 0 18px;
}

.segment.active {
  background: linear-gradient(135deg, #5147ff, #2d35d9);
  color: #fff;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-status {
  max-width: 760px;
  margin: 0;
  color: #b9cae8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.polling,
.table-footer {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  min-height: 0;
  max-height: none;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid rgba(132, 153, 188, 0.14);
  padding: 8px 7px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(29, 43, 70, 0.98);
  color: #d9e3fa;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

td {
  color: #e7edf9;
  font-size: clamp(10px, 0.66vw, 12px);
  line-height: 1.25;
}

th:nth-child(1),
td:nth-child(1) {
  width: 7%;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3) {
  width: 5.2%;
}

th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5),
th:nth-child(6),
td:nth-child(6) {
  width: 8.2%;
}

th:nth-child(7),
td:nth-child(7) {
  width: 7.3%;
}

th:nth-child(8),
td:nth-child(8),
th:nth-child(11),
td:nth-child(11) {
  width: 4%;
  text-align: center;
}

th:nth-child(9),
td:nth-child(9),
th:nth-child(10),
td:nth-child(10) {
  width: 8%;
}

th:nth-child(12),
td:nth-child(12) {
  width: 8.5%;
  text-align: center;
}

th:nth-child(13),
td:nth-child(13) {
  width: 16%;
}

th:nth-child(14),
td:nth-child(14) {
  width: 7.2%;
  text-align: center;
}

.row-timer {
  --digit-off: rgba(83, 52, 10, 0.3);
  color: #ffb126;
  font-size: clamp(13px, 0.88vw, 17px);
}

.attended-grid th:nth-child(1),
.attended-grid td:nth-child(1) {
  width: 8%;
}

.attended-grid th:nth-child(2),
.attended-grid td:nth-child(2),
.attended-grid th:nth-child(3),
.attended-grid td:nth-child(3) {
  width: 6%;
}

.attended-grid th:nth-child(4),
.attended-grid td:nth-child(4),
.attended-grid th:nth-child(5),
.attended-grid td:nth-child(5),
.attended-grid th:nth-child(6),
.attended-grid td:nth-child(6) {
  width: 9%;
}

.attended-grid th:nth-child(7),
.attended-grid td:nth-child(7) {
  width: 12%;
}

.attended-grid th:nth-child(8),
.attended-grid td:nth-child(8),
.attended-grid th:nth-child(11),
.attended-grid td:nth-child(11),
.attended-grid th:nth-child(12),
.attended-grid td:nth-child(12) {
  width: 4.5%;
  text-align: center;
}

.attended-grid th:nth-child(9),
.attended-grid td:nth-child(9),
.attended-grid th:nth-child(10),
.attended-grid td:nth-child(10) {
  width: 8%;
}

.attended-grid th:nth-child(13),
.attended-grid td:nth-child(13) {
  width: 9%;
}

.attended-grid th:nth-child(14),
.attended-grid td:nth-child(14) {
  width: 14%;
}

.attended-grid th:nth-child(15),
.attended-grid td:nth-child(15) {
  width: 7%;
  text-align: center;
}

tbody tr {
  background: rgba(13, 23, 40, 0.56);
}

tbody tr:hover {
  background: rgba(31, 46, 75, 0.72);
}

.row-highlight {
  animation: rowPulse 2.2s ease-out;
}

@keyframes rowPulse {
  0%,
  100% {
    background: rgba(13, 23, 40, 0.56);
  }

  20%,
  70% {
    background: rgba(255, 78, 95, 0.18);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.active {
  background: rgba(255, 78, 95, 0.16);
  color: #ff9aa4;
}

.badge.attended {
  background: rgba(34, 212, 143, 0.14);
  color: #69e7b7;
}

.map-link {
  color: #a69fff;
  font-weight: 900;
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

.attend-cell {
  min-width: 0;
}

.attend-actions {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.attend-button {
  min-width: 78px;
  padding: 0 8px;
}

.attend-button:disabled {
  border-color: rgba(132, 153, 188, 0.16);
  background: rgba(17, 27, 46, 0.42);
  box-shadow: none;
  color: rgba(216, 221, 255, 0.36);
}

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

.table-footer {
  flex-shrink: 0;
  margin-top: 8px;
}

.alert-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 15, 0.66);
  backdrop-filter: blur(7px);
  animation: overlayIn 220ms ease-out both;
}

.alert-overlay.closing {
  animation: overlayOut 240ms ease-in both;
}

.new-alert-modal {
  position: relative;
  width: min(560px, calc(100vw - 36px));
  border: 1px solid rgba(255, 78, 95, 0.86);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 78, 95, 0.22), transparent 16rem),
    linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(7, 14, 27, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 78, 95, 0.16),
    0 0 34px rgba(255, 78, 95, 0.34),
    0 24px 86px rgba(0, 0, 0, 0.56);
  padding: 20px;
  transform-origin: center;
  animation:
    alertPopIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
    alertPopOut 240ms ease-in 10.18s both;
}

.alert-overlay.closing .new-alert-modal {
  animation: alertPopOut 240ms ease-in both;
}

.alert-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 30px;
  width: 30px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #e6ecfa;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.alert-pill {
  width: max-content;
  margin: 0 auto 14px;
  border-radius: 8px;
  background: rgba(255, 78, 95, 0.14);
  color: #ff595f;
  font-size: 13px;
  font-weight: 900;
  padding: 9px 14px;
}

.new-alert-modal h2 {
  margin: 0;
  color: #ff4e5f;
  font-size: 28px;
  letter-spacing: 1px;
  line-height: 1;
  text-align: center;
}

.alert-protocol {
  margin: 10px 0 16px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.alert-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.alert-facts div {
  display: grid;
  gap: 3px;
  min-height: 50px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
}

.alert-facts div:nth-child(3n) {
  border-right: 0;
}

.alert-facts div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.alert-facts span {
  color: var(--muted);
  font-size: 11px;
}

.alert-facts strong {
  color: #f5f7fb;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.alert-map {
  position: relative;
  display: grid;
  min-height: 172px;
  align-items: end;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(32deg, transparent 0 47%, rgba(95, 150, 117, 0.26) 48% 52%, transparent 53%),
    linear-gradient(112deg, transparent 0 44%, rgba(95, 150, 117, 0.22) 45% 49%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    #101a2a;
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}

.alert-map::before {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(circle at center, rgba(34, 212, 143, 0.18), transparent 7rem);
}

.map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: #ff4e5f;
  box-shadow: 0 0 0 18px rgba(255, 78, 95, 0.12);
  transform: translate(-50%, -62%) rotate(-45deg);
}

.map-pin::after {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #101a2a;
  content: "";
}

.alert-map > span,
.alert-map > a {
  position: relative;
  z-index: 1;
}

.alert-map > span {
  align-self: start;
  margin: 12px;
  color: #cfd8ef;
  font-size: 12px;
}

.alert-map > a {
  display: block;
  border-top: 1px solid var(--line);
  background: rgba(7, 14, 27, 0.84);
  color: #71a7ff;
  font-weight: 800;
  padding: 11px;
  text-align: center;
  text-decoration: none;
}

.map-empty {
  place-items: center;
  align-content: center;
  gap: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(13, 23, 40, 0.82);
}

.empty-pin {
  color: rgba(207, 216, 239, 0.7);
  font-size: 54px;
  line-height: 1;
}

.map-empty strong {
  color: #cfd8ef;
  font-size: 16px;
}

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

.alert-progress {
  height: 5px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.alert-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4e5f, #ff7b86);
  animation: alertProgress 10s linear both;
}

.alert-countdown {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.alert-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alert-action {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(119, 107, 255, 0.5);
  border-radius: 8px;
  background: rgba(17, 27, 46, 0.78);
  color: #eaf0ff;
  font-weight: 900;
  text-decoration: none;
}

.alert-action.primary {
  background: linear-gradient(135deg, #5147ff, #2d35d9);
}

.alert-action.disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes overlayOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes alertPopIn {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

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

@keyframes alertPopOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.86);
  }
}

@keyframes alertProgress {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .content {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    padding: 28px 22px;
  }

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

  .title-card {
    grid-column: 1 / -1;
  }

  .reminder-panel {
    grid-template-columns: 1fr 1fr;
  }

  .reminder-contact {
    grid-column: 1 / -1;
    justify-items: center;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    text-align: center;
  }

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

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

  .user-form {
    grid-template-columns: 1fr 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .whitelist-form {
    grid-template-columns: 1fr 1fr;
  }

  .whitelist-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .user-form {
    grid-template-columns: 1fr;
  }

  .user-form button {
    justify-self: stretch;
  }

  .whitelist-form,
  .whitelist-row {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .whitelist-actions {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .dashboard {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar {
    position: static;
    border-right: 0;
  }

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

  .sidebar-logout {
    margin-top: 0;
  }

  .reminder-panel {
    grid-template-columns: 1fr;
  }

  .settings-section {
    grid-template-columns: 1fr;
  }

  .settings-footer button {
    width: 100%;
  }

  .primary-timer {
    text-align: left;
  }

  .reminder-contact {
    grid-column: auto;
    justify-items: start;
    text-align: left;
  }

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