* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0d0f14;
  color: #f5f7fb;
}

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

.container {
  width: min(1150px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header,
.site-footer {
  background: #121722;
  border-bottom: 1px solid #232b3a;
}

.site-footer {
  border-top: 1px solid #232b3a;
  border-bottom: none;
  margin-top: 40px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo {
  font-size: 24px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.main-content {
  padding: 28px 0 40px;
}

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 36px;
}

.hero p,
.muted {
  color: #aeb8ca;
}

.layout-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
}

.panel {
  background: #141a25;
  border: 1px solid #232b3a;
  border-radius: 16px;
  padding: 20px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-link {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0f141d;
  border: 1px solid #232b3a;
}

.category-link.active {
  background: #1d2636;
  border-color: #3d4f70;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.product-card {
  padding: 18px;
  border-radius: 16px;
  background: #0f141d;
  border: 1px solid #232b3a;
}

.product-card h3 {
  margin: 14px 0 8px;
}

.product-top,
.product-meta,
.card-actions,
.admin-header,
.admin-links,
.checkbox-row,
.actions-cell {
  display: flex;
  align-items: center;
}

.product-top,
.product-meta,
.admin-header {
  justify-content: space-between;
  gap: 12px;
}

.product-meta {
  margin-top: 18px;
}

.product-meta.large {
  margin: 20px 0;
  font-size: 18px;
}

.card-actions,
.admin-links,
.actions-cell {
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions {
  margin-top: 18px;
}

.multi-actions form {
  margin: 0;
}

.badge,
.stock-badge {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  background: #26324a;
  color: #d6e3ff;
}

.stock-badge.in {
  background: #163323;
  color: #8df0ae;
}

.stock-badge.out {
  background: #3a1717;
  color: #ff9d9d;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 12px;
  border: none;
  background: #4c7dff;
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  opacity: 0.92;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: #232b3a;
}

.btn-danger {
  background: #b83b3b;
}

.btn-small {
  padding: 8px 12px;
  font-size: 13px;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  background: #0f141d;
  border: 1px solid #2a3343;
  border-radius: 12px;
  color: #f5f7fb;
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.checkbox-row {
  gap: 10px;
  justify-content: flex-start;
}

.checkbox-row input {
  width: auto;
}

.auth-wrap {
  display: flex;
  justify-content: center;
  padding-top: 40px;
}

.auth-card {
  width: min(460px, 100%);
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.alert.error {
  background: #3a1717;
  color: #ffb7b7;
  border: 1px solid #6e2e2e;
}

.stats-grid,
.admin-two-col {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.admin-two-col {
  grid-template-columns: 1fr 1.4fr;
}

.stat-card strong {
  font-size: 28px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #232b3a;
  vertical-align: top;
}

.link-cell {
  max-width: 360px;
  word-break: break-all;
}

.product-single {
  max-width: 720px;
}

.link-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #0f141d;
  border: 1px solid #2a3343;
  color: #9ff7b2;
  word-break: break-all;
}

.lock-wrap {
  display: flex;
  justify-content: center;
  padding-top: 40px;
}

.lock-card {
  width: min(760px, 100%);
}

.lock-admin-box {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #232b3a;
}

@media (max-width: 900px) {
  .layout-grid,
  .admin-two-col,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 30px;
  }
}