:root {
  color-scheme: light;
  --bg: #f4f7ff;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --ink: #071439;
  --muted: #66708f;
  --line: #e2e8f7;
  --line-strong: #c9d6f4;
  --blue: #2458ff;
  --blue-strong: #1747e8;
  --blue-soft: #edf3ff;
  --navy: #020d35;
  --navy-2: #071747;
  --success: #14a679;
  --warning: #76531b;
  --warning-bg: #fff8e8;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(16, 40, 120, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(36, 88, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(500px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(201, 214, 244, 0.9);
  border-radius: 8px;
  padding: 40px 38px;
  box-shadow: var(--shadow);
}

.brand-block {
  display: grid;
  justify-items: center;
  margin-bottom: 26px;
}

.login-logo {
  width: min(270px, 72vw);
  height: auto;
  display: block;
}

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

.login-form label,
.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.login-form input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.login-form input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 88, 255, 0.11);
}

.login-form button,
.primary-button {
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  background: var(--blue);
  color: white;
  font-weight: 750;
  transition: background 0.18s, transform 0.18s;
}

.login-form button:hover,
.primary-button:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.social-login {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.social-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--navy);
  background: #ffffff;
  font-weight: 750;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.social-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.social-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
}

.google-icon {
  background: #2458ff;
}

.facebook-icon {
  background: #1877f2;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
}

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

.sidebar {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  gap: 26px;
}

.sidebar-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 10px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-logo {
  width: 205px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.14));
}

.sidebar-brand span {
  color: #aebbf2;
  font-size: 13px;
  font-weight: 650;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-list button,
.sidebar-action-button,
.logout-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 13px;
  color: #bfcaef;
  background: transparent;
  font-weight: 700;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav-list button,
.sidebar-action-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  line-height: 1;
}

.nav-icon ion-icon {
  width: 16px;
  height: 16px;
}

.nav-list button.active {
  background: rgba(36, 88, 255, 0.2);
  border-color: rgba(88, 124, 255, 0.35);
  color: white;
}

.nav-list button.active .nav-icon {
  background: var(--blue);
}

.nav-list button:hover,
.sidebar-action-button:hover,
.logout-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.sidebar-action-button {
  display: block;
  text-align: left;
  border-color: rgba(255, 255, 255, 0.12);
}

.logout-button {
  border-color: rgba(255, 255, 255, 0.12);
  text-align: left;
}

.workspace {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.payment-notice,
.notice {
  margin: 0;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid #f2dfb4;
  border-radius: 8px;
  padding: 11px 13px;
  max-width: 460px;
  line-height: 1.45;
}

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

.metric,
.panel,
.action-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
  box-shadow: 0 8px 22px rgba(16, 40, 120, 0.04);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 9px;
  color: var(--navy);
  font-size: 26px;
  line-height: 1.1;
}

.panel {
  padding: 19px;
  margin-bottom: 18px;
  box-shadow: 0 8px 22px rgba(16, 40, 120, 0.035);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel p {
  color: var(--muted);
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: white;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 800;
}

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

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

.action-tile {
  padding: 19px;
  text-align: left;
  color: var(--ink);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.action-tile:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.action-tile strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
}

.action-tile span {
  color: var(--muted);
}

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

.full-span {
  grid-column: 1 / -1;
}

.compact-panel {
  max-width: 640px;
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 13px 16px;
  background: var(--blue);
  color: white;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}

.primary-link-button:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.small-button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 10px;
  margin: 2px;
  color: var(--navy);
  background: white;
  font-weight: 750;
}

.small-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

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

  .sidebar {
    min-height: auto;
  }

  .sidebar-brand {
    border-bottom: 0;
  }

  .metrics-grid,
  .actions-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}
