:root {
  --admin-bg: #f3f6fb;
  --admin-sidebar: #0f172a;
  --admin-sidebar-muted: #94a3b8;
  --admin-sidebar-active: #1d4ed8;
  --admin-text: #0f172a;
  --admin-muted: #475569;
  --admin-border: #dbe3ef;
  --admin-card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--admin-text);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: radial-gradient(circle at top right, #eaf2ff 0%, #f7f9fc 40%, #f3f6fb 100%);
}

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-panel {
  width: min(460px, 100%);
}

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

.admin-sidebar {
  background: linear-gradient(180deg, #111c33 0%, var(--admin-sidebar) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-sidebar__title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 4px 8px 16px;
}

.admin-sidebar__nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar__link {
  color: var(--admin-sidebar-muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  transition: 0.18s ease;
}

.admin-sidebar__link:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
}

.admin-sidebar__link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--admin-sidebar-active) 0%, #1e40af 100%);
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  background: rgba(247, 250, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-topbar__actions form {
  margin: 0;
}

.admin-menu-btn {
  display: none !important;
}

.card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.page-title,
.section-title {
  margin: 0 0 6px;
}

.mb-12 {
  margin-bottom: 12px;
}

.top,
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row.wrap {
  flex-wrap: wrap;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.row-actions form,
.inline {
  margin: 0;
}

.meta {
  color: var(--admin-muted);
  font-size: 13px;
}

.btn,
.btn-secondary,
.btn-outline,
.btn-gray,
.btn-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 0;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn .icon,
.btn-secondary .icon,
.btn-outline .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.compact,
.btn-secondary.compact,
.btn-outline.compact,
.btn-gray.compact {
  padding: 8px 10px;
  gap: 5px;
}

.btn.icon-only,
.btn-secondary.icon-only,
.btn-outline.icon-only,
.btn-gray.icon-only {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  gap: 0;
}

.btn {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn:hover {
  filter: brightness(1.05);
  color: #fff;
}

.btn-secondary {
  color: #fff;
  background: #334155;
}

.btn-secondary:hover {
  color: #fff;
  background: #1e293b;
}

.btn-outline {
  color: #0f172a;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.btn-outline:hover {
  background: #f8fafc;
}

.btn-red {
  color: #fff;
  background: #dc2626;
}

.btn-red:hover {
  color: #fff;
  background: #b91c1c;
}

.btn-gray {
  color: #0f172a;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.ok,
.err {
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
}

.ok {
  background: #dcfce7;
  border: 1px solid #86efac;
}

.err {
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.top-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
  font-size: 13px;
}

input[type='text'],
input[type='number'],
input[type='email'],
input[type='password'],
textarea,
select {
  width: 100%;
  border: 1px solid #c6d2e6;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}

textarea {
  min-height: 95px;
}

.w-100 { width: 100%; }
.w-sm { width: 120px; }
.w-md { width: 180px; }
.w-lg { width: 240px; }
.w-xl { width: 360px; }

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 6px;
  text-align: left;
  vertical-align: top;
}

td.row-actions,
.row-actions td {
  white-space: nowrap;
}

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

  .admin-sidebar {
    display: none;
  }

  .admin-menu-btn {
    display: inline-flex !important;
  }

}

@media (max-width: 720px) {
  .top,
  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .row-actions {
    flex-wrap: wrap;
    white-space: normal;
  }

  .admin-topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 12px;
    align-items: flex-start;
  }

  .admin-topbar__actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .w-sm,
  .w-md,
  .w-lg,
  .w-xl {
    width: 100%;
  }
}
