:root {
  --ink: #15202b;
  --muted: #657386;
  --line: #d9e2ec;
  --blue: #153f8f;
  --orange: #f06f23;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --shadow: 0 18px 45px rgba(21, 63, 143, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--blue);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  background: #071a34;
  color: #fff;
}

.sidebar h1 {
  margin: 0 0 24px;
  font-size: 1.25rem;
}

.sidebar a {
  display: block;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 800;
}

.sidebar a:hover,
.sidebar a.active {
  color: #fff;
}

.admin-main {
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.panel {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.button.secondary {
  background: var(--blue);
}

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e7f7ed;
  color: #116b35;
  font-weight: 800;
}

.alert.error {
  background: #fdeaea;
  color: #9d1c1c;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-card {
  width: min(430px, calc(100% - 32px));
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-top: 0;
}

.login-card form {
  display: grid;
  gap: 12px;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.thumb {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.thumb code {
  display: block;
  padding: 8px;
  font-size: 0.75rem;
  word-break: break-all;
}

@media (max-width: 880px) {
  .admin-shell,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}
