/* ===================================================================
   MudraLanka - Admin Dashboard (Light SaaS Theme)
   Design Reference: RK Sketch Wood Clean Light Management Interface
   Clean white cards, subtle borders, professional SaaS typography & layout
   =================================================================== */

:root {
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-card-border: #e2e8f0;
  --admin-card-hover: #f1f5f9;

  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-text-subtle: #94a3b8;

  --admin-primary: #4f46e5;       /* Indigo 600 */
  --admin-primary-hover: #4338ca;
  --admin-primary-light: #eef2ff;

  --admin-success: #10b981;
  --admin-success-light: #d1fae5;
  --admin-success-text: #065f46;

  --admin-warning: #f59e0b;
  --admin-warning-light: #fef3c7;
  --admin-warning-text: #92400e;

  --admin-danger: #ef4444;
  --admin-danger-light: #fee2e2;
  --admin-danger-text: #991b1b;

  --admin-blue: #2563eb;
  --admin-blue-light: #dbeafe;
  --admin-blue-text: #1e40af;

  --admin-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --admin-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --admin-radius: 8px;
}

body.admin-body {
  background-color: var(--admin-bg) !important;
  color: var(--admin-text-main) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
}

/* ===================================================================
   Top Navigation Bar (RK Sketch Wood Style)
   =================================================================== */
.admin-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--admin-shadow-sm);
}

.admin-nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 1.5rem;
}

.admin-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-brand-icon {
  width: 2.4rem;
  height: 2.4rem;
  background: var(--admin-primary);
  color: white;
  border-radius: var(--admin-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.admin-brand-text {
  line-height: 1.2;
}

.admin-brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--admin-text-main);
  letter-spacing: -0.3px;
}

.admin-brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--admin-text-muted);
}

/* Admin Tabs Row (Horizontal Style) */
.admin-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 1.25rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.admin-tab-btn:hover {
  color: var(--admin-text-main);
  border-color: #cbd5e1;
}

.admin-tab-btn.active {
  color: var(--admin-primary);
  border-bottom-color: var(--admin-primary);
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.store-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--admin-success-light);
  color: var(--admin-success-text);
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-success);
}

/* ===================================================================
   Main Content Layout
   =================================================================== */
.admin-main-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
  flex: 1;
}

.admin-page-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-text-main);
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.admin-page-header p {
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}

/* Tab Panes */
.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
}

/* ===================================================================
   Stats Grid Cards (RK Sketch Wood Metric Style)
   =================================================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card-light {
  background: #ffffff;
  border: 1px solid var(--admin-card-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  box-shadow: var(--admin-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card-light:hover {
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow-md);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-text-muted);
}

.stat-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--admin-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-val {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--admin-text-main);
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.stat-trend {
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===================================================================
   White Cards & Containers
   =================================================================== */
.admin-card-light {
  background: #ffffff;
  border: 1px solid var(--admin-card-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-sm);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.admin-card-header-light {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--admin-card-border);
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-card-header-light h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.admin-card-header-light p {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-top: 0.15rem;
}

/* ===================================================================
   Tables (Clean White & Gray Headers)
   =================================================================== */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--admin-card-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
}

.admin-table-light {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.admin-table-light th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--admin-card-border);
}

.admin-table-light td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--admin-text-main);
  vertical-align: middle;
}

.admin-table-light tr:last-child td {
  border-bottom: none;
}

.admin-table-light tr:hover td {
  background-color: #f8fafc;
}

/* Status Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.pill-green { background: #dcfce7; color: #15803d; }
.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-purple { background: #f3e8ff; color: #7e22ce; }
.pill-gray { background: #f1f5f9; color: #475569; }

/* ===================================================================
   Media & Banner Manager Cards
   =================================================================== */
.admin-banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.banner-card-light {
  background: #ffffff;
  border: 1px solid var(--admin-card-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  box-shadow: var(--admin-shadow-sm);
  display: flex;
  flex-direction: column;
}

.banner-img-preview-box {
  height: 190px;
  background: #f1f5f9;
  position: relative;
  border-bottom: 1px solid var(--admin-card-border);
}

.banner-img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ===================================================================
   Form Controls (Clean Light Styling)
   =================================================================== */
.admin-form-group {
  margin-bottom: 1.15rem;
}

.admin-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.4rem;
}

.admin-input-light,
.admin-select-light,
.admin-textarea-light {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--admin-radius);
  font-size: 0.9rem;
  color: var(--admin-text-main);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-input-light:focus,
.admin-select-light:focus,
.admin-textarea-light:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Disable spin buttons on number inputs so only direct typing is allowed */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .admin-row {
    grid-template-columns: 1fr;
  }
}

/* Action Buttons */
.btn-admin-primary {
  background: var(--admin-primary);
  color: #ffffff;
  border: 1px solid transparent;
  padding: 0.55rem 1.15rem;
  border-radius: var(--admin-radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: var(--admin-shadow-sm);
  transition: all 0.15s ease;
}

.btn-admin-primary:hover {
  background: var(--admin-primary-hover);
  box-shadow: var(--admin-shadow-md);
}

.btn-admin-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.55rem 1rem;
  border-radius: var(--admin-radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.btn-admin-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-admin-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 0.4rem 0.75rem;
  border-radius: var(--admin-radius);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-admin-danger:hover {
  background: #fecaca;
}

/* ===================================================================
   Admin Login Screen (Crisp White Container)
   =================================================================== */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: #f1f5f9;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  padding: 2.75rem 2.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.login-brand-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--admin-primary-light);
  color: var(--admin-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.25rem;
}

/* ===================================================================
   Hierarchical Category -> Group -> Items Styles
   =================================================================== */
.hierarchy-group-card {
  background: #ffffff;
  border: 1px solid var(--admin-card-border);
  border-radius: 10px;
  box-shadow: var(--admin-shadow-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.hierarchy-group-header {
  background: #f8fafc;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--admin-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hierarchy-group-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hierarchy-cat-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  background: #e0e7ff;
  color: #3730a3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hierarchy-group-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hierarchy-items-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
}

.hierarchy-group-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
  width: 100%;
}

/* Admin Modals */
.admin-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1500;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  animation: adminModalFadeIn 0.18s ease-out;
  margin: auto;
}

.admin-modal-scroll-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.admin-modal-scroll-body::-webkit-scrollbar {
  width: 6px;
}
.admin-modal-scroll-body::-webkit-scrollbar-track {
  background: transparent;
}
.admin-modal-scroll-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.admin-modal-scroll-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@keyframes adminModalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.admin-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.admin-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ===================================================================
   Hand-Scroll & Sticky Column Styling
   =================================================================== */
.hand-scroll-wrap {
  cursor: grab !important;
  cursor: -webkit-grab !important;
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.hand-scroll-wrap:active,
.hand-scroll-wrap.is-dragging {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
}

.hand-scroll-wrap::-webkit-scrollbar {
  height: 9px;
  width: 9px;
}

.hand-scroll-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}

.hand-scroll-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

.hand-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.sticky-size-col {
  position: sticky !important;
  left: 0 !important;
  background: #ffffff;
  z-index: 2;
  box-shadow: 2px 0 6px -1px rgba(0, 0, 0, 0.08);
}

/* ===================================================================
   Full-Screen Product Modal (Enterprise ERP Layout)
   =================================================================== */
.product-fullscreen-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #f8fafc;
  z-index: 2500;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.product-fullscreen-modal.active {
  display: flex !important;
}

.product-fs-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  z-index: 10;
}

.product-fs-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.product-fs-back-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.product-fs-back-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.product-fs-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.product-fs-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.product-fs-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.product-fs-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 4rem;
  box-sizing: border-box;
}

.product-fs-container {
  max-width: 1560px;
  margin: 0 auto;
}

.product-fs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(360px, 1.15fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .product-fs-grid {
    grid-template-columns: 1fr;
  }
  .product-fs-body {
    padding: 1rem;
  }
  .product-fs-header {
    padding: 0 1rem;
  }
}

.product-fs-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.product-fs-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}

.sheet-tier-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.sheet-tier-card:hover {
  border-color: #818cf8 !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08) !important;
  transform: translateY(-1px);
}



