:root {
  --bg-black: #0a0a0a;
  --sidebar-bg: #000000;
  --input-bg: #1a1a1a;
  --accent-red: #ff4d4d;
  --accent-blue: #0071e3;
  --text-white: #ffffff;
  --text-gray: #86868b;
  --border-color: #333;
  --panel-bg: rgba(20, 20, 20, 0.92);
  --page-overlay: linear-gradient(rgba(10,10,10,.38), rgba(10,10,10,.38));
  --page-bg-image: url('/img/backgound.png');
  --page-bg-color: #0a0a0a;
  --shadow-soft: 0 18px 40px rgba(0,0,0,.2);
  --subtle-surface: rgba(255,255,255,.03);
  --subtle-border: rgba(255,255,255,.08);
  --sidebar-credit-bg: rgba(255,255,255,.03);
}

body[data-theme="light"] {
  --bg-black: #f6f8f2;
  --sidebar-bg: rgba(255,255,255,.94);
  --input-bg: #eef5ea;
  --accent-red: #dc2626;
  --accent-blue: #1f8f4d;
  --text-white: #0f3d2e;
  --text-gray: #627368;
  --border-color: #d7e4d4;
  --panel-bg: rgba(255,255,255,.88);
  --page-overlay: linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08));
  --page-bg-image: url('/img/backgound-light.png');
  --page-bg-color: #f6f8f2;
  --shadow-soft: 0 18px 44px rgba(15, 61, 46, .12);
  --subtle-surface: rgba(15,61,46,.04);
  --subtle-border: rgba(15,61,46,.11);
  --sidebar-credit-bg: rgba(15,61,46,.04);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    var(--page-overlay),
    var(--page-bg-image) center/cover fixed no-repeat,
    var(--page-bg-color);
  color: var(--text-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.admin-container { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  padding: 25px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 12px 0 34px rgba(0,0,0,.12);
}
body[data-theme="light"] .sidebar { backdrop-filter: blur(14px); }
.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.sidebar-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-preview-container {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  height: 60px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15,61,46,.08);
}
.logo-preview-container img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.theme-icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(15,61,46,.22);
  background: #fff !important;
  color: #0f3d2e;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(15,61,46,.10);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.theme-icon-btn:hover { transform: translateY(-1px); border-color: rgba(31,143,77,.40); box-shadow: 0 10px 22px rgba(15,61,46,.16); }
.theme-icon-btn img,
.theme-icon-img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}
.sidebar-brand { display: flex; flex-direction: column; gap: 2px; }
.eyebrow {
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 700;
}
.title { font-size: 20px; font-weight: 800; }
.side-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.section-label {
  margin: 10px 0 2px;
  color: var(--text-gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 0 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  color: var(--text-white);
  text-align: left;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  border-radius: 10px;
  font-size: 13px;
  transition: 0.2s;
  width: 100%;
}
.sidebar-link small {
  color: var(--text-gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sidebar-link.active,
.sidebar-link:hover { background: var(--input-bg); }
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn-logout {
  display: block;
  background: var(--accent-red);
  color: #fff;
  text-decoration: none;
  padding: 15px;
  text-align: center;
  border-radius: 15px;
  font-weight: 700;
  font-size: 14px;
  border: 0;
}
.btn-logout:hover { filter: brightness(1.05); }
.sidebar-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--subtle-border);
  border-radius: 14px;
  background: var(--sidebar-credit-bg);
}
.sidebar-credit-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}
.sidebar-credit-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.sidebar-credit-text span { color: var(--text-gray); font-size: 11px; }
.sidebar-credit-text strong { font-size: 13px; color: var(--text-gray); }

.admin-content {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 48px;
}

.shell-view { display: none; }
.shell-view.active { display: block; }

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-title h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.05;
}
.dashboard-title p {
  margin: 12px 0 0;
  color: var(--text-gray);
  max-width: 780px;
  line-height: 1.6;
}
.dashboard-chip {
  background: var(--subtle-surface);
  border: 1px solid var(--subtle-border);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text-gray);
  font-size: 13px;
  white-space: nowrap;
}
.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.dashboard-card {
  background: var(--panel-bg);
  border: 1px solid var(--subtle-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.dashboard-card h2 { margin: 0 0 18px; font-size: 18px; letter-spacing: 1px; }

.stat-tile,
.placeholder-row,
.shortcut-tile,
.catalog-card,
.empty-state,
.account-card,
.metric-tile {
  border: 1px solid var(--subtle-border);
  background: var(--subtle-surface);
  border-radius: 16px;
}
.stat-tile { padding: 18px; }
.stat-label { color: var(--text-gray); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat-value { margin-top: 8px; font-size: 30px; font-weight: 800; }
.stat-sub { color: var(--text-gray); margin-top: 4px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.placeholder-list,
.card-grid,
.shortcut-grid,
.account-stack { display: grid; gap: 12px; }
.placeholder-row {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.placeholder-row strong { display: block; margin-bottom: 3px; }
.placeholder-row span,
.placeholder-row small { color: var(--text-gray); }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.catalog-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.catalog-tag {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-gray);
  background: var(--subtle-surface);
}
.catalog-card h3 { margin: 0; }
.catalog-card p { margin: 0; color: var(--text-gray); line-height: 1.5; }
.catalog-price { font-size: 22px; font-weight: 800; margin-top: 6px; }
.btn-primary-link,
.btn-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
}
.btn-primary-link { background: var(--accent-blue); color: #fff; }
.btn-secondary-link { background: var(--subtle-surface); color: var(--text-white); border: 1px solid var(--subtle-border); }
.shortcut-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shortcut-tile {
  padding: 16px;
  text-align: center;
  font-weight: 700;
  min-height: 72px;
  display: grid;
  place-items: center;
}
.empty-state {
  padding: 22px;
  color: var(--text-gray);
}
.account-card {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.account-card p { margin: 8px 0 0; color: var(--text-gray); }

@media (max-width: 1100px) {
  .admin-container { flex-direction: column; }
  .sidebar { width: auto; min-height: auto; }
  .admin-content { padding: 24px; }
  .dashboard-grid,
  .metric-grid,
  .card-grid,
  .shortcut-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-hero,
  .account-card { align-items: flex-start; }
}
@media (max-width: 720px) {
  .admin-content { padding: 16px; }
  .dashboard-hero,
  .account-card,
  .placeholder-row { flex-direction: column; align-items: flex-start; }
  .dashboard-grid,
  .metric-grid,
  .card-grid,
  .shortcut-grid { grid-template-columns: 1fr; }
}
