/* Admin keeps its own clean light theme, independent of the dark storefront palette */
:root {
  --bg: #faf7f5;
  --bg-2: #f3ece8;
  --ink: #2b2320;
  --muted: #8a7f78;
  --line: #ece5e0;
  --card: #ffffff;
  --accent: #b4485f;
  --accent-dark: #8e3247;
  --gold: #b98a2f;
  --shadow: 0 10px 30px rgba(60, 40, 40, 0.08);
  --radius: 16px;
}
body { background: var(--bg); color: var(--ink); font-family: "Segoe UI", system-ui, sans-serif; margin: 0; }
body::before { display: none; }

/* base components (admin no longer relies on the storefront's dark styles.css) */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.brand { line-height: 1.1; }
.brand-mark { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.brand-mark span { color: var(--accent); }
.brand-tag { display: block; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
nav { display: flex; align-items: center; gap: 22px; }
nav a { font-weight: 600; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); }
.cart-btn { border: 1px solid var(--line); background: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--ink); }
.btn-primary { width: 100%; border: none; background: var(--accent); color: #fff; padding: 13px; border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: var(--accent-dark); }
.modal-card { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.modal-card h2 { font-family: "Segoe UI", system-ui, sans-serif; font-size: 24px; margin: 0 0 16px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--muted); }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); }
.admin-form input:focus, .admin-form textarea:focus { outline: none; border-color: var(--accent); }
.empty-cart { text-align: center; color: var(--muted); padding: 40px 0; }

/* tag checkboxes on product form */
.tag-field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin-bottom: 14px; }
.tag-field legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.tag-field .chk { display: inline-flex; align-items: center; gap: 7px; margin-right: 16px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.tag-field .chk input { width: auto; margin: 0; }
/* live image preview on file pick */
.img-preview { display: block; margin-top: 8px; width: 100%; max-height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* gallery manager on product form */
.gallery-manage { margin-bottom: 14px; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.gallery-thumbs .gt { position: relative; }
.gallery-thumbs img { width: 54px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.gallery-thumbs .gt-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center; }

.a-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.a-tag { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; background: #f4e7d6; color: #8a6a2a; border: 1px solid #e6d3b3; padding: 2px 7px; border-radius: 999px; }

.login-wrap { display: flex; justify-content: center; padding: 70px 20px; }
.login-wrap .modal-card { width: 360px; }
.err { color: var(--accent); font-size: 13px; margin-top: 10px; }

.admin-main { max-width: 1200px; margin: 0 auto; padding: 26px 22px 80px; }
.tabs { display: flex; gap: 10px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; padding: 12px 18px; font-weight: 700; font-size: 15px;
  color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.panel-grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.card-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-panel h3 { margin: 0 0 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-weight: 400; color: var(--gold); font-size: 11px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-ghost { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; font-weight: 700; cursor: pointer; }
.pill { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--muted); }

.admin-list { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.admin-row { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.admin-row .thumbs { display: flex; }
.admin-row .thumbs img { width: 42px; height: 52px; object-fit: cover; border-radius: 6px; }
.admin-row .thumbs img + img { margin-left: -8px; border: 2px solid #fff; }
.admin-row .a-info { flex: 1; }
.admin-row .a-info b { display: block; }
.admin-row .a-info small { color: var(--muted); }
.admin-row .a-price .now { color: var(--accent); font-weight: 700; }
.admin-row .a-price .old { text-decoration: line-through; color: var(--muted); font-size: 12px; margin-left: 6px; }
.admin-row .a-price .cost { display: block; font-size: 11px; color: var(--gold); }
.row-actions { display: flex; flex-direction: column; gap: 6px; }
.row-actions button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; font-weight: 600; }
.row-actions .del { color: var(--accent); border-color: #f0d0d8; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.stat-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-val { font-size: 24px; font-weight: 800; }
.stat.profit { background: linear-gradient(135deg, #2b2320, #4a3b36); color: #fff; }
.stat.profit .stat-label { color: #d8c7bf; }

.orders-list { display: flex; flex-direction: column; gap: 14px; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.order-head b { font-size: 16px; }
.order-head .meta { color: var(--muted); font-size: 13px; }
.order-items { margin: 10px 0; font-size: 14px; color: #4a3f3a; }
.order-items .oi { display: flex; justify-content: space-between; padding: 2px 0; }
.order-foot { display: flex; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; }
.order-foot .profit { color: #2e7d54; font-weight: 800; }
.status-select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-weight: 600; }

/* draft badge */
.draft-badge { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: #f3e9c0; color: #7a6000; border: 1px solid #e8d580; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.pub-chk { margin-bottom: 14px; color: var(--ink); font-size: 14px; font-weight: 600; }

/* stock alert */
.stock-alert { background: #fff8ec; border: 1px solid #f5d27a; color: #7a5a00; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; line-height: 1.5; }

/* product search */
.prod-search { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-family: inherit; background: var(--bg); color: var(--ink); margin-bottom: 12px; }
.prod-search:focus { outline: none; border-color: var(--accent); }

@media (max-width: 820px) {
  .panel-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
