:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --color-bg: #f7f7f8;
  --color-surface: #ffffff;
  --color-border: #d4d7dd;
  --color-text: #111317;
  --color-muted: #5f6773;
  --color-accent: #1d9bf0;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
  --color-bg: #0f1115;
  --color-surface: #161920;
  --color-border: #262a33;
  --color-text: #f8fafc;
  --color-muted: #9aa0ac;
  --color-accent: #66b7ff;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 4vw;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  z-index: 10;
}

[data-theme="dark"] .top-nav {
  background: rgba(15, 17, 21, 0.85);
}

.brand {
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--color-text);
}

.theme-toggle {
  display: inline-flex;
  gap: 0.5rem;
  background: var(--color-surface);
  border-radius: 999px;
  padding: 0.25rem;
  box-shadow: var(--shadow);
}

.theme-toggle button {
  border: none;
  background: transparent;
  color: var(--color-muted);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.theme-toggle button:hover,
.theme-toggle button:focus {
  background: var(--color-border);
  color: var(--color-text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link,
.nav-user {
  color: var(--color-text);
  font-size: 0.95rem;
}

.main-content {
  flex: 1;
  padding: 4rem 6vw 6rem;
}

.hero {
  display: grid;
  place-items: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, rgba(29, 155, 240, 0.12), transparent);
  border-radius: var(--radius);
  margin-bottom: 3rem;
}

.hero-content {
  text-align: center;
  max-width: 520px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--color-muted);
  font-size: 1.1rem;
}

.tiles-section h3 {
  margin: 2rem 0 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}

.tile {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.tile span {
  color: var(--color-text);
  font-weight: 500;
}

.tile:hover,
.tile:focus {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(17, 23, 34, 0.18);
}

.cta {
  text-align: center;
  padding: 3rem;
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.btn,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn:focus,
.btn-secondary:focus,
.btn-danger:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.form-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

label {
  font-size: 0.95rem;
  color: var(--color-muted);
}

input,
select,
textarea {
  font-family: inherit;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.form-error {
  color: #e11d48;
  font-size: 0.85rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.alert-error {
  background: rgba(225, 29, 72, 0.1);
  color: #be123c;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.alert-warning {
  background: rgba(250, 204, 21, 0.12);
  color: #b45309;
}

.admin-header {
  margin-bottom: 2rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
  align-items: end;
}

.admin-grid {
  gap: 2rem;
}

.tile-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.tile-card form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tile-card img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--color-bg);
  padding: 0.5rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.table-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form input,
.inline-form select {
  flex: 1 1 160px;
}

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

@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 1rem;
  }
  .main-content {
    padding: 2.5rem 5vw 4rem;
  }
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  .table-actions {
    gap: 1.5rem;
  }
}
