/* ─────────────────────────────────────────────
   Aether — Event Platform
   Design tokens + UI
───────────────────────────────────────────── */

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-pressed: #1d4ed8;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --primary-muted: #6a6a6a;

  --background: #000000;
  --surface: #121212;
  --surface-hover: #1a1a1a;
  --input-bg: #050505;

  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --text-tertiary: #6a6a6a;

  --border: #2a2a2a;
  --border-strong: #3a3a3a;

  --success: #b3b3b3;
  --success-soft: #2a2a2a;
  --warning: #b3b3b3;
  --warning-soft: #2a2a2a;
  --danger: #e57373;
  --danger-soft: rgba(229, 115, 115, 0.12);

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-full: 999px;

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-sm: none;
  --overlay: rgba(0, 0, 0, 0.72);

  --sidebar-width: 240px;
  --header-height: 48px;
  --bottom-nav-height: 64px;

  --font: "Inter", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: 0.2s ease;
  --ease-out: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  color-scheme: dark;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
input:autofill,
input:autofill:hover,
input:autofill:focus,
textarea:autofill,
select:autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  background-color: var(--input-bg) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1000px var(--input-bg);
  transition: background-color 99999s ease-out 0s;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

/* ── App shell ── */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--background);
  border-right: 1px solid var(--border);
  z-index: 40;
  transition: transform var(--ease-out);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  color: var(--text);
}

.sidebar-brand:hover {
  color: var(--text);
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.88;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item.is-active svg {
  opacity: 1;
}

.sidebar-footer {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.sidebar-user:hover {
  background: var(--surface);
  color: var(--text);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar.lg {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.sidebar-user-meta {
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--text-tertiary);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  min-height: 100vh;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 40px 64px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: fade-up 0.35s var(--ease-out);
}

.mobile-header,
.bottom-nav,
.sidebar-backdrop {
  display: none;
}

/* ── Page header ── */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.page-header.compact {
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform 0.12s ease, box-shadow var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

/* ── Forms ── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.input,
.select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.select:disabled {
  color: var(--text-secondary);
  background: var(--surface);
  cursor: default;
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:hover,
.select:hover {
  border-color: var(--border-strong);
}

.input:hover,
.select:hover,
.input:focus,
.select:focus {
  background: var(--input-bg);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.select:-webkit-autofill,
.select:-webkit-autofill:hover,
.select:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 1000px var(--input-bg), 0 0 0 3px transparent;
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid,
.input.is-invalid:hover,
.input.is-invalid:focus,
.select.is-invalid:hover,
.select.is-invalid:focus,
.textarea.is-invalid:hover,
.textarea.is-invalid:focus {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1000px var(--input-bg), inset 0 0 0 2px var(--danger);
}

.input-wrap.is-invalid .input,
.input-wrap.is-invalid .input:hover,
.input-wrap.is-invalid .input:focus {
  box-shadow: inset 0 0 0 1000px var(--input-bg), inset 0 0 0 2px var(--danger);
}

.field-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  display: none;
  margin-top: 4px;
}

.field-error.is-visible {
  display: block;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 44px;
}

.input-icon-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  border-radius: 6px;
}

.input-icon-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.input-icon-btn svg {
  width: 18px;
  height: 18px;
}

.search {
  position: relative;
  min-width: 240px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search .input {
  height: 40px;
  padding-left: 36px;
}

/* ── KPI ── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.kpi {
  padding: 20px 4px 4px 0;
}

.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.kpi-value.accent {
  color: var(--primary);
}

/* ── Sections ── */

.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── Table ── */

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--ease);
}

.data-table tbody tr:hover td {
  background: transparent;
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background: var(--surface);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .cell-strong {
  color: var(--text);
  font-weight: 600;
}

.data-table a.cell-strong:hover {
  color: var(--primary);
}

.data-table tr.is-hidden {
  display: none;
}

/* ── Badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--surface);
  color: var(--text-secondary);
}

.badge-blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-green {
  background: var(--success-soft);
  color: var(--success);
}

.badge-amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-gray {
  background: var(--surface);
  color: var(--text-secondary);
}

/* ── Activity ── */

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.muted {
  background: var(--border-strong);
}

.activity-text {
  flex: 1;
}

.activity-time {
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ── Person cell ── */

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-name {
  font-weight: 600;
  color: var(--text);
}

.person-email {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
}

.tab {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--ease), border-color var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
  animation: fade-up 0.28s var(--ease-out);
}

.tab-panel.is-active {
  display: block;
}

/* ── Event hero ── */

.event-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

.event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.event-meta svg {
  width: 15px;
  height: 15px;
  color: var(--text-tertiary);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat {
  padding: 4px 0;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-value.accent {
  color: var(--primary);
}

.prose {
  max-width: 56ch;
  color: var(--text-secondary);
  line-height: 1.65;
}

.prose p + p {
  margin-top: 12px;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  max-width: 420px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.detail-row dt {
  color: var(--text-secondary);
}

.detail-row dd {
  font-weight: 600;
  text-align: right;
}

/* ── Settings ── */

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 520px;
}

.settings-block h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.settings-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: border-color var(--ease), background var(--ease);
}

.choice:hover {
  background: var(--surface);
}

.choice.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.choice input {
  display: none;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-weight: 500;
}

.toggle-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.toggle-ui {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background var(--ease);
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease);
}

.toggle input:checked + .toggle-ui {
  background: var(--primary);
}

.toggle input:checked + .toggle-ui::after {
  transform: translateX(16px);
}

.lang-note {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Check-in ── */

.checkin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.checkin-item:last-child {
  border-bottom: none;
}

.checkin-item.is-hidden {
  display: none;
}

.checkin-item.is-done .person-name {
  color: var(--text-secondary);
}

/* ── Login ── */

body[data-page="login"] {
  background: #000;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #000;
}

.login-copy {
  margin-top: 28px;
  color: #6a6a6a;
  font-size: 13px;
  font-weight: 500;
}

.login-legal {
  max-width: 324px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.55;
}

.login-legal a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-legal a:hover {
  color: var(--primary);
}

.legal-page .login-card {
  max-width: 720px;
  padding: 40px 48px 48px;
}

.legal-page .login-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.legal-updated {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 28px;
}

.legal-body {
  color: #d4d4d4;
  font-size: 14px;
  line-height: 1.7;
}

.legal-body h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 8px;
}

.legal-body h3 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 8px;
}

.legal-body p,
.legal-body ul {
  margin-bottom: 12px;
}

.legal-body ul {
  padding-left: 18px;
  list-style: disc;
}

.legal-body li {
  margin-bottom: 6px;
}

.legal-back {
  display: inline-block;
  margin-top: 28px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-back:hover {
  color: var(--primary);
}

.login-hint,
.login-lead {
  max-width: 324px;
  margin: 16px auto 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
}

.login-lead {
  margin: 0 auto 8px;
  font-size: 14px;
}

.login-page .btn-ghost-block {
  display: block;
  width: 100%;
  max-width: 324px;
  height: 48px;
  margin: 12px auto 0;
  border-radius: 500px;
  border: 1px solid #333;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.login-page .btn-ghost-block:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.login-alt[hidden],
.login-legal[hidden],
.login-footer[hidden],
.login-links[hidden],
.login-form[hidden] {
  display: none !important;
}

.login-links button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.login-links button:hover {
  color: var(--primary);
}

.login-card {
  
  max-width: 734px;
  padding: 48px 80px 56px;
  background: #121212;
  border-radius: 8px;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.login-brand i {
  font-size: 26px;
  color: var(--primary);
}

.login-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 36px;
  color: #fff;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 324px;
  margin: 0 auto;
  width: 100%;
}

.login-form[hidden] {
  display: none !important;
}

.login-form .field-label {
  font-size: 14px;
  font-weight: 700;
}

.login-form .input,
.login-form .input:hover,
.login-form .input:focus,
.login-form .input:-webkit-autofill,
.login-form .input:-webkit-autofill:hover,
.login-form .input:-webkit-autofill:focus,
.login-form .input:-webkit-autofill:active,
.login-form .input:autofill,
.login-form .input:autofill:hover,
.login-form .input:autofill:focus {
  height: 48px;
  border-radius: 4px;
  border: 1px solid #7c7c7c;
  background: var(--input-bg) !important;
  background-image: none !important;
  color: #fff;
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: inset 0 0 0 1000px var(--input-bg);
}

.login-form .input:hover,
.login-form .input:-webkit-autofill:hover,
.login-form .input:autofill:hover {
  border-color: #fff;
}

.login-form .input:focus,
.login-form .input:-webkit-autofill:focus,
.login-form .input:autofill:focus {
  outline: none;
  border-color: #fff;
  box-shadow: inset 0 0 0 1000px var(--input-bg), 0 0 0 1px #fff;
}

.login-form .input:focus-visible {
  outline: none;
}

.login-form .input.is-invalid,
.login-form .input.is-invalid:hover,
.login-form .input.is-invalid:focus,
.login-form .input-wrap.is-invalid .input,
.login-form .input-wrap.is-invalid .input:hover,
.login-form .input-wrap.is-invalid .input:focus,
.login-form .input.is-invalid:-webkit-autofill,
.login-form .input.is-invalid:-webkit-autofill:hover,
.login-form .input.is-invalid:-webkit-autofill:focus,
.login-form .input-wrap.is-invalid .input:-webkit-autofill,
.login-form .input-wrap.is-invalid .input:-webkit-autofill:hover,
.login-form .input-wrap.is-invalid .input:-webkit-autofill:focus {
  border-color: var(--danger) !important;
  box-shadow: inset 0 0 0 1000px var(--input-bg), 0 0 0 1px var(--danger);
}

.login-form .field-error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.login-form .field-error.is-visible {
  display: block;
}

.login-form .input-wrap .input {
  padding-right: 44px;
}

.login-form .input-icon-btn {
  color: #b3b3b3;
}
.login-form .input-icon-btn:hover {
  color: #fff;
}

.login-page .btn-login,
.login-page .btn-primary.btn-block {
  height: 48px;
  margin-top: 12px;
  border-radius: 500px;
  font-size: 16px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
}

.login-page .btn-primary.btn-block:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
}

.login-links {
  text-align: center;
  margin-top: 28px;
}

.login-links a,
.login-footer a {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-links a:hover,
.login-footer a:hover {
  color: var(--primary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #2a2a2a;
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 14px;
}

.login-footer button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.login-footer button:hover {
  color: var(--primary);
}

.login-alt {
  max-width: 324px;
  margin: 0 auto;
  width: 100%;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border-radius: 500px;
  border: 1px solid #3a3a3a;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn-google:hover {
  background: #f3f3f3;
}

.google-icon {
  width: 16px;
  height: 16px;
}

.pw-meter {
  margin-top: 8px;
}

.pw-meter-track {
  height: 6px;
  border-radius: 999px;
  background: #2a2a2a;
  overflow: hidden;
}

.pw-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #e57373;
  transition: width 0.2s ease, background 0.2s ease;
}

.pw-meter[data-score="1"] .pw-meter-fill { background: #e57373; }
.pw-meter[data-score="2"] .pw-meter-fill { background: #f0b429; }
.pw-meter[data-score="3"] .pw-meter-fill { background: #8bc34a; }
.pw-meter[data-score="4"] .pw-meter-fill,
.pw-meter[data-score="5"] .pw-meter-fill { background: #3b82f6; }

.pw-meter-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Modal ── */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-root.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  animation: fade 0.2s ease;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  animation: modal-in 0.28s var(--ease-out);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-secondary);
  margin: -4px -4px 0 0;
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* ── Dropdown ── */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 30;
}

.dropdown.is-open .dropdown-menu {
  display: block;
  animation: fade-up 0.16s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface);
  color: var(--text);
}

.dropdown-item.is-active {
  color: var(--primary);
}

/* ── Toast ── */

.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  background: #282828;
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 0.28s var(--ease-out);
}

.toast.is-out {
  animation: toast-out 0.2s ease forwards;
}

.toast.success {
  background: #282828;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

/* ── Empty ── */

.empty {
  padding: 32px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ── Progress ── */

.progress {
  height: 6px;
  background: var(--surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

/* ── Animations ── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

body.sidebar-open {
  overflow: hidden;
}

/* ── Responsive ── */

@media (max-width: 960px) {
  .page {
    padding: 28px 24px 48px;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
  }
}

@media (max-width: 840px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease);
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    margin-left: 0;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    padding: 0 12px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 30;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--text);
  }

  .icon-btn:hover {
    background: var(--surface);
  }

  .icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-height);
    background: var(--background);
    border-top: 1px solid var(--border);
    z-index: 30;
    padding: 0 8px env(safe-area-inset-bottom);
  }

  .bottom-nav a,
  .bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
  }

  .bottom-nav a.is-active,
  .bottom-nav button.is-active {
    color: var(--primary);
  }

  .bottom-nav svg {
    width: 20px;
    height: 20px;
  }

  .page {
    padding: 24px 20px 32px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .search {
    flex: 1;
    min-width: 0;
  }

  .event-hero {
    flex-direction: column;
  }

  .stat-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: calc(var(--bottom-nav-height) + 12px);
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .data-table tr:last-child {
    border-bottom: none;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    border: none;
    text-align: right;
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: left;
  }

  .data-table td:first-child {
    justify-content: flex-start;
    text-align: left;
    padding-bottom: 8px;
  }

  .data-table td:first-child::before {
    display: none;
  }

  .choice-row {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .kpi-value {
    font-size: 24px;
  }

  .login-card {
    padding: 32px 24px 40px;
  }

  .legal-page .login-card {
    padding: 32px 20px 40px;
  }

  .login-title {
    font-size: 22px;
  }
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-btn {
  width: 30px;
  height: 22px;
  padding: 0;
  border: 1px solid #2b2b2b;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  opacity: 0.5;
  line-height: 0;
}
.lang-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lang-btn.is-on {
  opacity: 1;
  border-color: var(--primary, #3b82f6);
}
.lang-switch-page {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}
.login-page {
  position: relative;
}
