:root {
  --admin-bg: #f5f7fb;
  --admin-panel: #ffffff;
  --admin-border: #e3e8f1;
  --admin-text: #1f3152;
  --admin-muted: #7583a1;
  --admin-orange: #ff6a00;
  --admin-orange-soft: #fff1e6;
  --admin-shadow: 0 22px 60px rgba(31, 49, 82, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: linear-gradient(180deg, #fff 0%, var(--admin-bg) 100%);
  color: var(--admin-text);
}

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

button,
input,
select {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.admin-shell {
  min-height: 100vh;
}

.admin-toast {
  position: fixed;
  top: 26px;
  right: 26px;
  z-index: 1200;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 18px;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(24, 37, 64, 0.18);
  background: rgba(33, 49, 74, 0.94);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.admin-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast.is-error {
  background: rgba(212, 77, 63, 0.96);
}

.admin-toast.is-success {
  background: rgba(34, 138, 71, 0.95);
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.admin-login-card {
  width: min(100%, 1040px);
  padding: 36px;
  border: 1px solid var(--admin-border);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--admin-shadow);
}

.login-back {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--admin-orange);
  font-weight: 700;
}

.login-brand {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
}

.login-logo {
  width: 160px;
  height: auto;
}

.login-kicker {
  margin: 0 0 10px;
  color: var(--admin-orange);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-brand h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}

.login-subtitle {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--admin-muted);
  font-size: 17px;
  line-height: 1.7;
}

.login-info {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--admin-orange-soft);
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}

.info-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.14);
  color: var(--admin-orange);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.login-form label,
.settings-grid label {
  display: grid;
  gap: 8px;
}

.login-form span,
.settings-grid span {
  font-size: 14px;
  font-weight: 700;
}

.login-form input,
.table-toolbar input,
.stack-form input,
.settings-grid input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff;
}

.admin-field-group {
  display: grid;
  gap: 8px;
}

.admin-checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fbfcfe;
  font-weight: 700;
}

.admin-checkbox-group input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.secondary-hero-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #ffd8bf;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8f2, #fff);
}

.secondary-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary-hero-head strong {
  font-size: 15px;
}

.secondary-hero-head span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 600;
}

.admin-field-group span {
  font-size: 14px;
  font-weight: 700;
}

.stack-form input[type="file"] {
  padding: 12px 14px;
  border: 1px dashed #cfd7e6;
  border-radius: 14px;
  background: #fbfcfe;
}

.stack-form input[type="color"] {
  width: 100%;
  min-height: 50px;
  padding: 6px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff;
}

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

.login-submit,
.primary-action,
.table-toolbar button,
.stack-form button,
.admin-card button,
.logout-button {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ff8a1a, var(--admin-orange));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.login-message {
  min-height: 22px;
  margin: 0;
  color: #d44d3f;
  font-size: 14px;
}

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

.admin-sidebar {
  padding: 26px 22px;
  border-right: 1px solid var(--admin-border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff7f0, #fff);
  border: 1px solid #fde0cb;
}

.sidebar-brand p {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--admin-orange);
  font-weight: 700;
}

.sidebar-logo {
  width: 74px;
  height: auto;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-link {
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--admin-text);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-link:hover,
.sidebar-link.active {
  border-color: #ffd5ba;
  background: #fff4ec;
  color: var(--admin-orange);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px;
  border-radius: 20px;
  background: #f7f9fd;
  color: var(--admin-muted);
  font-size: 14px;
  line-height: 1.6;
}

.logout-button {
  width: 100%;
  margin-top: 14px;
}

.admin-main {
  padding: 28px;
}

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

.topbar-kicker {
  margin: 0 0 6px;
  color: var(--admin-orange);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-topbar h2 {
  margin: 0;
  font-size: 34px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-link {
  padding: 13px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.metric-grid,
.dashboard-grid,
.dual-card-grid,
.settings-grid,
.banner-admin-grid {
  display: grid;
  gap: 18px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card,
.admin-card,
.table-card,
.timeline-card,
.placeholder-card {
  padding: 22px;
  border: 1px solid var(--admin-border);
  border-radius: 24px;
  background: var(--admin-panel);
  box-shadow: 0 12px 30px rgba(31, 49, 82, 0.05);
}

.metric-card p,
.metric-card span {
  margin: 0;
}

.metric-card p {
  color: var(--admin-muted);
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 34px;
}

.metric-card span {
  color: var(--admin-muted);
  font-size: 14px;
}

.dashboard-grid {
  grid-template-columns: 1.3fr 1fr;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.card-head h3,
.section-intro h3,
.admin-card h4 {
  margin: 0;
}

.card-link {
  color: var(--admin-orange);
  font-size: 14px;
  font-weight: 700;
}

.card-list,
.mini-list,
.support-list {
  display: grid;
  gap: 12px;
}

.list-row,
.mini-list div,
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #edf1f7;
}

.list-row:last-child,
.mini-list div:last-child,
.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.list-row:first-child,
.mini-list div:first-child,
.timeline-item:first-child {
  padding-top: 0;
}

.list-row strong,
.mini-list strong {
  display: block;
  margin-bottom: 4px;
}

.list-row span,
.mini-list span,
.section-intro p,
.placeholder-block li,
.timeline-item span {
  color: var(--admin-muted);
}

.list-row button {
  border: 1px solid #ffd6bd;
  background: #fff5ed;
  color: var(--admin-orange);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-grid span {
  padding: 10px 14px;
  border-radius: 999px;
  background: #f7f9fd;
  font-weight: 700;
}

.section-intro {
  margin-bottom: 18px;
}

.section-intro p {
  margin: 8px 0 0;
  max-width: 760px;
  line-height: 1.65;
}

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

.table-toolbar input {
  max-width: 340px;
}

.simple-table {
  display: grid;
}

.table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.7fr;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid #edf1f7;
  align-items: center;
}

.admin-product-table .table-row {
  grid-template-columns: 1.2fr 1fr 0.6fr 0.8fr 0.8fr 1fr;
}

.admin-order-table .table-row {
  grid-template-columns: 1fr 1fr 1fr .8fr .8fr .9fr;
}

.admin-product-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.admin-icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff7f0;
  color: var(--admin-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.admin-icon-button:hover {
  transform: translateY(-1px);
  border-color: #ffd5ba;
  background: #fff1e5;
  color: var(--admin-orange);
}

.admin-icon-button.is-danger {
  background: #fff1f1;
  color: #d44747;
  border-color: #ffd8d8;
}

.admin-product-editor-grid {
  margin-top: 18px;
}

.admin-store-form {
  margin-bottom: 0;
}

.section-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.admin-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  border-radius: 28px;
  border: 1px solid #e7ebf3;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.18);
  padding: 24px;
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-modal-head h3 {
  margin: 0;
  color: var(--admin-text);
  font-size: 2rem;
}

.admin-modal-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff;
  color: var(--admin-text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.admin-product-stock-box {
  display: grid;
  gap: 12px;
}

.admin-stock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-stock-actions button {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f4f7fc;
  color: var(--admin-text);
  font-weight: 800;
  cursor: pointer;
}

.table-head {
  padding-top: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.approved {
  background: #e8f8ee;
  color: #228a47;
}

.status-pill.pending {
  background: #fff4dc;
  color: #c07b00;
}

.status-pill.blocked {
  background: #ffe7e7;
  color: #d44747;
}

.dual-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.banner-admin-grid {
  grid-template-columns: 420px 1fr;
  margin-bottom: 18px;
}

.banner-form-card {
  align-self: start;
}

.admin-select {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff;
}

.inline-message {
  min-height: 20px;
  margin: 0;
  color: #228a47;
  font-size: 14px;
  font-weight: 600;
}

.banner-list {
  display: grid;
  gap: 14px;
}

.banner-item {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #f0e2d7;
  overflow: hidden;
  position: relative;
}

.banner-item.orange {
  background: linear-gradient(135deg, #ff8c1b, #ff6900);
  color: #fff;
}

.banner-item.peach {
  background: linear-gradient(135deg, #fff0e4, #ffe0c7);
}

.banner-item.rose {
  background: linear-gradient(135deg, #ff93a7, #ff7668);
  color: #fff;
}

.banner-item.blue {
  background: linear-gradient(135deg, #dbe8ff, #b8d1ff);
}

.banner-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.banner-item p,
.banner-item h5 {
  margin: 0;
}

.banner-item h5 {
  font-size: 24px;
  line-height: 1.1;
  margin: 10px 0 8px;
}

.banner-item small {
  display: inline-flex;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.banner-item-media {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.banner-item-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
}

.banner-item-dates {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
}

.banner-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 800;
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

.banner-placement-label,
.empty-banners {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.banner-action-button {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}

.banner-item.peach .banner-action-button,
.banner-item.blue .banner-action-button {
  background: rgba(31, 49, 82, 0.08);
}

.banner-action-button.is-danger {
  background: rgba(212, 71, 71, 0.16);
}

.banner-action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.banner-secondary-grid {
  margin-top: 18px;
}

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

.banner-preview-card {
  overflow: hidden;
}

.banner-preview-surface {
  min-height: 240px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ff8c1b, #ff6900);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  background-size: cover;
  background-position: center;
}

.banner-preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.banner-preview-logo {
  display: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.18);
}

.banner-preview-date {
  display: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.banner-preview-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.banner-preview-surface h5 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.06;
}

.banner-preview-surface p {
  margin: 0;
}

.banner-preview-surface > p:last-of-type {
  max-width: 560px;
  opacity: 0.96;
  line-height: 1.6;
}

.banner-preview-link {
  display: inline-flex;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 800;
}

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

.placeholder-block ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.placeholder-block li + li {
  margin-top: 10px;
}

.accent-card {
  background: linear-gradient(135deg, #fff5eb, #fff);
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
  }

  .metric-grid,
  .dashboard-grid,
  .dual-card-grid,
  .settings-grid,
  .banner-admin-grid,
  .slot-card-grid,
  .banner-preview-grid {
    grid-template-columns: 1fr;
  }

  .date-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-login-card,
  .admin-main {
    padding: 20px;
  }

  .login-brand {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .table-toolbar,
  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-row {
    grid-template-columns: 1fr;
  }
}
