:root {
  --bg: #0b0d10;
  --surface: #111419;
  --surface-2: #171b21;
  --surface-3: #1d2229;

  --border: #292f37;
  --border-light: #343b45;

  --text: #f1f3f5;
  --text-secondary: #9ca3ad;
  --text-muted: #68717d;

  --accent: #ffffff;
  --danger: #ff6b6b;

  --radius: 12px;
  --radius-small: 8px;

  --shadow:
    0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;

  background:
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.035),
      transparent 32%
    ),
    var(--bg);

  color: var(--text);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}


/* =========================================================
   LOGIN
========================================================= */

.login-view {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 430px;

  padding: 38px;

  background: rgba(17, 20, 25, 0.96);

  border:
    1px solid var(--border);

  border-radius:
    var(--radius);

  box-shadow:
    var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;

  margin-bottom: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  background: var(--accent);
  color: #0b0d10;

  font-weight: 800;
  font-size: 20px;
}

.brand-mark.small {
  width: 34px;
  height: 34px;

  border-radius: 8px;

  font-size: 16px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-product {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading h1 {
  margin: 0 0 8px;

  font-size: 27px;
  letter-spacing: -0.03em;
}

.login-heading p {
  margin: 0;

  color: var(--text-secondary);

  line-height: 1.6;
}


/* =========================================================
   FORMS
========================================================= */

label {
  display: block;

  margin:
    18px 0 8px;

  color: var(--text-secondary);

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;

  min-height: 44px;

  padding:
    0 13px;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-small);

  outline: none;

  background: var(--surface-2);
  color: var(--text);

  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus {
  border-color:
    var(--border-light);

  background:
    var(--surface-3);
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;

  padding:
    0 16px;

  border-radius:
    var(--radius-small);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.06em;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.primary-button {
  border:
    1px solid var(--accent);

  background:
    var(--accent);

  color:
    #0b0d10;
}

.primary-button:hover {
  opacity: 0.88;
}

.primary-button:active,
.ghost-button:active,
.danger-button:active {
  transform:
    translateY(1px);
}

.primary-button.compact {
  min-height: 38px;
}

.ghost-button {
  border:
    1px solid var(--border);

  background:
    transparent;

  color:
    var(--text-secondary);
}

.ghost-button:hover {
  background:
    var(--surface-2);

  color:
    var(--text);
}

.danger-button {
  border:
    1px solid rgba(255, 107, 107, 0.4);

  background:
    rgba(255, 107, 107, 0.08);

  color:
    var(--danger);
}

.danger-button:hover {
  background:
    rgba(255, 107, 107, 0.14);
}

#loginButton {
  width: 100%;

  margin-top: 25px;
}

.login-footer {
  margin-top: 32px;

  color: var(--text-muted);

  font-size: 11px;

  text-align: center;

  letter-spacing: 0.06em;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
  min-height: 72px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding:
    0 30px;

  border-bottom:
    1px solid var(--border);

  background:
    rgba(11, 13, 16, 0.94);

  position: sticky;
  top: 0;
  z-index: 20;

  backdrop-filter:
    blur(16px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
}

.topbar-subtitle {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.admin-identity {
  color: var(--text-secondary);

  font-size: 12px;
}


/* =========================================================
   MAIN
========================================================= */

.main-content {
  width: 100%;
  max-width: 1500px;

  margin: 0 auto;

  padding:
    48px 30px 80px;
}

.page-section {
  margin-bottom: 58px;
}

.section-heading {
  margin-bottom: 25px;
}

.section-heading.inline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  display: block;

  margin-bottom: 8px;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.15em;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;

  letter-spacing: -0.03em;
}

.section-heading h1 {
  font-size: 30px;
}

.section-heading h2 {
  font-size: 21px;
}

.section-heading p {
  margin:
    9px 0 0;

  color: var(--text-secondary);

  line-height: 1.6;
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 15px;
}

.stat-card {
  padding: 24px;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius);

  background:
    var(--surface);
}

.stat-label {
  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.14em;
}

.stat-value {
  margin-top: 14px;

  font-size: 32px;
  font-weight: 700;

  letter-spacing: -0.04em;
}


/* =========================================================
   CONTROLS
========================================================= */

.section-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-controls select {
  width: 190px;
}


/* =========================================================
   TABLE
========================================================= */

.table-container {
  overflow-x: auto;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius);

  background:
    var(--surface);
}

table {
  width: 100%;

  border-collapse:
    collapse;

  min-width: 760px;
}

thead {
  background:
    var(--surface-2);
}

th {
  padding:
    13px 16px;

  border-bottom:
    1px solid var(--border);

  color:
    var(--text-muted);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.12em;

  text-align: left;

  white-space: nowrap;
}

td {
  padding:
    15px 16px;

  border-bottom:
    1px solid var(--border);

  color:
    var(--text-secondary);

  font-size: 13px;

  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background:
    rgba(255, 255, 255, 0.018);
}

.empty-row {
  padding: 40px !important;

  color: var(--text-muted);

  text-align: center;
}

.table-actions {
  display: flex;
  gap: 7px;
}

.table-button {
  min-height: 31px;

  padding:
    0 10px;

  border:
    1px solid var(--border);

  border-radius:
    6px;

  background:
    transparent;

  color:
    var(--text-secondary);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.05em;
}

.table-button:hover {
  background:
    var(--surface-2);

  color:
    var(--text);
}

.table-button.danger {
  color:
    var(--danger);

  border-color:
    rgba(255, 107, 107, 0.25);
}


/* =========================================================
   STATUS
========================================================= */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  font-size: 11px;
  font-weight: 600;
}

.status::before {
  content: "";

  width: 6px;
  height: 6px;

  border-radius: 50%;

  background:
    currentColor;
}

.status.active {
  color:
    #d5dbe1;
}

.status.disabled {
  color:
    var(--text-muted);
}


/* =========================================================
   MESSAGES
========================================================= */

.message {
  margin-bottom: 18px;

  padding:
    12px 14px;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-small);

  background:
    var(--surface-2);

  color:
    var(--text-secondary);

  font-size: 12px;
}

.message.error {
  border-color:
    rgba(255, 107, 107, 0.3);

  color:
    var(--danger);

  background:
    rgba(255, 107, 107, 0.05);
}

.message.success {
  border-color:
    rgba(255, 255, 255, 0.16);

  color:
    var(--text);
}


/* =========================================================
   MODALS
========================================================= */

.modal {
  position: fixed;
  inset: 0;

  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;

  background:
    rgba(0, 0, 0, 0.72);

  backdrop-filter:
    blur(7px);
}

.modal-card {
  position: relative;

  width: 100%;
  max-width: 470px;

  padding: 26px;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius);

  background:
    var(--surface);

  box-shadow:
    var(--shadow);
}

.small-modal {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;

  font-size: 20px;
  letter-spacing: -0.025em;
}

.modal-close {
  width: 32px;
  height: 32px;

  border:
    1px solid var(--border);

  border-radius:
    7px;

  background:
    transparent;

  color:
    var(--text-muted);

  font-size: 20px;
  line-height: 1;
}

.modal-close:hover {
  color:
    var(--text);

  background:
    var(--surface-2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;

  margin-top: 27px;
}

.modal-card p {
  margin: 0;

  color:
    var(--text-secondary);

  line-height: 1.6;
}


/* =========================================================
   GLOBAL MESSAGE
========================================================= */

.global-message {
  position: fixed;

  right: 22px;
  bottom: 22px;

  z-index: 200;

  max-width: 360px;

  padding:
    13px 16px;

  border:
    1px solid var(--border);

  border-radius:
    var(--radius-small);

  background:
    var(--surface-3);

  color:
    var(--text);

  box-shadow:
    var(--shadow);

  font-size: 12px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 850px) {

  .topbar {
    padding:
      0 18px;
  }

  .main-content {
    padding:
      35px 18px 60px;
  }

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

  .section-heading.inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-controls {
    width: 100%;
  }

  .section-controls select {
    flex: 1;
    width: auto;
  }

  .topbar-subtitle {
    display: none;
  }

  .admin-identity {
    display: none;
  }
}

@media (max-width: 520px) {

  .login-card {
    padding: 28px 22px;
  }

  .brand {
    margin-bottom: 38px;
  }

  .topbar {
    min-height: 64px;
  }

  .topbar-title {
    font-size: 12px;
  }

  .main-content {
    padding:
      28px 14px 50px;
  }

  .section-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .section-controls select {
    width: 100%;
  }

  .modal-card {
    padding: 22px;
  }
}