/* Manager Admin Page Styles */

.admin-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h1 {
  font-size: 1.8rem;
  color: #3fd07f;
  margin: 0;
}

.nav-link {
  color: #9aa0aa;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #ffffff;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  background: #1f232b;
  padding: 6px;
  border-radius: 12px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: #9aa0aa;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #2a2f38;
  color: #d1d5db;
}

.tab-btn.active {
  background: #3fd07f;
  color: #1f232b;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.admin-section {
  background: #2a2f38;
  padding: 24px;
  border-radius: 16px;
}

.admin-section h2 {
  font-size: 1.3rem;
  margin: 0 0 8px;
  color: #ffffff;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-header h2 {
  margin: 0;
}

.section-description {
  font-size: 0.9rem;
  color: #9aa0aa;
  margin: 0 0 16px;
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th {
  text-align: left;
  color: #9aa0aa;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 2px solid #3a414e;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #1f232b;
  vertical-align: middle;
}

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

.admin-table tr:hover {
  background: #333a44;
}

.admin-table input[type="number"],
.admin-table input[type="text"] {
  background: #1f232b;
  border: 1px solid #3a414e;
  border-radius: 6px;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 0.9rem;
  width: 100%;
  max-width: 120px;
}

.admin-table input:focus {
  border-color: #3fd07f;
  outline: none;
}

/* Recipe List */
.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-item {
  background: #242831;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.recipe-info {
  flex: 1;
  min-width: 200px;
}

.recipe-info h3 {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: #ffffff;
}

.recipe-info p {
  font-size: 0.85rem;
  color: #9aa0aa;
  margin: 0;
}

.recipe-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Buttons */
.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
  min-width: auto;
}

.btn-icon {
  padding: 6px 12px;
  font-size: 0.85rem;
  min-width: auto;
  background: #374151;
  color: #d1d5db;
  border: none;
}

.btn-icon:hover {
  background: #4b5563;
}

.btn-danger {
  background: #7f1d1d;
  color: white;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-warning {
  background: #92400e;
  color: white;
}

.btn-warning:hover {
  background: #b45309;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  background: #064e3b;
  color: #34d399;
}

.status-inactive {
  background: #3f3f46;
  color: #a1a1aa;
}

/* Forms */
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  color: #9aa0aa;
  font-weight: 600;
}

.form-input {
  background: #1f232b;
  border: 2px solid #3a414e;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #3fd07f;
}

/* Form Select */
.form-select {
  background: #1f232b;
  border: 2px solid #3a414e;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}

.form-select:focus {
  border-color: #3fd07f;
}

/* Filter Row */
.filter-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 24px;
  padding: 16px;
  background: #242831;
  border-radius: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.85rem;
  color: #9aa0aa;
  font-weight: 600;
}

.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.batch-filters .filter-group {
  min-width: 120px;
}

.batch-filters .filter-group input[type="text"] {
  width: 150px;
}

/* Toggle Group */
.toggle-group {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #3a414e;
}

.toggle-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: #1f232b;
  color: #9aa0aa;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: #333a44;
}

.toggle-btn.active {
  background: #3fd07f;
  color: #1f232b;
}

/* Usage Table */
.usage-table th.total-col,
.usage-table td.total-col {
  background: #1a3a28;
  font-weight: 700;
  color: #3fd07f;
}

.usage-table th.variance-col,
.usage-table td.variance-col {
  text-align: right;
}

.usage-table tfoot th,
.usage-table tfoot td {
  background: #1f232b;
  font-weight: 700;
  border-top: 2px solid #3a414e;
}

.usage-table td {
  text-align: right;
}

.usage-table td:first-child,
.usage-table th:first-child {
  text-align: left;
}

/* Modal Variations */
.modal-wide {
  max-width: 800px;
}

#batchDetailsModal .modal-content {
  max-width: 950px;
  width: 95%;
}

.modal-content h3 {
  font-size: 1rem;
  color: #9aa0aa;
  margin: 16px 0 12px;
}

#recipeIngredientsTable input,
#recipeIngredientsTable select {
  max-width: 100%;
}

#recipeIngredientsTable select {
  min-width: 140px;
}

#recipeIngredientsTable td {
  padding: 8px 6px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #242831;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #3fd07f;
}

.stat-label {
  font-size: 0.85rem;
  color: #9aa0aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Charts */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.charts-row.analytics-grid {
  grid-template-columns: repeat(2, 1fr);
}

.chart-card {
  background: #242831;
  border-radius: 12px;
  padding: 20px;
}

.chart-card h3 {
  font-size: 1rem;
  color: #d1d5db;
  margin: 0 0 16px;
  text-align: center;
}

.chart-card.chart-wide {
  grid-column: 1 / -1;
}

.chart-container {
  position: relative;
  height: 220px;
}

.chart-container-wide {
  height: 280px;
}

.chart-container-gauge {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-data-msg {
  color: #9aa0aa;
  text-align: center;
  font-style: italic;
  padding: 40px 20px;
}

@media (max-width: 768px) {
  .charts-row.analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Table Scroll */
.table-scroll {
  overflow-x: auto;
}

.subsection-title {
  font-size: 1.1rem;
  color: #d1d5db;
  margin: 0 0 12px;
}

/* Deviation Colors */
.deviation-positive {
  color: #22c55e;
}

.deviation-negative {
  color: #ef4444;
}

.deviation-neutral {
  color: #9aa0aa;
}

/* Batch Details Modal */
.batch-details-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.batch-details-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  background: #1f232b;
  padding: 16px;
  border-radius: 10px;
}

.batch-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.batch-meta-label {
  font-size: 0.8rem;
  color: #9aa0aa;
  text-transform: uppercase;
}

.batch-meta-value {
  font-size: 1rem;
  color: #ffffff;
  font-weight: 600;
}

.batch-steps-chart-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.batch-steps-table-wrapper {
  overflow-x: auto;
}

.batch-chart-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.batch-chart-wrapper canvas {
  max-height: 200px;
}

/* Export Modal */
.export-select-all {
  padding: 12px 0;
  border-bottom: 1px solid #3a414e;
  margin-bottom: 12px;
}

.export-recipe-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: #1f232b;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3fd07f;
  cursor: pointer;
}

.checkbox-label span {
  font-size: 0.95rem;
  color: #d1d5db;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .recipe-item {
    flex-direction: column;
  }

  .recipe-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .form-row {
    flex-direction: column;
  }

  .modal-content {
    padding: 20px;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .batch-steps-chart-container {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    flex-direction: column;
  }

  .tab-btn {
    text-align: center;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions {
    margin-left: 0;
  }

  .toggle-group {
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
  }
}

/* ── Checkbox Grid ───────────────────────────────────────────────────────── */

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #2a2f3a;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: #353a47;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3fd07f;
}
