/* =============================================
   SAPNA ENTERPRISES – Admin Panel Styles v2
   ============================================= */
:root {
  --navy:        #0d1b2a;
  --navy-mid:    #1b2f45;
  --steel:       #2563eb;
  --steel-light: #3b82f6;
  --steel-dark:  #1d4ed8;
  --orange:      #f97316;
  --red:         #ef4444;
  --green:       #16a34a;
  --green-wa:    #25d366;
  --green-wa-dk: #128c7e;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --bg:          #f8fafc;
  --white:       #fff;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --sidebar:     240px;
  --topbar:      56px;
  --transition:  all .22s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Outfit', 'Inter', sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; }
.hidden { display: none !important; }

/* ── LOGIN ─────────────────────────────────── */
.login-screen {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}
.login-card {
  background: var(--white); border-radius: 18px;
  padding: 44px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.logo-mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--steel), var(--steel-light));
  color: #fff; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.login-brand { font-weight: 700; font-size: 16px; }
.login-sub   { font-size: 12px; color: var(--text-muted); }
.login-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.error-msg  { color: var(--red); font-size: 13px; margin-top: 10px; }

/* ── ADMIN LAYOUT ──────────────────────────── */
.admin-app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 49;
}
.sidebar-backdrop.open { display: block; }

.sidebar {
  width: var(--sidebar); background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.sidebar-brand-wrap { min-width: 0; }
.sidebar-brand { color: #fff; font-weight: 700; font-size: 14px; }
.sidebar-sub {
  color: #64748b; font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.sidebar-nav {
  flex: 1; display: flex; flex-direction: column;
  gap: 2px; padding: 16px 12px; overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 9px; border: none;
  background: transparent; color: #94a3b8; font-size: 14px;
  font-weight: 500; cursor: pointer; text-align: left;
  transition: var(--transition); position: relative; font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: var(--steel); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,0.35); }
.badge {
  margin-left: auto; background: var(--red); color: #fff;
  border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-ext-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 8px;
  color: #64748b; font-size: 13px; font-weight: 500;
  transition: var(--transition); text-decoration: none;
}
.sidebar-ext-link:hover { background: rgba(255,255,255,0.06); color: #94a3b8; }
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent; color: #94a3b8;
  font-size: 13px; cursor: pointer; transition: var(--transition); font-family: inherit;
}
.logout-btn:hover { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* ── MAIN CONTENT ────────────────────────────── */
.main-content {
  margin-left: var(--sidebar); flex: 1;
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ── TOP BAR ─────────────────────────────────── */
.top-bar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar); padding: 0 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-toggle {
  display: none; background: none; border: none;
  color: var(--text-muted); cursor: pointer; padding: 6px;
  border-radius: 7px; transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
.top-bar-title { font-weight: 700; font-size: 15px; color: var(--navy); }
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-bar-user { font-size: 13px; color: var(--text-muted); }
.refresh-btn {
  background: none; border: 1.5px solid var(--border);
  border-radius: 7px; padding: 6px 9px; cursor: pointer;
  color: var(--text-muted); transition: var(--transition);
}
.refresh-btn:hover { border-color: var(--steel); color: var(--steel); }

/* ── PAGES ─────────────────────────────────── */
.page { display: none; padding: 28px 32px; }
.page.active { display: block; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--navy); }
.page-header p  { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

/* ── CARDS ─────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 24px;
}
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 16px; font-weight: 700; }
.card-toolbar {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.toolbar-search {
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none;
  width: 280px; transition: var(--transition); font-family: inherit;
}
.toolbar-search:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.card-toolbar select {
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; background: var(--white);
  cursor: pointer; font-family: inherit; outline: none; transition: var(--transition);
}
.card-toolbar select:focus { border-color: var(--steel); }

/* BULK ACTION BAR */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; background: #fff3cd;
  border: 1.5px solid #ffd43b; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #6b4c00;
}

/* ── STATS ─────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  font-size: 26px; width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.green  { background: #f0fdf4; }
.stat-icon.orange { background: #fff7ed; }
.stat-icon.purple { background: #faf5ff; }
.stat-val   { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── TABLE ─────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 11px 14px; font-size: 11.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); background: var(--bg);
  border-bottom: 1.5px solid var(--border);
}
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: 14px; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.data-table input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--steel); }
.table-img {
  width: 48px; height: 40px; object-fit: cover;
  border-radius: 6px; background: var(--bg);
}
.table-img-placeholder {
  width: 48px; height: 40px; border-radius: 6px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}

/* ── PILLS ─────────────────────────────────── */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.pill-green  { background: #dcfce7; color: #166534; }
.pill-red    { background: #fee2e2; color: #991b1b; }
.pill-blue   { background: #dbeafe; color: #1e40af; }
.pill-orange { background: #ffedd5; color: #9a3412; }
.pill-gray   { background: #f1f5f9; color: #475569; }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; transition: var(--transition);
  white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--steel); color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,0.25); }
.btn-primary:hover { background: var(--steel-dark); }
.btn-outline { background: #fff; color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--steel); color: var(--steel); }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-wa { background: var(--green-wa); color: #fff; }
.btn-wa:hover { background: var(--green-wa-dk); }

/* ── FORMS ─────────────────────────────────── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; padding: 24px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  outline: none; transition: var(--transition); resize: vertical;
  background: #fafbfc;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
  background: #fff;
}
.form-actions {
  display: flex; gap: 10px; padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.form-feedback { padding: 0 24px 16px; font-size: 14px; font-weight: 600; }
.form-feedback.success { color: var(--green); }
.form-feedback.error   { color: var(--red); }

/* ── UPLOAD ZONE ─────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: var(--transition); color: var(--text-muted);
}
.upload-zone:hover { border-color: var(--steel); background: rgba(37,99,235,0.02); }
.upload-zone.drag-over { border-color: var(--steel); background: rgba(37,99,235,0.05); }
.upload-zone p { margin-top: 8px; font-size: 14px; }
.image-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.preview-item { position: relative; }
.preview-item img {
  width: 82px; height: 72px; object-fit: cover;
  border-radius: 8px; border: 2px solid var(--border); display: block;
}
.preview-remove {
  position: absolute; top: -6px; right: -6px;
  background: var(--red); color: #fff; border: none;
  width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.preview-remove:hover { transform: scale(1.15); }

/* ── SPECS BUILDER ───────────────────────────── */
.spec-row-input { display: flex; gap: 8px; margin-bottom: 8px; }
.spec-row-input input { flex: 1; }

/* ── INQUIRIES ─────────────────────────────── */
.inquiry-card {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto;
  gap: 16px; align-items: start;
  transition: background .15s;
}
.inquiry-card:last-child { border-bottom: none; }
.inquiry-card:hover { background: var(--bg); }
.inq-name    { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.inq-product { color: var(--steel); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.inq-msg     { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.inq-meta    { font-size: 12px; color: var(--text-muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.inq-meta .copy-phone {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: 2px 8px; font-size: 11px; cursor: pointer;
  color: var(--text-muted); transition: var(--transition); font-family: inherit;
}
.inq-meta .copy-phone:hover { border-color: var(--steel); color: var(--steel); }
.inq-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ── MODAL ─────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-sm {
  background: #fff; border-radius: 14px; padding: 30px;
  max-width: 420px; width: 92%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.modal-sm h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.modal-sm p  { color: var(--text-muted); font-size: 14px; }

/* ── EMPTY / LOADING ─────────────────────────── */
.empty-row td { text-align: center; padding: 48px; color: var(--text-muted); font-size: 14px; }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border);
  border-top-color: var(--steel); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST SYSTEM ────────────────────────────── */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  min-width: 280px; max-width: 380px;
  background: #fff; border-left: 4px solid var(--steel);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  pointer-events: auto;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1);
}
.toast.hiding { animation: toastOut .25s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast-icon    { font-size: 18px; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title   { font-weight: 700; font-size: 13.5px; color: var(--navy); margin-bottom: 2px; }
.toast-msg     { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.toast-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 1px; flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 20px; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .toolbar-search { width: 100%; }
  .inquiry-card { grid-template-columns: 1fr; }
  .inq-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .bulk-bar { flex-wrap: wrap; }
}