@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background: #0F0F1A;
  color: #e2e8f0;
}

a { text-decoration: none; color: inherit; }

/* ── Layout shell ─────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: #14142A;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; padding: 0 6px; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #E8C87A, #B8860B);
  display: flex; align-items: center; justify-content: center;
  color: #0A0A0F; font-size: 18px; flex-shrink: 0;
}
.brand-title { font-size: 15px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 11px; color: #8b8ba3; margin-top: 1px; }

.nav-links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: #b4b4c9;
  transition: background .15s, color .15s;
}
.nav-links a i { width: 18px; text-align: center; color: #6c6c87; }
.nav-links a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-links a.active {
  background: rgba(232,200,122,0.12);
  color: #E8C87A;
}
.nav-links a.active i { color: #E8C87A; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.admin-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #b4b4c9; padding: 8px 6px;
}
.logout-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #f87171; padding: 8px 6px;
  border-radius: 8px; transition: background .15s;
}
.logout-link:hover { background: rgba(248,113,113,0.08); }

.main-content { flex: 1; padding: 32px 36px; max-width: 1300px; }

/* ── Page header ──────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.page-header p { font-size: 13.5px; color: #9494ad; margin: 0; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 22px;
}
.card-title {
  font-size: 13px; font-weight: 700; color: #fff;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
}
.card-title i { color: #E8C87A; }

/* ── Stat grid ────────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; padding: 20px;
}
.stat-card .stat-label { font-size: 12px; color: #9494ad; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: #fff; }
.stat-card .stat-value.gold { color: #E8C87A; }
.stat-card .stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 15px;
}
.stat-icon.ios { background: rgba(96,165,250,0.15); color: #60A5FA; }
.stat-icon.android { background: rgba(74,222,128,0.15); color: #4ADE80; }
.stat-icon.total { background: rgba(232,200,122,0.15); color: #E8C87A; }
.stat-icon.ann { background: rgba(167,139,250,0.15); color: #A78BFA; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Forms ────────────────────────────────────────────── */
.form-label { font-size: 13px; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; display: block; }
.form-control, .form-select, textarea {
  width: 100%; font-size: 14px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.1);
  padding: 10px 14px; color: #fff; background: rgba(255,255,255,0.03);
  font-family: 'DM Sans', sans-serif;
  transition: border-color .15s;
}
.form-control:focus, .form-select:focus, textarea:focus {
  border-color: #E8C87A; outline: none;
}
.form-control::placeholder, textarea::placeholder { color: #6c6c87; }
.form-text { font-size: 12px; color: #6c6c87; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }

select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8ba3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select.form-select option { background: #14142A; color: #fff; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .9; }
.btn-primary { background: linear-gradient(135deg, #E8C87A, #B8860B); color: #0A0A0F; }
.btn-secondary { background: rgba(255,255,255,0.06); color: #cbd5e1; }
.btn-danger { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }

/* ── Table ────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table thead th {
  background: rgba(255,255,255,0.04); color: #9494ad;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 14px; text-align: left;
}
.data-table thead th:first-child { border-radius: 8px 0 0 8px; }
.data-table thead th:last-child { border-radius: 0 8px 8px 0; }
.data-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.05); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table td { padding: 13px 14px; font-size: 13.5px; color: #cbd5e1; vertical-align: middle; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-active { background: rgba(74,222,128,0.12); color: #4ADE80; }
.badge-inactive { background: rgba(255,255,255,0.08); color: #8b8ba3; }
.badge-popup { background: rgba(167,139,250,0.12); color: #A78BFA; }
.badge-banner { background: rgba(96,165,250,0.12); color: #60A5FA; }

.thumb-sm {
  width: 42px; height: 42px; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}

.empty-state { text-align: center; padding: 50px 20px; color: #6c6c87; }
.empty-state i { font-size: 36px; margin-bottom: 10px; display: block; }

/* ── Login page ───────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #0F0F1A;
}
.login-card {
  width: 380px; background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 18px;
  padding: 36px 32px;
}
.login-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #E8C87A, #B8860B);
  display: flex; align-items: center; justify-content: center;
  color: #0A0A0F; font-size: 22px; margin: 0 auto 18px;
}
.login-title { text-align: center; font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.login-sub { text-align: center; font-size: 13px; color: #9494ad; margin-bottom: 26px; }
.login-error {
  background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3);
  color: #f87171; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  margin-bottom: 18px;
}

/* ── Misc ─────────────────────────────────────────────── */
.alert-success {
  background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3);
  color: #4ADE80; padding: 12px 16px; border-radius: 10px; font-size: 13.5px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.image-preview {
  margin-top: 10px; display: flex; align-items: center; gap: 12px;
}
.image-preview img {
  width: 90px; height: 90px; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.checkbox-row input { width: 16px; height: 16px; }
.checkbox-row label { font-size: 13px; color: #cbd5e1; }
