:root {
  color-scheme: dark;
  --bg: #070910;
  --panel: #111827;
  --panel-2: #0d1322;
  --line: #2dd4bf;
  --line-soft: rgba(45, 212, 191, 0.24);
  --hot: #ff2bd6;
  --warn: #f7d154;
  --text: #ecfeff;
  --muted: #9fb4c7;
  --danger: #fb7185;
  --ok: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(45, 212, 191, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 43, 214, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(255, 43, 214, 0.18), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(45, 212, 191, 0.16), transparent 28%),
    var(--bg);
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
}

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

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.28), rgba(255, 43, 214, 0.18));
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.15);
}

button:hover {
  border-color: var(--hot);
}

button.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.82);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line);
  box-shadow: 0 0 0 3px var(--line-soft);
}

a {
  color: var(--line);
}

.material-link {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-output {
  min-height: 320px;
  resize: vertical;
  white-space: pre-wrap;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.login-panel {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 12vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.login-panel .brand {
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 26px;
}

.brand.compact h1 {
  font-size: 22px;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  border: 1px solid rgba(45, 212, 191, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 43, 214, 0.18), rgba(45, 212, 191, 0.2)),
    rgba(7, 9, 16, 0.88);
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.12),
    0 0 28px rgba(255, 43, 214, 0.2),
    0 0 40px rgba(45, 212, 191, 0.12);
  overflow: hidden;
}

.brand-mark::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 38%),
    url('/assets/logo-rps-co4.png') center/cover no-repeat;
  box-shadow: inset 0 0 26px rgba(255, 43, 214, 0.14);
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 30px;
  background:
    radial-gradient(circle, rgba(255, 43, 214, 0.26), transparent 55%),
    radial-gradient(circle at 70% 30%, rgba(45, 212, 191, 0.22), transparent 45%);
  filter: blur(18px);
  opacity: 0.8;
  z-index: -1;
}

.login-panel .brand-mark {
  width: 128px;
  height: 128px;
  border-radius: 32px;
}

.login-panel .brand-mark::before {
  inset: 8px;
  border-radius: 26px;
}

.login-panel .brand h1 {
  margin-bottom: 8px;
}

.login-panel .brand p {
  max-width: 320px;
}

.sidebar .brand.compact {
  align-items: center;
}

.sidebar .brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.sidebar .brand-mark::before {
  inset: 5px;
  border-radius: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1;
}

h2 {
  font-size: 28px;
}

h3 {
  margin-bottom: 14px;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel,
.stat,
.card,
.alert {
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(13, 19, 34, 0.94));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

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

.form-grid label,
.form-grid .muted {
  display: grid;
  gap: 7px;
}

.form-grid textarea,
.form-grid label:has(textarea),
.form-grid .muted {
  grid-column: 1 / -1;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid rgba(45, 212, 191, 0.18);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(10px);
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}

.sidebar nav button {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar nav button.active {
  border-color: var(--hot);
  box-shadow: 0 0 20px rgba(255, 43, 214, 0.16);
}

.content {
  width: min(1180px, 100%);
  padding: 28px;
}

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

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

.stack-end {
  display: flex;
  align-items: end;
}

.filters {
  display: flex;
  gap: 10px;
}

.filters select {
  min-width: 150px;
}

.kas-note {
  margin-bottom: 18px;
}

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

.import-card {
  gap: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.reschedule-head h3 {
  margin-top: 10px;
  margin-bottom: 0;
}

.reschedule-carousel {
  min-height: 164px;
}

.reschedule-slide {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 43, 214, 0.08), rgba(45, 212, 191, 0.08)),
    rgba(255, 255, 255, 0.03);
}

.reschedule-title-row,
.agenda-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reschedule-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.reschedule-point {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.64);
}

.reschedule-point.active {
  border-color: rgba(45, 212, 191, 0.28);
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.08);
}

.reschedule-label {
  color: var(--hot);
  font-size: 12px;
  text-transform: uppercase;
}

.reschedule-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--line);
  font-size: 28px;
  text-shadow: 0 0 16px rgba(45, 212, 191, 0.3);
}

.announcement-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}

.announcement-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 43, 214, 0.42);
  border-radius: 999px;
  color: #ffd4f6;
  background: rgba(255, 43, 214, 0.1);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 0 22px rgba(255, 43, 214, 0.14);
}

.announcement-marquee {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.1), rgba(255, 43, 214, 0.08)),
    rgba(2, 6, 23, 0.7);
}

.announcement-marquee::before,
.announcement-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  z-index: 1;
  pointer-events: none;
}

.announcement-marquee::before {
  left: 0;
  background: linear-gradient(90deg, rgba(7, 9, 16, 0.96), rgba(7, 9, 16, 0));
}

.announcement-marquee::after {
  right: 0;
  background: linear-gradient(270deg, rgba(7, 9, 16, 0.96), rgba(7, 9, 16, 0));
}

.announcement-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  min-width: max-content;
  padding: 12px 0;
  white-space: nowrap;
  animation: marquee-slide 24s linear infinite;
}

.announcement-segment {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-left: 28px;
  font-size: 14px;
  color: var(--text);
  text-shadow: 0 0 12px rgba(45, 212, 191, 0.32);
}

.announcement-segment::after {
  content: '//';
  color: var(--hot);
}

@keyframes marquee-slide {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-33.333%);
  }
}

.stat {
  padding: 18px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.typing-text {
  min-height: 40px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
}

.typing-text::after {
  content: '|';
  margin-left: 3px;
  color: var(--line);
  animation: blink-caret 1s step-end infinite;
}

@keyframes blink-caret {
  50% {
    opacity: 0;
  }
}

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

.list {
  display: grid;
  gap: 12px;
}

.list.cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.schedule-agenda {
  display: grid;
  gap: 18px;
}

.agenda-group {
  margin-bottom: 0;
}

.agenda-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.agenda-group-head h3 {
  margin-top: 10px;
  margin-bottom: 0;
}

.agenda-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.agenda-items {
  display: grid;
  gap: 12px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.agenda-time {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.08), rgba(255, 43, 214, 0.06));
  color: var(--line);
  font-size: 18px;
  font-weight: 700;
}

.agenda-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.agenda-content strong {
  font-size: 20px;
  line-height: 1.3;
}

.agenda-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agenda-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.card,
.row {
  padding: 14px;
}

.card {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.kas-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.kas-user-info {
  min-width: 0;
}

.kas-user-info strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.kas-user-row .actions {
  display: grid;
  grid-template-columns: 86px 88px;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.kas-user-row .pill,
.kas-user-row button {
  justify-content: center;
  width: 100%;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-size: 12px;
}

.pill.ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.4);
}

.pill.warn {
  color: var(--warn);
  border-color: rgba(247, 209, 84, 0.42);
}

.danger {
  border-color: rgba(251, 113, 133, 0.6);
  color: #ffe4e6;
}

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
}

@media (max-width: 860px) {
  .login-panel .brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .login-panel .brand p {
    max-width: none;
  }

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .content {
    padding: 18px;
  }

  .grid.two,
  .stats,
  .form-grid,
  .import-grid {
    grid-template-columns: 1fr;
  }

  .reschedule-head,
  .reschedule-title-row,
  .agenda-title-row {
    flex-direction: column;
  }

  .reschedule-path,
  .agenda-group-head,
  .agenda-item {
    grid-template-columns: 1fr;
  }

  .agenda-time {
    justify-content: flex-start;
  }

  .announcement-bar {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .filters {
    width: 100%;
    flex-direction: column;
  }

  .kas-user-row {
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    padding: 14px;
  }

  .kas-user-row .actions {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 8px;
    width: 92px;
  }

  .kas-user-info .muted {
    overflow-wrap: anywhere;
  }
}
