/* ============================================================
   Zainaty Parfume — Admin skeleton
   Visual language: Shopify-admin structure, black/bone brand palette.
   ============================================================ */

:root{
  --bg:            #f4f2ef;   /* page ground, warm off-white/bone */
  --surface:       #ffffff;
  --surface-2:     #faf9f7;
  --border:         #e6e1d8;
  --border-strong:  #d8d1c4;

  --ink:           #1c1a17;   /* near-black, warm */
  --ink-soft:      #57524a;
  --ink-faint:     #8a837a;

  --accent:        #1c1a17;   /* primary buttons = black */
  --accent-contrast:#ffffff;
  --bone:          #e9e2d3;   /* Zainaty beige */
  --bone-deep:     #c9bd9f;

  --success-bg:    #e7f3ea;
  --success-ink:   #1c6b3c;
  --warn-bg:       #f4ecd8;
  --warn-ink:      #8a6a1f;
  --danger-bg:     #fbe9e7;
  --danger-ink:    #a5311f;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(28,26,23,0.04), 0 1px 1px rgba(28,26,23,0.03);
  --shadow-pop:  0 8px 24px rgba(28,26,23,0.12);

  --sidebar-w: 240px;
  --topbar-h: 56px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size:13.5px;
  -webkit-font-smoothing: antialiased;
  min-width: 1280px;
}

a{ color:inherit; text-decoration:none; }
button{ font-family: inherit; }
ul{ margin:0; padding:0; list-style:none; }

/* ---------------- App shell ---------------- */
.app-shell{
  display:flex;
  min-height:100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar{
  width: var(--sidebar-w);
  flex-shrink:0;
  background: var(--ink);
  color: #f2efe9;
  display:flex;
  flex-direction:column;
  padding: 12px 10px 16px;
}

.store-switcher{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 8px;
  margin-bottom:8px;
  border-radius: var(--radius-md);
  cursor:pointer;
  transition: background .12s ease;
}
.store-switcher:hover{ background: rgba(255,255,255,0.06); }
.store-mark{
  width:28px; height:28px;
  border-radius:7px;
  background: var(--bone);
  color: var(--ink);
  font-weight:700;
  font-size:14px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.store-name-block{
  display:flex;
  flex-direction:column;
  line-height:1.25;
  overflow:hidden;
}
.store-name{
  font-weight:600;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.store-sub{
  font-size:11px;
  color: rgba(242,239,233,0.5);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.chev{ margin-left:auto; color: rgba(242,239,233,0.5); flex-shrink:0; }

.nav{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-top:6px;
}
.nav-link{
  display:flex;
  align-items:center;
  gap:11px;
  padding:9px 10px;
  border-radius: var(--radius-md);
  color: rgba(242,239,233,0.78);
  font-size:13.5px;
  font-weight:500;
  transition: background .12s ease, color .12s ease;
}
.nav-link svg{ width:18px; height:18px; flex-shrink:0; }
.nav-link:hover{ background: rgba(255,255,255,0.07); color:#fff; }
.nav-link.is-active{
  background: rgba(255,255,255,0.12);
  color:#fff;
}
.nav-badge{
  margin-left:auto;
  background: rgba(255,255,255,0.18);
  color:#fff;
  font-size:11px;
  font-weight:600;
  padding:1px 7px;
  border-radius:999px;
}
.nav-divider{
  height:1px;
  background: rgba(255,255,255,0.1);
  margin:10px 4px;
}
.sidebar-footer{
  margin-top:auto;
  padding:10px 10px 2px;
  font-size:11px;
  color: rgba(242,239,233,0.35);
}

/* ---------------- Main / topbar ---------------- */
.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  height: var(--topbar-h);
  flex-shrink:0;
  background: var(--surface);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 20px;
  gap:20px;
}

.topbar-search{
  display:flex;
  align-items:center;
  gap:8px;
  background: var(--surface-2);
  border:1px solid var(--border);
  border-radius: var(--radius-md);
  padding:7px 10px;
  width:380px;
  color: var(--ink-faint);
  transition: border-color .12s ease, background .12s ease;
}
.topbar-search:focus-within{
  border-color: var(--border-strong);
  background: var(--surface);
}
.topbar-search svg{ width:16px; height:16px; flex-shrink:0; }
.topbar-search input{
  border:none;
  outline:none;
  background:transparent;
  flex:1;
  font-size:13px;
  color: var(--ink);
  font-family: inherit;
}
.topbar-search input::placeholder{ color: var(--ink-faint); }
.topbar-search kbd{
  font-size:11px;
  color: var(--ink-faint);
  background: var(--surface);
  border:1px solid var(--border);
  border-radius:4px;
  padding:1px 5px;
}
.topbar-search.small{ width:260px; padding:6px 10px; }

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}
.icon-btn{
  position:relative;
  width:34px; height:34px;
  border-radius: var(--radius-md);
  border:1px solid var(--border);
  background: var(--surface);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  color: var(--ink-soft);
}
.icon-btn svg{ width:17px; height:17px; }
.icon-btn:hover{ background: var(--surface-2); }
.icon-btn .dot{
  position:absolute;
  top:6px; right:7px;
  width:6px; height:6px;
  border-radius:50%;
  background:#c0392b;
  border:1.5px solid var(--surface);
}
.avatar{
  width:32px; height:32px;
  border-radius:50%;
  background: var(--bone);
  color: var(--ink);
  font-size:12px;
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}

/* ---------------- Content ---------------- */
.content{
  flex:1;
  padding: 24px 28px 60px;
  overflow-y:auto;
  max-width:1400px;
  width:100%;
}

.page-header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:20px;
}
.page-header h1{
  font-size:20px;
  font-weight:700;
  margin:0;
  letter-spacing:-0.01em;
}
.page-header-actions{
  margin-left:auto;
  display:flex;
  gap:8px;
}
.page-header.with-back{ gap:8px; }
.back-link{
  width:30px; height:30px;
  border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
  background: var(--surface);
  flex-shrink:0;
}
.back-link:hover{ background: var(--surface-2); }

/* ---------------- Buttons ---------------- */
.btn{
  font-size:13px;
  font-weight:600;
  padding:8px 14px;
  border-radius: var(--radius-md);
  border:1px solid transparent;
  cursor:pointer;
  transition: background .12s ease, border-color .12s ease, transform .05s ease;
  white-space:nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover{ background:#332f29; }
.btn-secondary{
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover{ background: var(--surface-2); }

/* ---------------- Cards / panels ---------------- */
.card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding:18px 20px;
  margin-bottom:18px;
}
.card.no-pad{ padding:0; }
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}
.card-head h2{ font-size:14px; font-weight:600; margin:0; }
.section-title{
  font-size:14px;
  font-weight:600;
  margin:0 0 12px;
}
.link{ font-size:12.5px; font-weight:600; color: var(--ink-soft); }
.link:hover{ text-decoration: underline; }

.mini-select{
  font-size:12.5px;
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:5px 8px;
  background: var(--surface);
  color: var(--ink-soft);
}

/* ---------------- Stat grid ---------------- */
.stat-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:16px;
  margin-bottom:20px;
}
.stat-grid-3{ grid-template-columns: repeat(3, 1fr); }
.stat-card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.stat-label{ font-size:12px; color: var(--ink-faint); font-weight:500; }
.stat-value{ font-size:24px; font-weight:700; letter-spacing:-0.01em; }
.stat-delta{ font-size:11.5px; font-weight:600; }
.stat-delta.up{ color: var(--success-ink); }
.stat-delta.down{ color: var(--danger-ink); }

.panel-row{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:16px;
}

.bestseller-list{ display:flex; flex-direction:column; gap:12px; }
.bestseller-list li{
  display:flex;
  align-items:center;
  gap:10px;
}
.bs-thumb{
  width:34px; height:34px;
  border-radius:7px;
  background: var(--bone);
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:11px;
  font-weight:700;
  color: var(--ink);
  overflow:hidden;
}
.bs-thumb img{ width:100%; height:100%; object-fit:cover; }
.bs-info{ display:flex; flex-direction:column; line-height:1.3; overflow:hidden; }
.bs-name{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bs-meta{ font-size:11.5px; color: var(--ink-faint); }
.bs-sales{ margin-left:auto; font-size:12.5px; font-weight:600; flex-shrink:0; }

/* ---------------- Tables ---------------- */
.table-wrap{ overflow-x:auto; }
.data-table{
  width:100%;
  border-collapse: collapse;
  font-size:13px;
}
.data-table thead th{
  text-align:left;
  font-size:11.5px;
  font-weight:600;
  color: var(--ink-faint);
  text-transform:uppercase;
  letter-spacing:.02em;
  padding:11px 14px;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
.data-table tbody td{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
  white-space:nowrap;
}
.data-table tbody tr:last-child td{ border-bottom:none; }
.data-table tbody tr:hover{ background: var(--surface-2); }
.data-table.selectable tbody tr{ cursor:pointer; }
.col-check{ width:36px; }
.data-table .cell-wrap{ white-space:normal; }

.row-product{
  display:flex;
  align-items:center;
  gap:10px;
}
.row-thumb{
  width:36px; height:36px;
  border-radius:7px;
  background: var(--bone);
  flex-shrink:0;
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
  font-size:11px;
  color: var(--ink);
}
.row-thumb img{ width:100%; height:100%; object-fit:cover; }
.row-title{ font-weight:600; }
.row-sub{ font-size:11.5px; color: var(--ink-faint); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:11.5px;
  font-weight:600;
  padding:3px 9px;
  border-radius:999px;
}
.badge::before{ content:''; width:6px; height:6px; border-radius:50%; }
.badge-active{ background: var(--success-bg); color: var(--success-ink); }
.badge-active::before{ background: var(--success-ink); }
.badge-draft{ background: var(--warn-bg); color: var(--warn-ink); }
.badge-draft::before{ background: var(--warn-ink); }
.badge-fulfilled{ background: var(--success-bg); color: var(--success-ink); }
.badge-fulfilled::before{ background: var(--success-ink); }
.badge-pending{ background: var(--warn-bg); color: var(--warn-ink); }
.badge-pending::before{ background: var(--warn-ink); }
.badge-cancelled{ background: var(--danger-bg); color: var(--danger-ink); }
.badge-cancelled::before{ background: var(--danger-ink); }

.table-footer{
  padding:12px 16px;
  font-size:12px;
  color: var(--ink-faint);
  border-top:1px solid var(--border);
}

/* ---------------- Toolbar / filters ---------------- */
.toolbar{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.filter-pills{ display:flex; gap:6px; }
.pill{
  font-size:12.5px;
  font-weight:600;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor:pointer;
}
.pill:hover{ background: var(--surface-2); }
.pill.active{
  background: var(--ink);
  color:#fff;
  border-color: var(--ink);
}

/* ---------------- Forms (Add/Edit product, Settings) ---------------- */
.form-layout{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:18px;
  align-items:start;
}
.form-main, .form-side{ display:flex; flex-direction:column; }

.field-label{
  display:block;
  font-size:12.5px;
  font-weight:600;
  margin: 14px 0 6px;
}
.card > .field-label:first-child{ margin-top:0; }
.field-input{
  width:100%;
  font-family: inherit;
  font-size:13px;
  padding:9px 11px;
  border-radius: var(--radius-sm);
  border:1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  outline:none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field-input:focus{
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(28,26,23,0.08);
}
textarea.field-input{ resize:vertical; }

.checkbox-row{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:13px;
  cursor:pointer;
}
.checkbox-row input[type="checkbox"]{ width:16px; height:16px; accent-color: var(--ink); cursor:pointer; }

.badge-featured{ background: var(--bone); color: var(--ink); }
.badge-featured::before{ display:none; }

.field-row-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.prefix-input{
  display:flex;
  align-items:center;
  border:1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow:hidden;
  background: var(--surface);
}
.prefix-input:focus-within{
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(28,26,23,0.08);
}
.prefix-input span{
  padding:9px 10px;
  background: var(--surface-2);
  color: var(--ink-faint);
  font-size:13px;
  border-right:1px solid var(--border);
}
.prefix-input .field-input{
  border:none;
  box-shadow:none !important;
}

.dropzone{
  border:1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  min-height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: border-color .12s ease, background .12s ease;
  position:relative;
  overflow:hidden;
}
.dropzone:hover, .dropzone.dragover{
  border-color: var(--ink);
  background: var(--surface-2);
}
.dropzone-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  text-align:center;
  color: var(--ink-soft);
  padding:24px;
}
.dropzone-inner svg{ color: var(--ink-faint); }
.dropzone-inner p{ margin:0; font-size:13px; }
.muted-sm{ font-size:11.5px; color: var(--ink-faint); }
.dropzone-preview{
  width:100%;
  height:220px;
  object-fit:cover;
}

.form-actions{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:16px;
}
.save-confirm{
  font-size:12.5px;
  font-weight:600;
  color: var(--success-ink);
  opacity:0;
  transition: opacity .2s ease;
}
.save-confirm.show{ opacity:1; }

/* ---------------- Empty state ---------------- */
.empty-state{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:52px 20px;
}
.empty-illustration{
  width:56px; height:56px;
  border-radius:50%;
  background: var(--bone);
  color: var(--ink);
  font-size:22px;
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:14px;
}
.empty-state h2{ margin:0 0 6px; font-size:15px; }
.empty-state p{ max-width:360px; margin:0; }

/* ---------------- Scrollbar polish ---------------- */
.content::-webkit-scrollbar{ width:10px; }
.content::-webkit-scrollbar-thumb{ background: var(--border-strong); border-radius:6px; }
.content::-webkit-scrollbar-track{ background: transparent; }
