/* ==========================================================================
   Nature Square Admin Backend & CMS Stylesheet
   Clean, modern, high-contrast administrative dashboard
   ========================================================================== */

:root {
  --admin-bg: #f4f6f8;
  --admin-sidebar: #0b1f1c;
  --admin-sidebar-hover: #153833;
  --admin-sidebar-text: #b9cfc9;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --primary: #0e2925;
  --primary-light: #184740;
  --accent-gold: #d4af37;
  --accent-gold-light: #fef9e7;
  --accent-teal: #14b8a6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  height: 38px;
  width: auto;
}

.sidebar-brand-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius);
  color: var(--admin-sidebar-text);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--admin-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--primary-light);
  color: #ffffff;
  font-weight: 600;
  border-left: 4px solid var(--accent-gold);
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-gold);
  color: #0b1f1c;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.store-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.store-preview-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: #ffffff;
  height: 64px;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-body {
  padding: 32px;
  flex: 1;
}

/* Cards & Panels */
.admin-card {
  background: var(--admin-card);
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-top: 2px;
}

/* Metrics Overview Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--admin-text-main);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

/* Data Tables */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 12px 16px;
  background: #f8fafc;
  color: var(--admin-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.table-product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.table-product-title {
  font-weight: 600;
  color: var(--admin-text-main);
  line-height: 1.3;
}

.table-product-sub {
  font-size: 0.76rem;
  color: var(--admin-text-muted);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 14px;
  font-size: 0.74rem;
  font-weight: 600;
}

.badge-cart {
  background: #dbeafe;
  color: #1e40af;
}

.badge-contact {
  background: #d1fae5;
  color: #065f46;
}

.badge-instock {
  background: #ecfdf5;
  color: #047857;
}

.badge-outstock {
  background: #fef2f2;
  color: #b91c1c;
}

/* Buttons */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.admin-btn-primary:hover {
  background: var(--primary-light);
}

.admin-btn-gold {
  background: var(--accent-gold);
  color: #0c1c19;
}

.admin-btn-gold:hover {
  background: #c5a02e;
}

.admin-btn-outline {
  background: #ffffff;
  border-color: var(--admin-border);
  color: var(--admin-text-main);
}

.admin-btn-outline:hover {
  background: #f8fafc;
}

.admin-btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

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

.admin-btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

/* Form Controls */
.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 41, 37, 0.12);
}

.admin-form-group {
  margin-bottom: 18px;
}

.admin-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-text-main);
  margin-bottom: 6px;
}

.admin-form-help {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

/* Modal */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.admin-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-box {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.admin-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-body {
  padding: 24px;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Sub-tabs */
.admin-subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.subtab-btn {
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.subtab-btn:hover {
  color: var(--admin-text-main);
}

.subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent-gold);
}

/* Radio Cards (Add to Cart vs Contact Us) */
.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.radio-card {
  border: 2px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.radio-card:hover {
  border-color: #cbd5e1;
}

.radio-card.selected {
  border-color: var(--primary);
  background: #f0f7f5;
}

.radio-card input[type="radio"] {
  margin-top: 3px;
}

/* Image preview box */
.image-preview-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.preview-thumb-box {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--admin-border);
}

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

.preview-thumb-box button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
