:root {
  color-scheme: light;
  --navy: #0a1628;
  --navy-2: #10243d;
  --navy-3: #183658;
  --white: #ffffff;
  --mist: #d8e5ee;
  --gold: #c9a84c;
  --gold-2: #e4ca78;
  --line: rgba(255, 255, 255, 0.2);
  --shadow: rgba(2, 8, 18, 0.42);
  --error: #ffb7a8;
  --ink: #08111f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--white);
  background: var(--navy);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.auth-view,
.dashboard-view {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(10, 22, 40, 0.95), rgba(10, 22, 40, 0.72)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1900&q=82");
  background-position: center;
  background-size: cover;
}

.auth-view {
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.auth-view::before,
.dashboard-view::before {
  position: absolute;
  inset: -120px;
  content: "";
  background:
    radial-gradient(circle, transparent 0 30%, rgba(201, 168, 76, 0.18) 30.2% 30.6%, transparent 31%),
    radial-gradient(circle, transparent 0 54%, rgba(255, 255, 255, 0.1) 54.2% 54.5%, transparent 55%),
    linear-gradient(90deg, transparent 49.8%, rgba(201, 168, 76, 0.12) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(201, 168, 76, 0.12) 50%, transparent 50.2%);
  opacity: 0.72;
  transform: rotate(-14deg);
}

.auth-view::after,
.dashboard-view::after {
  position: absolute;
  inset: auto 0 0;
  height: 34vh;
  content: "";
  background:
    linear-gradient(180deg, transparent, rgba(10, 22, 40, 0.9)),
    repeating-linear-gradient(172deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 34px);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 42px 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.84);
  box-shadow: 0 30px 90px var(--shadow);
  backdrop-filter: blur(18px);
}

.compass {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.compass::before,
.compass::after {
  position: absolute;
  content: "";
}

.compass::before {
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.compass::after {
  left: 50%;
  top: 8px;
  width: 2px;
  height: 58px;
  background: linear-gradient(var(--white) 0 48%, transparent 48% 52%, var(--gold) 52% 100%);
  transform: translateX(-50%) rotate(36deg);
  transform-origin: center;
}

.compass span {
  position: absolute;
  inset: 29px;
  border-radius: 50%;
  background: var(--gold);
}

.overline {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-card .overline,
.login-card h1,
.login-copy {
  text-align: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 46px;
  line-height: 1.04;
  letter-spacing: 0;
}

.login-copy {
  margin: 0 0 28px;
  color: var(--mist);
  font-size: 15px;
}

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

.field {
  display: grid;
  gap: 7px;
}

label {
  color: var(--mist);
  font-size: 14px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  outline: 0;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

option {
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--error);
  font-size: 14px;
}

.auth-message[data-state="ok"] {
  color: var(--mist);
}

.field-hint {
  margin: -2px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.primary-button,
.ghost-button,
.ghost-link,
.google-button {
  min-height: 50px;
  border-radius: 6px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  color: var(--navy);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.primary-button:hover {
  background: linear-gradient(180deg, #f0d98b, #d2b158);
}

.primary-button:disabled,
.ghost-button:disabled,
.google-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.divider::before,
.divider::after {
  flex: 1;
  height: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.16);
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
}

.google-button:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.13);
}

.full-button {
  width: 100%;
}

.google-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--white);
  font-size: 14px;
  font-weight: 900;
}

.dashboard-view {
  padding: 34px;
}

.topbar,
.dashboard-grid {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 32px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 40px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.ghost-button:hover,
.ghost-link:hover {
  border-color: var(--gold);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.section-card {
  min-height: 300px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 36, 61, 0.92), rgba(10, 22, 40, 0.88)),
    radial-gradient(circle at 80% 20%, rgba(201, 168, 76, 0.2), transparent 32%);
  box-shadow: 0 24px 70px rgba(2, 8, 18, 0.28);
  backdrop-filter: blur(14px);
}

.section-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.section-card h2 {
  margin: 68px 0 12px;
  font-size: 25px;
  line-height: 1.15;
}

.section-card p {
  margin-bottom: 0;
  color: var(--mist);
}

.admin-view {
  overflow: auto;
}

.admin-topbar {
  align-items: flex-start;
}

.admin-gate,
.admin-panel {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
}

.admin-gate {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.86);
}

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

.stat-card,
.admin-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.86);
  box-shadow: 0 24px 70px rgba(2, 8, 18, 0.24);
  backdrop-filter: blur(14px);
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--gold);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.stat-card p {
  margin: 8px 0 0;
  color: var(--mist);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: 18px;
}

.admin-card {
  padding: 24px;
}

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

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 24px;
}

.admin-form {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.form-row {
  display: grid;
  gap: 7px;
}

.small-button,
.text-button {
  min-height: 36px;
  border-radius: 6px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.small-button {
  padding: 0 12px;
}

.text-button {
  min-width: 70px;
  margin-right: 6px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.text-button.danger {
  color: var(--error);
}

.inline-message {
  min-height: 20px;
  margin: 0;
  color: var(--mist);
  font-size: 14px;
}

.inline-message[data-state="error"] {
  color: var(--error);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--white);
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
}

td {
  color: var(--mist);
}

.muted-cell {
  color: rgba(255, 255, 255, 0.56);
  font-style: italic;
}

td select {
  min-width: 130px;
}

.files-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.files-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.files-list small {
  color: rgba(255, 255, 255, 0.62);
}

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

  .stats-grid,
  .admin-layout {
    grid-template-columns: 1fr 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-card {
    padding: 30px 22px;
  }

  h1 {
    font-size: 38px;
  }

  .dashboard-view {
    padding: 24px 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .ghost-button,
  .ghost-link {
    flex: 1;
  }

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

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

  .section-card {
    min-height: 220px;
  }
}
