/* ============================================================
   SP Tech — Admin Panel Styles
   ============================================================ */
:root {
  --red: #dc2626; --red-dark: #b91c1c; --orange: #f97316;
  --gray-50:#f9fafb; --gray-100:#f3f4f6; --gray-200:#e5e7eb;
  --gray-300:#d1d5db; --gray-500:#6b7280; --gray-700:#374151; --gray-900:#111827;
  --green:#16a34a; --amber:#f59e0b; --blue:#2563eb; --purple:#9333ea;
  --pink-bkash:#e2136e; --orange-nagad:#f47216;
  --radius:8px; --radius-lg:12px;
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background:var(--gray-100); color:var(--gray-900); }
a { color:inherit; text-decoration:none; }
button { cursor:pointer; font-family:inherit; border:none; background:none; }
input,select,textarea { font-family:inherit; font-size:14px; }
img { max-width:100%; display:block; }
table { width:100%; border-collapse:collapse; }

/* ---- Layout ---- */
.admin-layout { display:flex; min-height:100vh; }
.sidebar { width:240px; background:#fff; border-right:1px solid var(--gray-200); display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:40; }
.sidebar-header { padding:20px 16px; border-bottom:1px solid var(--gray-200); display:flex; align-items:center; gap:8px; }
.sidebar-header img { width:36px; height:36px; object-fit:contain; }
.sidebar-header .name { font-weight:800; font-size:16px; }
.sidebar-header .name .red { color:var(--red); }
.sidebar-header .sub { font-size:10px; color:var(--gray-500); }
.sidebar-nav { flex:1; padding:12px 8px; overflow-y:auto; }
.nav-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--radius); font-size:14px; font-weight:500; color:var(--gray-700); margin-bottom:2px; width:100%; text-align:left; }
.nav-item:hover { background:var(--gray-50); color:var(--gray-900); }
.nav-item.active { background:linear-gradient(to right,var(--red),var(--orange)); color:#fff; }
.nav-item .badge { margin-left:auto; background:var(--red); color:#fff; font-size:10px; font-weight:700; border-radius:999px; padding:1px 6px; }
.nav-item.active .badge { background:rgba(255,255,255,0.3); }
.sidebar-footer { padding:12px 8px; border-top:1px solid var(--gray-200); }
.main-area { flex:1; margin-left:240px; display:flex; flex-direction:column; min-width:0; }
.topbar { height:56px; background:#fff; border-bottom:1px solid var(--gray-200); display:flex; align-items:center; justify-content:space-between; padding:0 24px; position:sticky; top:0; z-index:30; }
.topbar-title { font-size:18px; font-weight:700; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.user-chip { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; padding:6px 12px; background:var(--gray-100); border-radius:999px; }
.user-avatar { width:28px; height:28px; border-radius:999px; background:linear-gradient(to right,var(--red),var(--orange)); color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
.menu-toggle { display:none; }
.content { padding:24px; overflow-x:hidden; flex:1; }

@media(max-width:1023px){
  .sidebar { transform:translateX(-100%); transition:transform 0.3s; }
  .sidebar.open { transform:translateX(0); }
  .main-area { margin-left:0; }
  .menu-toggle { display:flex; align-items:center; justify-content:center; width:44px; height:44px; font-size:20px; }
}

/* ---- Login ---- */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--red),var(--orange)); padding:16px; }
.login-card { background:#fff; border-radius:var(--radius-lg); box-shadow:0 25px 50px rgba(0,0,0,0.25); max-width:400px; width:100%; padding:32px; }
.login-logo { text-align:center; margin-bottom:24px; }
.login-logo img { width:64px; height:64px; margin:0 auto; }
.login-logo .name { font-size:24px; font-weight:800; margin-top:8px; }
.login-logo .name .red { color:var(--red); }
.login-logo .sub { font-size:12px; color:var(--gray-500); }
.login-form { display:flex; flex-direction:column; gap:16px; }
.login-form label { font-size:14px; font-weight:500; }
.login-form input { height:44px; padding:0 12px; border:1px solid var(--gray-300); border-radius:var(--radius); outline:none; }
.login-form input:focus { border-color:var(--red); }
.btn-login { background:linear-gradient(to right,var(--red),var(--orange)); color:#fff; font-weight:700; height:44px; border-radius:var(--radius); font-size:16px; }
.login-hint { text-align:center; font-size:12px; color:var(--gray-500); margin-top:16px; }
.login-back { display:block; text-align:center; margin-top:12px; color:var(--gray-500); font-size:14px; }

/* ---- Stat Cards ---- */
.stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-bottom:24px; }
@media(min-width:768px){ .stat-grid { grid-template-columns:repeat(3,1fr); } }
@media(min-width:1024px){ .stat-grid { grid-template-columns:repeat(6,1fr); } }
.stat-card { background:#fff; border-radius:var(--radius-lg); border:1px solid var(--gray-200); padding:20px; box-shadow:0 1px 3px rgba(0,0,0,0.05); }
.stat-card .icon { width:40px; height:40px; border-radius:var(--radius); display:flex; align-items:center; justify-content:center; font-size:18px; color:#fff; margin-bottom:12px; }
.stat-card .icon.red { background:var(--red); }
.stat-card .icon.blue { background:var(--blue); }
.stat-card .icon.green { background:var(--green); }
.stat-card .icon.amber { background:var(--amber); }
.stat-card .icon.purple { background:var(--purple); }
.stat-card .icon.orange { background:var(--orange); }
.stat-card .label { font-size:12px; color:var(--gray-500); text-transform:uppercase; letter-spacing:0.05em; }
.stat-card .value { font-size:24px; font-weight:800; margin-top:4px; }

/* ---- Cards ---- */
.card { background:#fff; border-radius:var(--radius-lg); border:1px solid var(--gray-200); box-shadow:0 1px 3px rgba(0,0,0,0.05); }
.card-pad { padding:20px; }
.grid-2 { display:grid; grid-template-columns:1fr; gap:16px; }
@media(min-width:1024px){ .grid-2 { grid-template-columns:1fr 1fr; } }

/* ---- Table ---- */
.table-wrap { overflow-x:auto; }
.table { width:100%; }
.table th { text-align:left; padding:10px 12px; font-size:12px; font-weight:600; color:var(--gray-500); text-transform:uppercase; letter-spacing:0.05em; border-bottom:1px solid var(--gray-200); background:var(--gray-50); white-space:nowrap; }
.table td { padding:10px 12px; border-bottom:1px solid var(--gray-100); font-size:14px; vertical-align:middle; }
.table tr:hover td { background:var(--gray-50); }

/* ---- Buttons ---- */
.btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:var(--radius); font-size:14px; font-weight:500; transition:all 0.2s; }
.btn-primary { background:linear-gradient(to right,var(--red),var(--orange)); color:#fff; }
.btn-primary:hover { opacity:0.9; }
.btn-outline { border:1px solid var(--gray-300); color:var(--gray-700); }
.btn-outline:hover { background:var(--gray-50); }
.btn-icon { width:32px; height:32px; padding:0; display:flex; align-items:center; justify-content:center; border-radius:var(--radius); }
.btn-icon:hover { background:var(--gray-100); }
.btn-sm { padding:4px 10px; font-size:12px; }

/* ---- Badge ---- */
.badge { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; }
.badge-red { background:#fee2e2; color:#991b1b; }
.badge-green { background:#dcfce7; color:#166534; }
.badge-amber { background:#fef3c7; color:#92400e; }
.badge-blue { background:#dbeafe; color:#1e40af; }
.badge-purple { background:#f3e8ff; color:#6b21a8; }
.badge-gray { background:#f3f4f6; color:#374151; }
.badge-bkash { background:#fce7f3; color:#9d174d; }
.badge-nagad { background:#ffedd5; color:#9a3412; }

/* ---- Forms ---- */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:14px; font-weight:500; margin-bottom:6px; }
.form-group input, .form-group select, .form-group textarea {
  width:100%; height:40px; padding:0 12px; border:1px solid var(--gray-300); border-radius:var(--radius); outline:none;
}
.form-group textarea { height:auto; padding:8px 12px; min-height:80px; resize:vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color:var(--red); box-shadow:0 0 0 2px rgba(220,38,38,0.15); }
.form-grid2 { display:grid; grid-template-columns:1fr; gap:16px; }
@media(min-width:640px){ .form-grid2 { grid-template-columns:1fr 1fr; } }

/* ---- Toolbar ---- */
.toolbar { display:flex; gap:12px; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; }
.toolbar-left { display:flex; gap:12px; align-items:center; flex:1; min-width:200px; }
.search-box { position:relative; flex:1; max-width:400px; }
.search-box input { width:100%; height:40px; padding:0 12px 0 36px; border:1px solid var(--gray-300); border-radius:var(--radius); }
.search-box .icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--gray-400); }
.filter-select { height:40px; padding:0 12px; border:1px solid var(--gray-300); border-radius:var(--radius); background:#fff; min-width:160px; }

/* ---- Filter pills ---- */
.filter-pills { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.filter-pill { padding:8px 14px; border-radius:999px; font-size:13px; font-weight:500; border:1px solid var(--gray-300); color:var(--gray-700); }
.filter-pill.active { background:linear-gradient(to right,var(--red),var(--orange)); color:#fff; border-color:transparent; }

/* ---- Dialog ---- */
.dialog-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:50; display:flex; align-items:center; justify-content:center; padding:16px; }
.dialog { background:#fff; border-radius:var(--radius-lg); max-width:600px; width:100%; max-height:90vh; overflow-y:auto; box-shadow:0 25px 50px rgba(0,0,0,0.25); }
.dialog-header { padding:20px; border-bottom:1px solid var(--gray-200); display:flex; justify-content:space-between; align-items:center; }
.dialog-title { font-size:18px; font-weight:700; }
.dialog-close { font-size:24px; color:var(--gray-400); cursor:pointer; }
.dialog-body { padding:20px; }
.dialog-footer { padding:16px 20px; border-top:1px solid var(--gray-200); display:flex; justify-content:flex-end; gap:8px; }

/* ---- Image upload ---- */
.upload-field { border:2px dashed var(--gray-300); border-radius:var(--radius); padding:12px; cursor:pointer; display:flex; align-items:center; gap:12px; transition:border-color 0.2s; }
.upload-field:hover { border-color:var(--red); }
.upload-field.drag { border-color:var(--red); background:#fef2f2; }
.upload-preview { width:64px; height:64px; border-radius:var(--radius); background:var(--gray-50); border:1px solid var(--gray-100); overflow:hidden; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.upload-preview img { width:100%; height:100%; object-fit:contain; padding:4px; }

/* ---- Spec rows ---- */
.spec-row { display:flex; gap:8px; margin-bottom:8px; }
.spec-row input { flex:1; height:40px; padding:0 12px; border:1px solid var(--gray-300); border-radius:var(--radius); }

/* ---- Toast ---- */
.toast { position:fixed; bottom:20px; right:20px; z-index:100; background:#fff; border-radius:var(--radius); box-shadow:0 10px 25px rgba(0,0,0,0.15); padding:12px 20px; font-size:14px; border-left:4px solid var(--green); max-width:400px; }
.toast.error { border-left-color:var(--red); }

/* ---- Skeleton ---- */
.skeleton { background:var(--gray-200); border-radius:var(--radius); animation:pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5; } }

/* ---- Switch ---- */
.switch { position:relative; display:inline-block; width:40px; height:22px; }
.switch input { opacity:0; width:0; height:0; }
.switch-slider { position:absolute; cursor:pointer; inset:0; background:var(--gray-300); border-radius:999px; transition:0.3s; }
.switch-slider::before { content:""; position:absolute; height:16px; width:16px; left:3px; top:3px; background:#fff; border-radius:999px; transition:0.3s; }
.switch input:checked + .switch-slider { background:var(--green); }
.switch input:checked + .switch-slider::before { transform:translateX(18px); }

/* ---- Payment info box (admin orders) ---- */
.payment-info-box { border:2px dashed var(--gray-200); border-radius:var(--radius); padding:12px; margin-top:8px; }
.payment-info-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; font-size:13px; }
.payment-info-row .label { color:var(--gray-500); }
.payment-info-row .val { font-family:monospace; font-weight:600; }
.copy-btn { font-size:11px; color:var(--gray-400); cursor:pointer; padding:2px 6px; border-radius:4px; }
.copy-btn:hover { background:var(--gray-100); color:var(--gray-700); }
.mark-paid-row { display:flex; gap:6px; margin-top:12px; }
.mark-paid-btn { flex:1; padding:8px; border-radius:var(--radius); font-size:12px; font-weight:600; border:1px solid var(--gray-300); }
.mark-paid-btn.active.unpaid { background:var(--gray-100); border-color:var(--gray-500); }
.mark-paid-btn.active.pending { background:#fef3c7; border-color:var(--amber); color:#92400e; }
.mark-paid-btn.active.paid { background:#dcfce7; border-color:var(--green); color:#166534; }
