/* ============================================================
   SHREE BALAJI MICRONS – ADMIN PANEL CSS
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #0F4C81;
  --blue-dark: #0a3560;
  --blue-light: #1a6bb5;
  --gold: #D4AF37;
  --gold-dark: #b8941e;
  --white: #ffffff;
  --light: #F8FAFC;
  --light2: #EEF2F7;
  --gray: #6b7280;
  --dark: #1A1A2E;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --sidebar-w: 260px;
  --header-h: 64px;
}

html { font-size: 15px; }
body { font-family: 'Inter', sans-serif; background: var(--light); color: var(--dark); }
a { text-decoration: none; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  background: var(--light2);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-container { width: 100%; max-width: 440px; }
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: white; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 800; font-size: 0.9rem;
  border: none;
}
.login-title { font-family: 'Poppins', sans-serif; font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { color: var(--gray); margin-bottom: 28px; font-size: 0.9rem; }
.login-hint { background: var(--light); border-radius: 8px; padding: 12px 16px; font-size: 0.82rem; color: var(--gray); margin-top: 16px; }
.btn-login {
  width: 100%; padding: 14px; background: var(--blue); color: white;
  border: none; border-radius: 10px; font-family: 'Poppins', sans-serif;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s;
}
.btn-login:hover { background: var(--blue-dark); transform: translateY(-1px); }

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

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: #f3f4f6;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
  border-right: 1px solid var(--light2);
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--light2);
}
.sidebar-brand .logo-icon { margin-bottom: 10px; }
.sidebar-brand-name { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--dark); font-size: 0.95rem; }
.sidebar-brand-sub { font-size: 0.7rem; color: var(--gray); letter-spacing: 1px; text-transform: uppercase; }

.sidebar-menu { padding: 16px 0; }
.sidebar-section { padding: 8px 20px 4px; font-size: 0.7rem; color: var(--gray); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.sidebar-item a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
  text-decoration: none;
}
.sidebar-item a:hover, .sidebar-item a.active {
  color: var(--blue);
  background: white;
}
.sidebar-item a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
}
.sidebar-item a i { width: 18px; text-align: center; font-size: 1rem; }
.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 50px;
  font-weight: 700;
}

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Admin Header */
.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--light2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.admin-header-left { display: flex; align-items: center; gap: 16px; }
.admin-header-title { font-family: 'Poppins', sans-serif; font-size: 1.1rem; font-weight: 600; }
.admin-header-right { display: flex; align-items: center; gap: 16px; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.admin-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.9rem;
}

/* Admin Body */
.admin-body { padding: 28px; flex: 1; }

/* ── STATS CARDS ─────────────────────────────────────────── */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-widget {
  background: var(--white);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border: 1px solid var(--light2);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-widget-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-widget-icon.blue { background: rgba(15,76,129,0.1); color: var(--blue); }
.stat-widget-icon.gold { background: rgba(212,175,55,0.15); color: var(--gold-dark); }
.stat-widget-icon.green { background: rgba(22,163,74,0.1); color: var(--success); }
.stat-widget-icon.red { background: rgba(220,38,38,0.1); color: var(--danger); }
.stat-widget-num { font-family: 'Poppins', sans-serif; font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-widget-label { font-size: 0.82rem; color: var(--gray); }

/* ── CARDS ───────────────────────────────────────────────── */
.admin-card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--light2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 24px;
}
.admin-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--light2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-title { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1rem; }
.admin-card-body { padding: 24px; }

/* ── TABLES ──────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th {
  background: var(--light);
  padding: 12px 16px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--light2);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--light2);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--light); }
.admin-table img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }

/* ── FORMS ───────────────────────────────────────────────── */
.admin-form .form-group { margin-bottom: 18px; }
.admin-form label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.83rem;
  margin-bottom: 6px;
  color: var(--dark);
}
.admin-form label .required { color: var(--danger); margin-left: 3px; }
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--light2);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  transition: all 0.2s;
  outline: none;
  background: var(--white);
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15,76,129,0.1); }
.admin-form textarea { resize: vertical; min-height: 100px; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form .form-hint { font-size: 0.78rem; color: var(--gray); margin-top: 4px; }

/* Image preview */
.img-preview {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--light2);
  margin-top: 8px;
  display: block;
}

/* Toggle switch */
.toggle-switch { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--light2); border-radius: 24px; cursor: pointer; transition: 0.3s; }
.slider::before { content: ''; position: absolute; width: 18px; height: 18px; background: white; border-radius: 50%; left: 3px; top: 3px; transition: 0.3s; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn, .btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px;
  font-family: 'Poppins', sans-serif; font-weight: 600;
  font-size: 0.88rem; cursor: pointer; border: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-gold { background: var(--gold); color: var(--dark); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; border: 1.5px solid var(--light2); color: var(--dark); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-blue { background: rgba(15,76,129,0.1); color: var(--blue); }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.88rem; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--light2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray); line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--light2);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-family: 'Poppins', sans-serif; font-size: 1.4rem; font-weight: 700; }
.page-header p { color: var(--gray); font-size: 0.88rem; margin-top: 2px; }

/* Search & Filters */
.table-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-input {
  padding: 9px 14px;
  border: 1.5px solid var(--light2);
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
  min-width: 220px;
}
.search-input:focus { border-color: var(--blue); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state i { font-size: 3rem; opacity: 0.3; margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 1rem; margin-bottom: 6px; color: var(--dark); }
.empty-state p { font-size: 0.88rem; }

/* ── PRODUCT THUMBNAIL ───────────────────────────────────── */
.product-thumb {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem;
}

/* ── CATEGORY COLOR DOTS ──────────────────────────────────── */
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ── RECENT INQUIRIES ─────────────────────────────────────── */
.inquiry-row td:first-child { font-weight: 600; }
.unread-dot { width: 8px; height: 8px; background: var(--blue); border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-form .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4, .grid-1-2, .grid-2-1, .grid-1-1-5 { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* ── RESPONSIVE GRIDS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: start; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.grid-1-1-5 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--light2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }
