/* ==========================================================================
   SRI ILAKKIYA (ஸ்ரீ இலக்கியா) — ADMIN PANEL STYLESHEET
   Mobile-friendly, high-contrast, traditional showroom palette
   ========================================================================== */

:root {
  --g: #00843D;
  --g-hover: #006830;
  --y: #FFD200;
  --y-hover: #F5B800;
  --m: #C8102E;
  --m-hover: #A61021;
  --c: #F4F9F5;
  --b: #0E2917;
  --w: #FFFFFF;
  --border: #CFE4D7;
  --border-subtle: #E2EFE7;
  --mu: #476352;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 18px rgba(0, 132, 61, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 132, 61, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--c);
  color: var(--b);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
}

/* ================= 1. LOGIN SCREEN ================= */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, #0B3E20 0%, #041A0D 100%);
  color: #FFFFFF;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 197, 66, 0.4);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-badge {
  width: 58px;
  height: 58px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--y), #D8A525);
  color: var(--b);
  border: 2px solid var(--m);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Mukta Malar', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  box-shadow: 0 4px 16px rgba(245, 197, 66, 0.4);
}

.login-title {
  font-size: 1.4rem;
  color: var(--y);
  font-weight: 800;
  margin-bottom: 0.25rem;
  font-family: 'Mukta Malar', var(--font-sans);
}

.login-subtitle {
  font-size: 0.85rem;
  color: #E7DFD0;
  margin-bottom: 1.5rem;
}

.login-form .input-group {
  text-align: left;
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #E7DFD0;
  margin-bottom: 0.4rem;
}

.login-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(245, 197, 66, 0.35);
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-size: 1rem;
}

.login-form input:focus {
  outline: none;
  border-color: var(--y);
  background: rgba(255, 255, 255, 0.18);
}

.btn-login {
  width: 100%;
  padding: 0.9rem;
  background: var(--y);
  color: var(--b);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(245, 197, 66, 0.35);
}

.btn-login:hover {
  background: var(--y-hover);
  transform: translateY(-2px);
}

.hint-text {
  font-size: 0.8rem;
  color: #C0B5A7;
  margin-top: 1rem;
}

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: #E7DFD0;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--y);
}

/* ================= 2. TOPBAR HEADER ================= */
.admin-topbar {
  background: var(--g);
  color: #FFFFFF;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--y);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-circle {
  width: 44px;
  height: 44px;
  background: var(--y);
  color: var(--b);
  border: 2px solid var(--m);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  font-family: 'Mukta Malar', sans-serif;
}

.brand-title-box h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--y);
  line-height: 1.1;
  font-family: 'Mukta Malar', var(--font-sans);
}

.brand-title-box span {
  font-size: 0.72rem;
  color: #FFFFFF;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-view-site {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--y);
  color: var(--b);
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-view-site:hover {
  background: var(--y-hover);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--m);
  border-color: var(--m);
}

/* ================= 3. NAVIGATION TABS ================= */
.admin-nav-tabs {
  background: #FFFFFF;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 68px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.nav-tabs-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem;
  border: none;
  background: none;
  color: var(--mu);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--g);
}

.tab-btn.active {
  color: var(--g);
  border-bottom-color: var(--g);
  font-weight: 700;
}

/* ================= 4. MAIN CONTENT LAYOUT ================= */
.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.pane-tag {
  display: inline-block;
  background: var(--m);
  color: var(--y);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.pane-title {
  font-size: 1.6rem;
  font-family: var(--font-serif);
  color: var(--b);
}

.pane-desc {
  font-size: 0.88rem;
  color: var(--mu);
  max-width: 75ch;
  margin-top: 0.25rem;
}

.live-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #E8F5E9;
  color: #1B5E20;
  border: 1px solid #A5D6A7;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.live-sync-indicator .dot {
  width: 8px;
  height: 8px;
  background: #2E7D32;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* ================= 5. STATS OVERVIEW STRIP ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-title {
  font-size: 0.78rem;
  color: var(--mu);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--b);
  margin: 0.2rem 0;
}

.stat-trend {
  font-size: 0.75rem;
  color: var(--mu);
  font-weight: 500;
}

.text-green { color: #006B2D !important; }
.text-gold { color: #C5A059 !important; }

/* ================= 6. PRICING TOOLBAR ================= */
.pricing-toolbar {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow);
}

.search-wrap input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--g);
}

.dept-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--c);
  color: var(--b);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--g);
}

.filter-pill.active {
  background: var(--g);
  color: #FFFFFF;
  border-color: var(--g);
}

.action-buttons-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-action {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-sample-fill {
  background: var(--y);
  color: var(--b);
}
.btn-sample-fill:hover { background: var(--y-hover); }

.btn-save-all {
  background: var(--g);
  color: #FFFFFF;
}
.btn-save-all:hover { background: var(--g-hover); }

.btn-reset {
  background: #FFF;
  color: var(--m);
  border: 1.5px solid var(--border);
}
.btn-reset:hover { border-color: var(--m); }

/* ================= 7. PRICING TABLE ================= */
.table-container {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.pricing-table thead {
  background: #F9F6F0;
  border-bottom: 2px solid var(--border);
}

.pricing-table th {
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--b);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pricing-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.pricing-table tbody tr:hover {
  background: #FDFAF5;
}

.pricing-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.prod-thumb-mini {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #F4F0E6;
  display: block;
}

.prod-info-cell h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--b);
  line-height: 1.25;
}

.prod-info-cell span {
  font-size: 0.75rem;
  color: var(--mu);
}

.dept-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
}

.price-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.price-input-group .currency {
  position: absolute;
  left: 10px;
  color: var(--mu);
  font-weight: 700;
  font-size: 0.88rem;
  pointer-events: none;
}

.price-input-group input {
  width: 100%;
  padding: 0.55rem 0.6rem 0.55rem 1.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--b);
  background: #FFFFFF;
}

.price-input-group input:focus {
  outline: none;
  border-color: var(--g);
  box-shadow: 0 0 0 2px rgba(0, 107, 45, 0.15);
}

.btn-row-save {
  padding: 0.45rem 0.8rem;
  background: var(--g);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-row-save:hover {
  background: var(--g-hover);
}

.btn-row-save.saved {
  background: #2E7D32;
}

/* ================= 8. ADD PRODUCT FORM & CAMERA UPLOAD ================= */
.product-form-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .product-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.form-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--b);
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

.form-subtext {
  font-size: 0.82rem;
  color: var(--mu);
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--b);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--b);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--g);
}

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

@media (max-width: 500px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.form-group-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-group-checkbox label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--b);
  cursor: pointer;
}

/* Dual Camera & File Upload */
.upload-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

@media (max-width: 500px) {
  .upload-actions-grid { grid-template-columns: 1fr; }
}

.btn-camera {
  background: #E8F5E9;
  border: 2px dashed #2E7D32;
  color: #1B5E20;
  padding: 1rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-camera:hover {
  background: #C8E6C9;
  transform: translateY(-2px);
}

.btn-camera .icon {
  font-size: 2rem;
}

.btn-camera strong {
  font-size: 0.9rem;
  display: block;
}

.btn-camera small {
  font-size: 0.72rem;
  opacity: 0.85;
}

.btn-file-upload {
  background: #EBF3FC;
  border: 2px dashed #1E88E5;
  color: #0D47A1;
  padding: 1rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-file-upload:hover {
  background: #BBDEFB;
  transform: translateY(-2px);
}

.btn-file-upload .icon {
  font-size: 2rem;
}

.btn-file-upload strong {
  font-size: 0.9rem;
  display: block;
}

.btn-file-upload small {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Preset selector */
.preset-selector-box {
  margin-bottom: 1rem;
}

.preset-selector-box label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mu);
  display: block;
  margin-bottom: 0.4rem;
}

.preset-thumbnails {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--b);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--g);
  background: var(--c);
}

/* Image preview wrapper */
.image-preview-wrapper {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #FAF7F0;
  overflow: hidden;
  margin-bottom: 1.25rem;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.empty-preview {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--mu);
  font-size: 0.85rem;
}

.active-preview {
  width: 100%;
  position: relative;
}

.active-preview img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-badge {
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 107, 45, 0.9);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-remove-photo {
  background: #D32F2F;
  color: #FFFFFF;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit-product {
  width: 100%;
  padding: 0.95rem;
  background: var(--g);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 107, 45, 0.3);
}

.btn-submit-product:hover {
  background: var(--g-hover);
  transform: translateY(-2px);
}

/* ================= 9. CUSTOM PRODUCTS GRID ================= */
.custom-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.custom-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.custom-card-img {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
  background: #FAF7F0;
}

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

.custom-card-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--b);
}

.custom-card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--m);
  margin-top: auto;
  padding-top: 0.5rem;
}

.custom-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-delete-prod {
  flex: 1;
  padding: 0.5rem;
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-delete-prod:hover {
  background: #FFCDD2;
}

/* ================= 10. OFFERS TAB STYLES ================= */
.content-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.offers-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.offer-item-row {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-left: 6px solid var(--m);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

/* ================= 11. TOAST NOTIFICATION ================= */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  background: var(--b);
  color: var(--y);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--y);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-toast.show {
  transform: translateY(0);
}
