/* ============================================================
   Kabul Store Admin — visual identity
   Deep indigo + warm saffron accent (Indian retail warmth,
   not the default cream/terracotta AI look)
   ============================================================ */
:root {
  --ink:      #1a1f36;   /* deep indigo ink */
  --ink-2:    #2a3152;
  --paper:    #f7f8fc;
  --card:     #ffffff;
  --line:     #e4e7f0;
  --muted:    #6b7192;
  --accent:   #e8820c;   /* saffron */
  --accent-2: #f5a623;
  --green:    #1f9d63;
  --red:      #d64545;
  --radius:   14px;
  --shadow:   0 2px 8px rgba(26,31,54,.06), 0 8px 24px rgba(26,31,54,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
}

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--ink);
  color: #c9cee4;
  padding: 24px 16px;
  position: fixed; height: 100vh;
  display: flex; flex-direction: column;
}
.brand {
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.4px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.brand-sub { font-size: 11px; color: #8891b8; margin-bottom: 28px; text-transform: uppercase; letter-spacing: 1px; }

.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: #c9cee4; text-decoration: none; font-weight: 500;
  margin-bottom: 4px; transition: all .15s;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav .icon { font-size: 16px; }

.sidebar-foot { margin-top: auto; font-size: 12px; color: #6b7192; }
.sidebar-foot a { color: #8891b8; }

.main { margin-left: 240px; flex: 1; padding: 32px 40px; width: calc(100% - 240px); }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.page-head p { color: var(--muted); margin-top: 2px; }

/* ---------- Cards / stats ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat .value { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; }
.stat .value.accent { color: var(--accent); }
.stat .value.green { color: var(--green); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
     color: var(--muted); padding: 12px 14px; border-bottom: 2px solid var(--line); font-weight: 600; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fafbff; }

.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--paper); }
.thumb-empty { display: flex; align-items: center; justify-content: center; color: #c2c8dd; font-size: 18px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.in { background: #e5f6ed; color: var(--green); }
.badge.out { background: #fbe9e9; color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 10px; border: none;
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #d3760a; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: inherit; background: var(--card);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,130,12,.12);
}
.field textarea { resize: vertical; min-height: 90px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Image upload preview ---------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 12px; margin-top: 10px; }
.img-item { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .del { position: absolute; top: 4px; right: 4px; background: rgba(214,69,69,.9); color: #fff;
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer; font-size: 13px; }
.img-item .star { position: absolute; bottom: 4px; left: 4px; background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: 6px; padding: 2px 6px; font-size: 11px; cursor: pointer; }
.img-item .star.active { background: var(--accent); }

/* ---------- Login ---------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--ink); }
.login-box { background: var(--card); padding: 40px; border-radius: 18px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { font-size: 24px; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); margin-bottom: 26px; font-size: 13px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.alert.err { background: #fbe9e9; color: var(--red); }
.alert.ok { background: #e5f6ed; color: var(--green); }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.toolbar input[type=search] { flex: 1; max-width: 320px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }

.log-msg { max-width: 340px; }
.log-msg .u { font-weight: 600; }
.log-msg .b { color: var(--muted); font-size: 13px; margin-top: 3px; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .sidebar { width: 70px; padding: 20px 8px; }
  .brand-sub, .nav a span:not(.icon), .sidebar-foot { display: none; }
  .main { margin-left: 70px; width: calc(100% - 70px); padding: 20px; }
}
