/* =========================================================
   PANOU PIZZER - STYLING (OPTIMIZAT PENTRU TELEFON & DESKTOP)
   ========================================================= */

:root {
  --admin-bg: #12100E;
  --admin-card: #1E1A17;
  --admin-card-hover: #26211D;
  --admin-border: #332B25;
  --admin-primary: #C72C1E;
  --admin-accent: #E09F3E;
  --admin-green: #10B981;
  --admin-blue: #3B82F6;
  --admin-yellow: #F59E0B;
  --admin-red: #EF4444;
  --admin-text: #F3EFEA;
  --admin-muted: #9E9287;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 50px;
}

.admin-header {
  background: #181412;
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--admin-primary);
}

.admin-brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.admin-brand-title span {
  color: var(--admin-primary);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header-action {
  background: #28221D;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-header-action:hover {
  background: #332C25;
}

.btn-sound-toggle {
  background: #28221D;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 8px 12px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Nav Tabs */
.admin-tabs {
  background: #181412;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--admin-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 14px 16px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.tab-btn.active {
  color: #FFF;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--admin-primary);
  border-radius: 3px 3px 0 0;
}

.tab-badge {
  background: var(--admin-primary);
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
}

/* Container */
.admin-container {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
}

/* Suspension Warning Banner */
.suspension-banner {
  background: #3B1210;
  border: 1px solid #7F1D1D;
  color: #FCA5A5;
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Order Cards Grid */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.order-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.order-card.new-pulse {
  border-color: var(--admin-yellow);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
  animation: pulseOrder 2s infinite;
}

@keyframes pulseOrder {
  0% { border-color: var(--admin-yellow); }
  50% { border-color: var(--admin-primary); }
  100% { border-color: var(--admin-yellow); }
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.order-number-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFF;
}

.order-date-time {
  font-size: 0.82rem;
  color: var(--admin-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.status-in_asteptare {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid #F59E0B;
}

.status-confirmata {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  border: 1px solid #3B82F6;
}

.status-in_preparare {
  background: rgba(234, 88, 12, 0.2);
  color: #FB923C;
  border: 1px solid #EA580C;
}

.status-gata_ridicare {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid #10B981;
}

.status-ridicata {
  background: rgba(107, 114, 128, 0.2);
  color: #9CA3AF;
  border: 1px solid #4B5563;
}

.status-anulata {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid #EF4444;
}

/* Customer Info Card Box */
.customer-info-box {
  background: #25201C;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.customer-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #FFF;
}

.customer-phone-display {
  font-size: 0.95rem;
  color: var(--admin-muted);
}

.pickup-time-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(224, 159, 62, 0.15);
  border: 1px solid rgba(224, 159, 62, 0.35);
  color: #F7C57E;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Call Button (Huge for phone) */
.btn-call-customer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #047857;
  color: #FFF;
  padding: 10px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.35);
}
.btn-call-customer:hover {
  background: #059669;
}

/* Items list */
.order-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.order-items-table tr {
  border-bottom: 1px solid #2C2621;
}

.order-items-table td {
  padding: 8px 4px;
}

.order-items-table td:last-child {
  text-align: right;
  font-weight: 700;
}

.order-notes-box {
  background: #2A241F;
  border-left: 3px solid var(--admin-accent);
  padding: 8px 12px;
  font-size: 0.88rem;
  color: #E2D9D0;
  margin-bottom: 16px;
  border-radius: 0 8px 8px 0;
}

.order-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  padding-top: 10px;
  border-top: 1px dashed var(--admin-border);
  margin-bottom: 18px;
}

.order-total-bar span:last-child {
  color: var(--admin-primary);
  font-size: 1.3rem;
}

/* Status Change Action Buttons */
.order-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-status-action {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-confirm {
  background: var(--admin-blue);
  color: #FFF;
}
.btn-confirm:hover { background: #2563EB; }

.btn-prep {
  background: #EA580C;
  color: #FFF;
}
.btn-prep:hover { background: #C2410C; }

.btn-ready {
  background: #10B981;
  color: #FFF;
}
.btn-ready:hover { background: #059669; }

.btn-picked {
  background: #4B5563;
  color: #FFF;
}
.btn-picked:hover { background: #374151; }

.btn-cancel {
  background: transparent;
  border-color: #EF4444;
  color: #EF4444;
}
.btn-cancel:hover { background: #3B1210; }

.btn-history-toggle {
  background: transparent;
  color: var(--admin-muted);
  font-size: 0.82rem;
  margin-left: auto;
  cursor: pointer;
  padding: 6px 10px;
}

/* Order History Timeline */
.order-history-timeline {
  display: none;
  background: #191614;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 14px;
  border: 1px solid #2B241F;
  font-size: 0.82rem;
}

.timeline-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #25201C;
  color: var(--admin-muted);
}
.timeline-step:last-child {
  border-bottom: none;
}

/* Modal styles for Cancel & Confirm */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal-backdrop.open {
  display: flex;
}

.admin-modal {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.admin-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 12px 14px;
  background: #14110F;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--admin-text);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Login Card */
.admin-login-card {
  max-width: 420px;
  margin: 80px auto;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.login-brand-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--admin-primary);
  margin: 0 auto 16px auto;
}

.btn-admin-login {
  width: 100%;
  background: var(--admin-primary);
  color: #FFF;
  padding: 13px;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-top: 8px;
}

/* Products Management Table */
.products-admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--admin-card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
}

.products-admin-table th, .products-admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.products-admin-table th {
  background: #181412;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--admin-muted);
}

/* Switch toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #332B25;
  transition: .3s;
  border-radius: 24px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider-toggle {
  background-color: var(--admin-green);
}
input:checked + .slider-toggle:before {
  transform: translateX(20px);
}
