@charset "UTF-8";

:root {
  --ink: #171825;
  --ink-soft: #3d3e4e;
  --muted: #747787;
  --muted-light: #9a9dab;
  --paper: #f7f8fb;
  --surface: rgba(255, 255, 255, 0.82);
  --purple: #63358f;
  --purple-light: #8e61bf;
  --teal: #1d9696;
  --line: rgba(28, 29, 45, 0.09);
  --line-strong: rgba(28, 29, 45, 0.14);
  --shadow: 0 24px 70px rgba(29, 22, 48, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(700px 450px at 90% -5%, rgba(99, 53, 143, 0.09), transparent 68%),
    radial-gradient(650px 430px at -10% 105%, rgba(84, 73, 108, 0.07), transparent 68%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.admin-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 0 28px 42px;
}

.admin-header {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-brand { display: inline-flex; }
.admin-brand img { display: block; width: 190px; height: auto; }

.header-side {
  display: flex;
  align-items: center;
  gap: 13px;
}

.admin-badge,
.back-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
}

.admin-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 5px rgba(99, 53, 143, 0.08);
}

.back-link {
  color: var(--ink-soft);
  background: #fff;
  transition: color 160ms ease, transform 160ms ease;
}

.back-link:hover { color: var(--purple); transform: translateY(-1px); }
.back-link svg { width: 16px; height: 16px; }

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 50px 0 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.eyebrow i {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--purple), #9ba0ab);
}

.admin-hero h1 {
  margin: 13px 0 12px;
  font-size: clamp(44px, 5.5vw, 72px);
  line-height: 0.97;
  letter-spacing: -0.065em;
}

.admin-hero p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.sync-state {
  display: flex;
  min-width: 172px;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  padding-bottom: 4px;
}

.sync-state span {
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sync-state strong { font-size: 12px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 17px 0 22px;
}

.stat-card {
  display: flex;
  min-height: 142px;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(29, 22, 48, 0.055), inset 0 0 0 1px var(--line);
  backdrop-filter: blur(18px);
}

.stat-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #4d4f5e, #8b8f9f);
  box-shadow: 0 12px 26px rgba(46, 46, 60, 0.13);
}

.stat-icon--purple { background: linear-gradient(135deg, #432753, var(--purple-light)); }
.stat-icon--neutral { background: linear-gradient(135deg, #686b77, #aeb2bd); }
.stat-icon svg { width: 24px; height: 24px; }

.stat-card > div {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 7px;
}

.stat-card small {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 34px;
  letter-spacing: -0.045em;
}

.stat-card > div > span { color: var(--muted); font-size: 10px; }

.records-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  backdrop-filter: blur(20px);
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 8px 18px;
}

.panel-heading span:first-child {
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.panel-heading h2 {
  margin: 4px 0 0;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.record-count {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(99, 53, 143, 0.07);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.search-field {
  display: grid;
  min-height: 52px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted-light);
  background: #fff;
}

.search-field:focus-within {
  border-color: rgba(99, 53, 143, 0.25);
  box-shadow: 0 0 0 4px rgba(99, 53, 143, 0.06);
}

.search-field svg { width: 18px; height: 18px; }
.search-field input { min-width: 0; height: 48px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #a5a8b3; }

.filter-field select {
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  color: var(--ink-soft);
  background: #fff;
  font-size: 11px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 15px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; }

.button--secondary {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: #fff;
}

.button--primary {
  border: 0;
  color: #fff;
  background: linear-gradient(115deg, #25202d, #65388f);
  box-shadow: 0 12px 24px rgba(74, 47, 104, 0.19);
}

.table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 1210px;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #8e919e;
  background: #f9fafc;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td {
  color: #5e606f;
  font-size: 11px;
  line-height: 1.45;
}

tbody tr { transition: background 150ms ease; }
tbody tr:hover { background: rgba(99, 53, 143, 0.025); }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink-soft); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 999px;
  color: #397471;
  background: rgba(29, 150, 150, 0.08);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.delete-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(177, 63, 72, 0.11);
  border-radius: 10px;
  color: #a23d45;
  background: rgba(177, 63, 72, 0.055);
  font-size: 9px;
  font-weight: 700;
}

.delete-button:hover { background: rgba(177, 63, 72, 0.10); }

.empty-state {
  display: grid;
  min-height: 290px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 40px;
  text-align: center;
}

.empty-state[hidden] { display: none; }
.empty-state > span { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 4px; border-radius: 17px; color: var(--purple); background: rgba(99, 53, 143, 0.07); }
.empty-state svg { width: 26px; height: 26px; }
.empty-state strong { font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }

.storage-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 16px;
  padding: 15px 17px;
  border: 1px solid rgba(99, 53, 143, 0.10);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(99, 53, 143, 0.045);
}

.storage-note > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--purple); background: rgba(255, 255, 255, 0.72); }
.storage-note svg { width: 17px; height: 17px; }
.storage-note strong { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: 11px; }
.storage-note p { margin: 0; font-size: 10px; line-height: 1.55; }

.admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.admin-footer a { color: var(--muted); text-decoration: none; }
.admin-footer a:hover { color: var(--purple); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  color: #fff;
  background: #2f2c38;
  box-shadow: 0 18px 50px rgba(22, 19, 33, 0.20);
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(99, 53, 143, 0.20);
  outline-offset: 3px;
}

@media (max-width: 960px) {
  .stats { grid-template-columns: 1fr; }
  .stat-card { min-height: 110px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) minmax(170px, 220px); }
  .toolbar .button { width: 100%; }
}

@media (max-width: 680px) {
  .admin-shell { padding: 0 14px 30px; }
  .admin-header { min-height: 82px; }
  .admin-brand img { width: 155px; }
  .admin-badge { display: none; }
  .back-link { width: 40px; padding: 0; justify-content: center; font-size: 0; }
  .admin-hero { align-items: flex-start; flex-direction: column; padding-top: 40px; }
  .admin-hero h1 { font-size: 46px; }
  .sync-state { min-width: 0; align-items: flex-start; }
  .toolbar { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .records-panel { padding: 10px; border-radius: 23px; }
  .admin-footer { flex-direction: column; justify-content: center; padding: 27px 0 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
