/* ─── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0e0e10;
  --bg2: #18181b;
  --bg3: #27272a;
  --border: #3f3f46;
  --accent: #a78bfa;
  --accent2: #7c3aed;
  --text: #fafafa;
  --text2: #a1a1aa;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, .btn { cursor: pointer; border: none; font-family: inherit; font-size: .9rem; }

/* ─── UTILITIES ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-sm { font-size: .85rem; }
.text-muted { color: var(--text2); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ─── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.2rem; border-radius: var(--radius); font-weight: 500; transition: .15s; }
.btn-primary { background: var(--accent2); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-icon { width: 2rem; height: 2rem; padding: 0; justify-content: center; }

/* ─── FORMS ────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
label { font-size: .85rem; color: var(--text2); font-weight: 500; }
input, textarea, select {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: .6rem .9rem; font-size: .9rem; font-family: inherit;
  transition: border-color .15s; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ─── CARD ─────────────────────────────────────────────────────────────────── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }

/* ─── BADGE ────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-yellow { background: rgba(251,191,36,.15); color: var(--warning); }
.badge-blue   { background: rgba(96,165,250,.15); color: #60a5fa; }
.badge-green  { background: rgba(74,222,128,.15); color: var(--success); }
.badge-red    { background: rgba(248,113,113,.15); color: var(--danger); }
.badge-gray   { background: var(--bg3); color: var(--text2); }

/* ─── MODAL ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.2rem; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }

/* ─── TOAST ────────────────────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1.25rem; font-size: .9rem; box-shadow: var(--shadow);
  animation: slideIn .2s ease; max-width: 320px;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger); color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── TABS ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: .6rem 1rem; background: none; border: none; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .9rem; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── TABLE ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: .75rem 1rem; color: var(--text2); font-weight: 500; border-bottom: 1px solid var(--border); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--bg3); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* ─── IMAGES UPLOAD ────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem;
  text-align: center; cursor: pointer; transition: border-color .15s; color: var(--text2);
}
.upload-zone:hover, .upload-zone.dragging { border-color: var(--accent); color: var(--accent); }
.upload-zone input { display: none; }
.images-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.images-preview .img-item { position: relative; width: 80px; height: 80px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.images-preview .img-item img { width: 100%; height: 100%; object-fit: cover; }
.images-preview .img-item .remove-img { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 4px; width: 18px; height: 18px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ─── EMPTY STATE ──────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 4rem 2rem; color: var(--text2); }
.empty svg { width: 3rem; height: 3rem; margin: 0 auto 1rem; opacity: .4; }
.empty h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text); }

/* ─── STAT CARDS ───────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .stat-label { font-size: .8rem; color: var(--text2); margin-bottom: .5rem; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-sub { font-size: .8rem; color: var(--text2); margin-top: .25rem; }

/* ─── SCROLLBAR ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
