/* Admin Portal Custom CSS */

/* Login box styling */
.login-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  margin-top: 40px;
}

/* Connection Status Banner */
.connection-banner {
  background-color: var(--primary);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.online {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

.status-indicator.offline {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.btn-test-ping {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-test-ping:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

/* Stats Cards */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* Analytics Cards & Progress bars */
.analytics-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.analytics-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.bar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-bar-label-container {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

.chart-bar-name {
  color: var(--primary);
}

.chart-bar-value {
  color: var(--text-muted);
  font-weight: 600;
}

.chart-bar-outer {
  width: 100%;
  height: 12px;
  background-color: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.chart-bar-inner {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-sm);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0; /* Updated dynamically */
}

.chart-bar-row:nth-child(even) .chart-bar-inner {
  background-color: var(--primary-light);
}

/* Orders Table Card */
.orders-table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
}

.order-count-badge {
  background-color: var(--accent-light);
  color: var(--accent-hover);
  padding: 4px 12px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.orders-table th {
  background-color: var(--bg);
  color: var(--primary);
  font-weight: 600;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.orders-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.orders-table tbody tr:hover {
  background-color: var(--bg);
}

.order-customer-info {
  display: flex;
  flex-direction: column;
}

.order-customer-phone {
  font-size: 12px;
  color: var(--text-muted);
}

.order-customer-email {
  font-size: 12px;
  color: var(--text-muted);
}

.order-details-title {
  font-weight: 600;
  color: var(--primary);
}

.order-details-sub {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 250px;
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.pending {
  background-color: #fef3c7;
  color: #92400e;
}

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

.status-badge.cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Action Dropdowns and Buttons */
.order-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition);
}

.btn-complete {
  background-color: #10b981;
  color: #ffffff;
}

.btn-complete:hover {
  background-color: #059669;
}

.btn-cancel {
  background-color: #f3f4f6;
  color: var(--text-muted);
}

.btn-cancel:hover {
  background-color: #e5e7eb;
}

.btn-delete {
  background-color: transparent;
  color: #ef4444;
  border: 1px solid transparent;
}

.btn-delete:hover {
  border-color: rgba(239, 68, 68, 0.2);
  background-color: rgba(239, 68, 68, 0.05);
}

.btn-reset {
  background-color: #f59e0b;
  color: #ffffff;
}

.btn-reset:hover {
  background-color: #d97706;
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Dashboard Tabs Layout */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-top: 32px;
  padding-bottom: 1px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

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

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

.tab-content.hidden {
  display: none;
}

/* 3:1 Grid for Ingredients Layout */
.grid-3-1 {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 992px) {
  .grid-3-1 {
    grid-template-columns: 1fr;
  }
}

/* Cost Editing Inputs inside tables */
.cost-input {
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  width: 70px;
  box-sizing: border-box;
  text-align: left;
  transition: var(--transition);
}

.cost-input:read-only {
  background: transparent;
  border: 1px solid transparent;
  outline: none;
  cursor: default;
  color: var(--text-main);
  padding: 4px 0;
}

.cost-input:not(:read-only) {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  box-shadow: var(--shadow-sm);
  outline: 2px solid rgba(139, 92, 246, 0.2);
}

/* Recipe Cost Item List styling */
.recipe-cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recipe-cost-item:hover {
  background-color: #f3f4f6;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.recipe-cost-name {
  font-weight: 500;
  color: var(--text-main);
}

.recipe-cost-val {
  font-weight: 700;
  color: var(--primary);
}

/* Recipe formulations cards */
.recipe-section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.recipe-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 6px;
}

.recipe-part-header td {
  background-color: #f9fafb !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
  padding: 10px 16px !important;
  font-size: 12px !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
}

/* Mold-size cost pills inside base batch cost sidebar */
.recipe-size-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 6px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'Outfit', sans-serif;
  line-height: 1.3;
  color: var(--text-main);
}

.recipe-size-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

