/* ═══════════════════════════════════════════════════════════════════
   FOC App — Admin Panel Stylesheet
   Path: static/css/admin.css
   NOTE: base.css and foc-app.css already loaded via base.html.
         Zero hardcoded colors — all CSS variables.
═══════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   SHARED ADMIN PAGE HEADER
════════════════════════════════════════════════════════════════════ */
.adm-header {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
  flex-wrap      : wrap;
  gap            : 10px;
  margin-bottom  : 1.1rem;
}
.adm-title {
  font-size     : 1rem;
  font-weight   : 700;
  color         : var(--text-primary);
  margin        : 0;
}
.adm-subtitle {
  font-size  : 0.78rem;
  color      : var(--text-secondary);
  margin-top : 2px;
}
.adm-back-btn {
  font-size    : 0.8rem;
  border-radius: 8px;
  padding      : 0.38rem 0.9rem;
  white-space  : nowrap;
}

/* ════════════════════════════════════════════════════════════════════
   ADMIN CARD WRAPPER
════════════════════════════════════════════════════════════════════ */
.adm-card {
  background   : var(--bg-secondary);
  border       : 1px solid var(--border-color);
  border-radius: 12px;
  padding      : 16px;
  box-shadow   : 0 4px 14px var(--shadow-color);
}
.adm-card + .adm-card { margin-top: 1rem; }

/* ════════════════════════════════════════════════════════════════════
   ADMIN TABLE
════════════════════════════════════════════════════════════════════ */
.adm-table-wrap {
  border-radius: 10px;
  overflow     : hidden;
  border       : 1px solid var(--border-color);
}
.adm-table {
  margin-bottom: 0;
  font-size    : 0.81rem;
  width        : 100%;
  border-color : var(--table-border);
}
.adm-table thead th {
  background    : var(--table-head-bg)   !important;
  color         : var(--table-head-text) !important;
  border-color  : var(--table-border)    !important;
  font-size     : 0.74rem;
  font-weight   : 700;
  white-space   : nowrap;
  padding       : 8px 10px;
  letter-spacing: 0.3px;
}
.adm-table tbody td {
  background     : var(--table-bg);
  color          : var(--text-primary) !important;
  border-color   : var(--table-border);
  vertical-align : middle;
  padding        : 7px 10px;
  font-size      : 0.8rem;
}
.adm-table tbody tr:hover td { background: var(--bg-hover) !important; }
.adm-table .adm-empty-row td {
  text-align : center;
  color      : var(--text-muted);
  font-style : italic;
  padding    : 20px;
}
.adm-table code {
  font-size    : 0.72rem;
  padding      : 1px 6px;
  border-radius: 4px;
  background   : var(--code-bg);
  color        : var(--text-primary);
}

/* ════════════════════════════════════════════════════════════════════
   SEARCH / FILTER BAR
════════════════════════════════════════════════════════════════════ */
.adm-filter-bar {
  display    : flex;
  gap        : 8px;
  flex-wrap  : wrap;
  align-items: center;
  margin-bottom: 10px;
}
.adm-filter-bar .form-control,
.adm-filter-bar .form-select {
  font-size   : 0.8rem;
  max-width   : 200px;
  background  : var(--input-bg)     !important;
  color       : var(--input-color)  !important;
  border-color: var(--input-border) !important;
  border-radius: 8px;
}
.adm-filter-bar .form-control:focus,
.adm-filter-bar .form-select:focus {
  border-color: #0d6efd !important;
  box-shadow  : 0 0 0 0.18rem rgba(13,110,253,0.18) !important;
}
.adm-record-count {
  font-size : 0.75rem;
  color     : var(--text-secondary);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════
   ACTION BUTTONS (table row)
════════════════════════════════════════════════════════════════════ */
.adm-btn-edit,
.adm-btn-delete {
  font-size    : 0.72rem;
  padding      : 2px 9px;
  border-radius: 6px;
  font-weight  : 600;
  cursor       : pointer;
  transition   : background 0.15s, color 0.15s, transform 0.1s;
  border       : 1px solid transparent;
  text-decoration: none;
  display      : inline-flex;
  align-items  : center;
  gap          : 3px;
}
.adm-btn-edit {
  background  : transparent;
  color       : #0d6efd;
  border-color: rgba(13,110,253,0.35);
}
.adm-btn-edit:hover {
  background: #0d6efd;
  color     : #fff;
  transform : translateY(-1px);
}
.adm-btn-delete {
  background  : transparent;
  color       : #dc3545;
  border-color: rgba(220,53,69,0.35);
}
.adm-btn-delete:hover {
  background: #dc3545;
  color     : #fff;
  transform : translateY(-1px);
}

/* ════════════════════════════════════════════════════════════════════
   STATUS / ACTION BADGES (foc_upload preview)
════════════════════════════════════════════════════════════════════ */
.adm-badge {
  display      : inline-flex;
  align-items  : center;
  gap          : 4px;
  font-size    : 0.7rem;
  font-weight  : 700;
  padding      : 2px 8px;
  border-radius: 999px;
  white-space  : nowrap;
}
.adm-badge-new    { background: rgba(25,135,84,0.12);  color: #198754; border: 1px solid rgba(25,135,84,0.25); }
.adm-badge-update { background: rgba(13,110,253,0.10); color: #0d6efd; border: 1px solid rgba(13,110,253,0.22); }
.adm-badge-delete { background: rgba(220,53,69,0.10);  color: #dc3545; border: 1px solid rgba(220,53,69,0.22); }
[data-theme="dark"] .adm-badge-new    { background: rgba(25,135,84,0.18);  }
[data-theme="dark"] .adm-badge-update { background: rgba(13,110,253,0.18); }
[data-theme="dark"] .adm-badge-delete { background: rgba(220,53,69,0.18);  }

/* ════════════════════════════════════════════════════════════════════
   FORM (product_form, mrp_edit, etc.)
════════════════════════════════════════════════════════════════════ */
.adm-form-label {
  font-size    : 0.8rem;
  font-weight  : 600;
  color        : var(--text-primary);
  margin-bottom: 4px;
  display      : block;
}
.adm-form-input,
.adm-form-select {
  font-size    : 0.83rem;
  background   : var(--input-bg)    !important;
  color        : var(--input-color) !important;
  border-color : var(--input-border) !important;
  border-radius: 8px;
}
.adm-form-input:focus,
.adm-form-select:focus {
  border-color: #0d6efd !important;
  box-shadow  : 0 0 0 0.2rem rgba(13,110,253,0.2) !important;
}
.adm-form-input::placeholder { color: var(--text-muted) !important; }
.adm-form-help {
  font-size : 0.73rem;
  color     : var(--text-muted);
  margin-top: 3px;
}
.adm-form-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom : 14px;
}
.adm-form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.adm-form-section-title {
  font-size    : 0.76rem;
  font-weight  : 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color        : var(--text-muted);
  margin-bottom: 10px;
}

/* ════════════════════════════════════════════════════════════════════
   CONFIRM DELETE PAGE
════════════════════════════════════════════════════════════════════ */
.adm-confirm-card {
  max-width    : 480px;
  margin       : 0 auto;
  background   : var(--bg-secondary);
  border       : 1px solid var(--border-color);
  border-radius: 14px;
  padding      : 28px 24px;
  text-align   : center;
  box-shadow   : 0 6px 24px var(--shadow-color);
}
.adm-confirm-icon  { font-size: 2.4rem; margin-bottom: 10px; }
.adm-confirm-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.adm-confirm-obj   { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 18px; word-break: break-all; }
.adm-confirm-btns  { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }


/* ════════════════════════════════════════
   CONFIRM DELETE — INFO BOX
════════════════════════════════════════ */
.adm-confirm-sub {
  font-size    : 0.82rem;
  color        : var(--text-muted);
  margin-bottom: 1.2rem;
  text-align   : center;
}

.adm-confirm-info-box {
  width        : 100%;
  background   : var(--bg-primary);
  border       : 1px solid var(--border-color);
  border-radius: 12px;
  overflow     : hidden;
  margin-bottom: 1.4rem;
}

.adm-confirm-info-row {
  display        : flex;
  align-items    : flex-start;
  gap            : 12px;
  padding        : 10px 16px;
  border-bottom  : 1px solid var(--border-color);
  font-size      : 0.83rem;
}
.adm-confirm-info-row:last-child {
  border-bottom: none;
}

.adm-confirm-info-row--warn {
  background: rgba(220, 53, 69, 0.06);
}

.adm-confirm-info-label {
  min-width  : 80px;
  font-weight: 700;
  color      : var(--text-muted);
  font-size  : 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 1px;
  flex-shrink: 0;
}

.adm-confirm-info-value {
  color      : var(--text-primary);
  font-weight: 500;
  line-height: 1.5;
  word-break : break-word;
}

/* ════════════════════════════════════════════════════════════════════
   PAGINATION (shared include)
════════════════════════════════════════════════════════════════════ */
.adm-pagination {
  display    : flex;
  align-items: center;
  gap        : 6px;
  flex-wrap  : wrap;
  margin-top : 12px;
}
.adm-pagination .adm-page-info {
  font-size : 0.75rem;
  color     : var(--text-secondary);
  white-space: nowrap;
}
.adm-pg-btn {
  font-size    : 0.74rem;
  padding      : 3px 9px;
  border-radius: 6px;
  border       : 1px solid var(--border-color);
  background   : var(--bg-secondary);
  color        : var(--text-primary);
  text-decoration: none;
  transition   : background 0.15s;
  display      : inline-flex;
  align-items  : center;
}
.adm-pg-btn:hover    { background: var(--bg-hover); color: var(--text-primary); }
.adm-pg-btn.active   { background: #0d6efd; border-color: #0d6efd; color: #fff !important; font-weight: 700; }
.adm-pg-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ════════════════════════════════════════════════════════════════════
   UPLOAD PREVIEW STATS ROW
════════════════════════════════════════════════════════════════════ */
.adm-preview-stats {
  display  : flex;
  gap      : 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.adm-stat-pill {
  display      : inline-flex;
  align-items  : center;
  gap          : 5px;
  font-size    : 0.76rem;
  font-weight  : 600;
  padding      : 4px 12px;
  border-radius: 999px;
  background   : color-mix(in srgb, var(--bg-hover) 60%, var(--bg-secondary));
  border       : 1px solid var(--border-color);
  color        : var(--text-primary);
}
.adm-stat-pill strong { font-size: 0.88rem; }

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD (dashboard.html)
════════════════════════════════════════════════════════════════════ */
.adm-dash-wrap   { max-width: 1180px; }
.adm-dash-hero   { padding: 0.5rem 0 1rem; }
.adm-dash-badge {
  display      : inline-flex;
  align-items  : center;
  gap          : 6px;
  font-size    : 0.76rem;
  font-weight  : 700;
  padding      : 3px 12px;
  border-radius: 999px;
  color        : var(--text-secondary);
  background   : color-mix(in srgb, var(--bg-secondary) 85%, var(--bg-hover));
  border       : 1px solid var(--border-color);
  margin-bottom: 8px;
}
.adm-dash-title    { font-size: clamp(1.5rem,1.2rem + 1vw,2.2rem); font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.adm-dash-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }
.adm-quick-title   { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 10px; }
.adm-quick-btn {
  border       : 1px solid var(--border-color) !important;
  background   : var(--bg-secondary)           !important;
  color        : var(--text-primary)           !important;
  border-radius: 999px                         !important;
  padding      : 0.55rem 1.1rem                !important;
  font-size    : 0.84rem                       !important;
  font-weight  : 700                           !important;
  transition   : transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  display      : inline-flex;
  align-items  : center;
  gap          : 6px;
}
.adm-quick-btn:hover {
  background: var(--bg-hover)   !important;
  color     : var(--text-primary) !important;
  transform : translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .adm-table         { font-size: 0.74rem; }
  .adm-table thead th,
  .adm-table tbody td{ padding: 5px 7px; }
  .adm-filter-bar .form-control,
  .adm-filter-bar .form-select { max-width: 100%; }
  .adm-confirm-card  { padding: 20px 16px; }
  .adm-header        { flex-direction: column; align-items: flex-start; }
}
/* ════════════════════════════════════════
   CONFIRM CHECKBOX
════════════════════════════════════════ */
.adm-confirm-check-wrap {
  display        : flex;
  justify-content: center;
  margin         : 1.2rem 0 1rem;
}

.adm-confirm-check-label {
  display    : inline-flex;
  align-items: center;
  gap        : 10px;
  cursor     : pointer;
  user-select: none;
  padding    : 10px 18px;
  border-radius: 10px;
  border     : 1.5px solid var(--border-color);
  background : var(--bg-primary);
  transition : border-color 0.2s, background 0.2s;
}

.adm-confirm-check-label:hover {
  border-color: rgba(220,53,69,0.4);
  background  : rgba(220,53,69,0.04);
}

/* Hide native checkbox */
.adm-confirm-checkbox {
  position: absolute;
  opacity : 0;
  width   : 0;
  height  : 0;
}

/* Custom box */
.adm-confirm-check-box {
  width        : 20px;
  height       : 20px;
  min-width    : 20px;
  border-radius: 6px;
  border       : 2px solid var(--border-color);
  background   : var(--bg-secondary);
  display      : flex;
  align-items  : center;
  justify-content: center;
  transition   : background 0.2s, border-color 0.2s;
}

.adm-confirm-check-box svg {
  width    : 11px;
  height   : 9px;
  color    : #fff;
  opacity  : 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.15s;
}

/* Checked state */
.adm-confirm-checkbox:checked + .adm-confirm-check-box {
  background  : #dc3545;
  border-color: #dc3545;
}
.adm-confirm-checkbox:checked + .adm-confirm-check-box svg {
  opacity  : 1;
  transform: scale(1);
}

/* Label turns red when checked */
.adm-confirm-checkbox:checked ~ .adm-confirm-check-text {
  color: #dc3545;
}

.adm-confirm-check-text {
  font-size  : 0.83rem;
  font-weight: 600;
  color      : var(--text-secondary);
  transition : color 0.2s;
}
/* ════════════════════════════════
   MRP SEGMENTED INPUT
════════════════════════════════ */
.mrp-seg-wrap {
  display      : flex;
  flex-wrap    : nowrap;
  align-items  : center;
  gap          : 5px;
  background   : var(--input-bg);
  border       : 1.5px solid var(--input-border);
  border-radius: 10px;
  padding      : 8px 14px;
  width        : fit-content;   /* ← stops it stretching full width */
  transition   : border-color 0.2s, box-shadow 0.2s;
}

.mrp-seg-wrap:focus-within {
  border-color: #0d6efd;
  box-shadow  : 0 0 0 3px rgba(13,110,253,0.13);
}

.mrp-seg-prefix {
  width          : 30px;
  height         : 36px;
  display        : flex;
  align-items    : center;
  justify-content: center;
  border-radius  : 7px;
  background     : rgba(13,110,253,0.1);
  border         : 1px solid rgba(13,110,253,0.2);
  color          : #5a9ef8;
  font-size      : 0.95rem;
  font-weight    : 800;
  user-select    : none;
  flex-shrink    : 0;
}

.mrp-seg-box {
  width        : 36px !important;
  min-width    : 36px !important;
  max-width    : 36px !important;
  height       : 36px;
  flex-shrink  : 0;
  text-align   : center;
  border-radius: 7px;
  border       : 1.5px solid var(--border-color);
  background   : var(--bg-primary);
  color        : var(--text-primary);
  font-size    : 1rem;
  font-weight  : 700;
  outline      : none;
  padding      : 0 !important;
  transition   : border-color 0.15s, background 0.15s;
  caret-color  : #0d6efd;
  box-sizing   : border-box;
}

.mrp-seg-box::placeholder {
  color      : var(--text-muted);
  font-size  : 0.7rem;
  font-weight: 400;
}

.mrp-seg-box:focus {
  border-color: #0d6efd;
  background  : rgba(13,110,253,0.06);
  box-shadow  : 0 0 0 2px rgba(13,110,253,0.15);
}

.mrp-seg-box.filled {
  border-color: rgba(13,110,253,0.4);
  background  : rgba(13,110,253,0.05);
}

.mrp-seg-divider {
  width        : 1px;
  height       : 22px;
  background   : var(--border-color);
  border-radius: 2px;
  margin       : 0 3px;
  flex-shrink  : 0;
  opacity      : 0.6;
}

/* ── Prefix input (₹) ── */
.adm-input-prefix-wrap {
  position: relative;
  display : flex;
  align-items: center;
}
.adm-input-prefix {
  position   : absolute;
  left       : 10px;
  font-size  : 0.85rem;
  font-weight: 600;
  color      : var(--text-muted);
  pointer-events: none;
}
.adm-input-has-prefix {
  padding-left: 26px !important;
}

/* ── Warning badge variant ── */
.adm-form-badge--warn {
  background  : rgba(253,126,20,0.12);
  color       : #fd7e14;
  border-color: rgba(253,126,20,0.25);
}

/* ── Form actions row ── */
.adm-form-actions {
  display    : flex;
  gap        : 10px;
  align-items: center;
}

/* ── Scrollable table container ── */
.adm-table-wrap {
  scrollbar-width     : thin;
  scrollbar-color     : var(--border-color) transparent;
}
.adm-table-wrap::-webkit-scrollbar {
  width : 5px;
  height: 5px;
}
.adm-table-wrap::-webkit-scrollbar-track {
  background   : transparent;
  border-radius: 10px;
}
.adm-table-wrap::-webkit-scrollbar-thumb {
  background   : var(--border-color);
  border-radius: 10px;
}
.adm-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #0d6efd;
}

/* ── Sticky header inside scrollable table ── */
.adm-table-wrap thead tr th {
  position  : sticky;
  top       : 0;
  z-index   : 2;
  background: var(--table-head-bg);
  box-shadow: 0 1px 0 var(--border-color);
}