/* Lamiaa Hub — storefront + sandbox hub styles */

:root {
  --bg: #0b0f1a;
  --bg-2: #11162a;
  --surface: #161c33;
  --surface-2: #1d2440;
  --line: #2a3358;
  --text: #e7ecff;
  --muted: #8a93b8;
  --accent: #7c5cff;
  --accent-2: #4ad6cf;
  --warn: #ff7a59;
  --danger: #ff5470;
  --good: #4ade80;
  --radius: 14px;
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.5), 0 8px 24px -8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 24px -10px rgba(0, 0, 0, 0.4);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 20% -10%, #1a2050 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 0%, #0e3b54 0%, transparent 60%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* SKIP LINK (accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--accent);
  color: #0b0f1a;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: rgba(11, 15, 26, 0.7);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand .logo {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  font-size: 16px;
  transform: translateY(2px);
}
.brand .name { font-size: 18px; }
.brand .tag { color: var(--muted); font-weight: 500; font-size: 12px; }

.topnav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.topnav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: 0.2s;
}
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a.active { color: var(--text); background: var(--surface-2); }

.install-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  font-weight: 600;
  border: 0;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s;
}
.install-btn:hover { transform: translateY(-1px); }

/* MAIN */
main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { padding: 32px 0 24px; }
.hero.slim { padding: 24px 0 16px; }
.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.05;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { color: var(--muted); font-size: 16px; max-width: 640px; line-height: 1.5; }
.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.hero-stats > div {
  display: flex;
  flex-direction: column;
}
.hero-stats strong {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stats span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

/* FILTERS */
.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0 20px;
}
.filters input[type="search"] {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: 0.2s;
}
.filters input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: 0.15s;
}
.chip:hover { color: var(--text); border-color: #3a447a; }
.chip.active {
  color: #0b0f1a;
  background: var(--text);
  border-color: var(--text);
}

/* GRID */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(124, 92, 255, 0.15), transparent 40%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card:hover { transform: translateY(-3px); border-color: #3a447a; box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-1px); }

.card .icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  flex-shrink: 0;
}
.card h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; }
.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.card .pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
  text-transform: capitalize;
}
.card .arrow { opacity: 0; transform: translateX(-4px); transition: 0.2s; }
.card:hover .arrow { opacity: 1; transform: translateX(0); }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

/* LOADING SKELETON */
.skeleton-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  animation: pulse 1.5s ease-in-out infinite;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--surface-2);
  animation: pulse 1.5s ease-in-out infinite;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ERROR STATE */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
}
.error-icon {
  font-size: 48px;
  opacity: 0.6;
}
.error-state p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* ABOUT / PROSE */
.prose { max-width: 720px; line-height: 1.7; }
.prose h1 { font-size: 32px; letter-spacing: -0.02em; margin: 12px 0 16px; }
.prose h2 { font-size: 20px; margin: 32px 0 10px; }
.prose p, .prose li { color: #c4cbe8; }
.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--accent-2);
}
.btn-link {
  background: none;
  border: 0;
  color: var(--accent-2);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font: inherit;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: 0.15s;
}
.btn-outline:hover {
  background: var(--accent);
  color: #0b0f1a;
  transform: translateY(-1px);
}
.data-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  flex-wrap: wrap;
}
.about-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.btn-danger {
  background: var(--danger);
  color: white;
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 10px;
}
.danger-zone {
  margin-top: 48px;
  padding: 20px;
  border: 1px dashed var(--danger);
  border-radius: var(--radius);
  background: rgba(255, 84, 112, 0.05);
}
.danger-zone h2 { color: var(--danger); margin-top: 0; font-size: 18px; }

/* ABOUT GRID */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0 32px;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.2s;
}
.about-card:hover { border-color: #3a447a; }
.about-card .about-icon {
  font-size: 24px;
  margin-bottom: 8px;
}
.about-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}
.about-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* TECH LIST */
.tech-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  margin: 16px 0 32px;
}
.tech-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  align-items: baseline;
}
.tech-label {
  color: var(--accent-2);
  font-weight: 600;
  white-space: nowrap;
  min-width: 70px;
}
.tech-value {
  color: #c4cbe8;
}

.prose ol {
  padding-left: 20px;
  margin: 12px 0;
}
.prose ol li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* APP DETAIL */
.detail-back { margin-bottom: 24px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.detail-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 32px;
}
.detail-icon {
  display: grid;
  place-items: center;
  width: 80px; height: 80px;
  border-radius: 20px;
  font-size: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  flex-shrink: 0;
}
.detail-info h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.detail-category {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.detail-desc {
  color: #c4cbe8;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 600px;
}
.detail-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.detail-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  font-weight: 700;
  border: 0;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  transition: transform 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.detail-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.detail-price.free {
  color: var(--good);
  font-size: 16px;
}
.detail-section {
  margin-bottom: 32px;
}
.detail-section h2 {
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--text);
}
.detail-section p {
  color: #c4cbe8;
  line-height: 1.7;
  margin: 0;
}
.detail-screenshots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.screenshot-placeholder {
  min-width: 200px;
  height: 140px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--line);
}
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.spec {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.spec-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.spec-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* FEATURED ROW */
.featured-row { margin-bottom: 24px; }
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}
.featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* LICENSE MODAL */
.modal-sm {
  width: min(90vw, 440px);
  height: auto;
}
.modal-body {
  padding: 24px;
}
.license-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.license-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
  transition: 0.2s;
}
.license-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
.license-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}
.license-hint a { color: var(--accent-2); }
.license-status {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.license-status.success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--good);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.license-status.error {
  background: rgba(255, 84, 112, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 84, 112, 0.3);
}
.license-status.loading {
  background: rgba(124, 92, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(124, 92, 255, 0.3);
}

/* ADMIN LOGIN */
.admin-login {
  display: grid;
  place-items: center;
  min-height: 60vh;
}
.admin-login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: min(90vw, 380px);
  text-align: center;
}
.admin-login-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.admin-login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}
.admin-login-card .muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-password {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: 0.2s;
}
.admin-password:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
.admin-login-status {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.admin-login-status.error {
  background: rgba(255, 84, 112, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 84, 112, 0.3);
}
.admin-login-status.loading {
  background: rgba(124, 92, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(124, 92, 255, 0.3);
}

/* ADMIN DASHBOARD */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}
.admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-logout {
  color: var(--muted) !important;
  border-color: var(--line) !important;
}
.admin-status {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.admin-status.success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--good);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.admin-status.error {
  background: rgba(255, 84, 112, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 84, 112, 0.3);
}
.admin-empty {
  color: var(--muted);
  text-align: center;
  padding: 40px;
}

/* ADMIN APP CARDS */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color 0.2s;
}
.admin-card:hover { border-color: #3a447a; }
.admin-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.admin-card-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  flex-shrink: 0;
}
.admin-card-info {
  min-width: 0;
}
.admin-card-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-card-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}
.admin-card-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.admin-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.admin-action-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: 0.15s;
}
.admin-action-btn:hover {
  color: var(--text);
  border-color: #3a447a;
}
.admin-action-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.1);
}
.admin-action-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ADMIN FORM */
.admin-form-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}
.admin-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-form-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.admin-form-row input,
.admin-form-row textarea,
.admin-form-row select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: 0.2s;
}
.admin-form-row input:focus,
.admin-form-row textarea:focus,
.admin-form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
.admin-form-row textarea {
  resize: vertical;
  min-height: 60px;
}
.admin-form-hint {
  font-size: 12px;
  color: var(--muted);
}
.admin-form-row-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ADMIN TOGGLES */
.admin-form-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.admin-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--muted);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-input:checked + .toggle-switch {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-input:checked + .toggle-switch::after {
  transform: translateX(20px);
  background: #0b0f1a;
}
.admin-select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.admin-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ANALYTICS DASHBOARD */
.analytics-section {
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.analytics-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.date-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}
.date-picker input[type="date"] {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: 0.2s;
}
.date-picker input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
.date-picker input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.analytics-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.analytics-card-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.analytics-card-value {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.analytics-table-head,
.analytics-table-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 100px;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  align-items: center;
}
.analytics-table-head {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
.analytics-table-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.analytics-table-row:last-child {
  border-bottom: 0;
}
.analytics-table-row:hover {
  background: rgba(124, 92, 255, 0.05);
}
.analytics-table-row span:not(:first-child) {
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* FOOTER */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  color: var(--muted);
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--text);
}
.offline-badge {
  background: var(--warn);
  color: #0b0f1a;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 8, 18, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s;
}
.modal-frame {
  position: relative;
  width: min(96vw, 1100px);
  height: min(90vh, 800px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop 0.25s cubic-bezier(0.2, 1, 0.3, 1);
}
@keyframes pop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head .muted { font-size: 12px; }
.modal-actions { display: flex; gap: 6px; }
.icon-btn {
  background: var(--surface-2);
  border: 0;
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  text-decoration: none;
  transition: 0.15s;
}
.icon-btn:hover { background: #2a3358; }
#modalFrame { flex: 1; border: 0; width: 100%; background: white; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .topnav { order: 3; width: 100%; }
  .topnav a { flex: 1; text-align: center; }
  main { padding: 16px 16px 80px; }
  .modal-frame { width: 100vw; height: 100vh; border-radius: 0; }
  .install-btn { font-size: 13px; padding: 7px 10px; }
  .brand .tag { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .tech-list { grid-template-columns: 1fr; }
  .data-actions { flex-direction: column; }
  .data-actions .btn-outline { width: 100%; text-align: center; }
  .detail-hero { flex-direction: column; align-items: center; text-align: center; }
  .detail-desc { max-width: 100%; }
  .detail-meta { justify-content: center; }
  .detail-actions { justify-content: center; flex-direction: column; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .license-form { flex-direction: column; }
  .admin-card { flex-direction: column; align-items: flex-start; }
  .admin-card-actions { width: 100%; justify-content: flex-end; }
  .admin-card-info p { max-width: 100%; }
  .admin-form-row-group { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .analytics-header { flex-direction: column; align-items: flex-start; }
  .analytics-table-head,
  .analytics-table-row { grid-template-columns: 1fr 70px 70px 70px; font-size: 12px; padding: 8px 10px; }
}

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

/* FOCUS VISIBLE (accessibility) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}
