/*************************************************************
 * AROMA LAB — Admin Orders & PnL Styles
 * File: admin-orders.css
 *************************************************************/

/* ============================================================
   HEADER BUTTON
   ============================================================ */

.ao-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #B8963E 0%, #d4b356 100%);
  color: #0A2E1F;
  border: none;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(184, 150, 62, 0.3);
  white-space: nowrap;
}

.ao-header-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(184, 150, 62, 0.45);
  background: linear-gradient(135deg, #c9a84a 0%, #e0c268 100%);
}

/* ============================================================
   MAIN OVERLAY + PANEL
   ============================================================ */

.ao-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(10, 46, 31, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  margin: 0 !important;
  isolation: isolate;
}

.ao-auth-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ao-panel {
  background: #FFFBF5;
  border-radius: 20px;
  width: 100%;
  max-width: 1100px;
  min-height: 90vh;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: aoSlideIn 0.35s ease;
  position: relative;
  z-index: 2147483647 !important;
  margin: auto;
}

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

.ao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(135deg, #0A2E1F 0%, #123a28 100%);
  color: #FFFBF5;
  border-bottom: 3px solid #B8963E;
  flex-shrink: 0;
}

.ao-header-left { flex: 1; }

.ao-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
}

.ao-subtitle {
  font-size: 11px;
  opacity: 0.7;
  margin: 4px 0 0 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ao-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 251, 245, 0.15);
  color: #FFFBF5;
  border: none;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.ao-close:hover {
  background: #B8963E;
  color: #0A2E1F;
  transform: rotate(90deg);
}

/* ============================================================
   TABS
   ============================================================ */

.ao-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: #FFFBF5;
  border-bottom: 1px solid rgba(10, 46, 31, 0.1);
  overflow-x: auto;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.ao-tabs::-webkit-scrollbar { height: 4px; }
.ao-tabs::-webkit-scrollbar-thumb { background: #B8963E; border-radius: 2px; }

.ao-tab {
  padding: 16px 20px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: rgba(10, 46, 31, 0.5);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  font-family: inherit;
}

.ao-tab:hover { color: #0A2E1F; }
.ao-tab.active { color: #0A2E1F; border-bottom-color: #B8963E; }

.ao-badge {
  background: #B8963E;
  color: #0A2E1F;
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.ao-badge-green { background: #0A2E1F; color: #FFFBF5; }

.ao-message {
  margin: 16px 32px 0;
  padding: 12px 18px;
  background: rgba(184, 150, 62, 0.15);
  border-left: 4px solid #B8963E;
  border-radius: 8px;
  font-size: 13px;
  color: #0A2E1F;
  animation: aoFadeIn 0.3s;
  flex-shrink: 0;
}

@keyframes aoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ao-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.ao-loading {
  text-align: center;
  padding: 60px 20px;
  font-size: 14px;
  color: rgba(10, 46, 31, 0.5);
}

.ao-loading-small {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: rgba(10, 46, 31, 0.5);
}

.ao-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(10, 46, 31, 0.4);
  font-size: 14px;
}

.ao-empty-small {
  text-align: center;
  padding: 20px;
  color: rgba(10, 46, 31, 0.4);
  font-size: 13px;
}

.ao-empty-small p { margin: 4px 0; }

.ao-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #0A2E1F;
  margin: 0 0 12px 0;
}

.ao-hint {
  font-size: 12px;
  color: rgba(10, 46, 31, 0.5);
  margin: 0 0 20px 0;
  font-style: italic;
}

/* ============================================================
   ORDERS LIST
   ============================================================ */

.ao-orders-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ao-order-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(10, 46, 31, 0.08);
  padding: 18px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(10, 46, 31, 0.04);
}

.ao-order-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(10, 46, 31, 0.1);
  border-color: rgba(184, 150, 62, 0.4);
}

.ao-order-card.pending { border-left: 4px solid #f59e0b; }
.ao-order-card.completed { border-left: 4px solid #10b981; }
.ao-order-card.cancelled { border-left: 4px solid #dc2626; }

.ao-order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(10, 46, 31, 0.1);
  gap: 12px;
}

.ao-order-id {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0A2E1F;
  letter-spacing: 0.05em;
  word-break: break-all;
}

.ao-order-date {
  font-size: 11px;
  color: rgba(10, 46, 31, 0.5);
  margin-top: 2px;
}

.ao-order-status {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.ao-status-pending { background: #fef3c7; color: #92400e; }
.ao-status-completed { background: #d1fae5; color: #065f46; }
.ao-status-cancelled { background: #fee2e2; color: #991b1b; }

.ao-order-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.ao-order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.ao-label {
  color: rgba(10, 46, 31, 0.5);
  font-weight: 500;
  flex-shrink: 0;
}

.ao-value {
  color: #0A2E1F;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.ao-items {
  font-size: 12px;
  color: rgba(10, 46, 31, 0.7);
  max-width: 200px;
}

.ao-order-total {
  padding-top: 8px;
  border-top: 1px dashed rgba(10, 46, 31, 0.1);
  margin-top: 4px;
}

.ao-amount {
  font-size: 16px;
  font-weight: 700;
  color: #B8963E;
}

.ao-profit {
  color: #10b981;
  font-weight: 700;
}

.ao-order-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.ao-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  font-family: inherit;
}

.ao-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ao-btn-primary { background: #0A2E1F; color: #FFFBF5; }
.ao-btn-primary:hover:not(:disabled) { background: #123a28; transform: translateY(-1px); }

.ao-btn-secondary { background: rgba(10, 46, 31, 0.08); color: #0A2E1F; }
.ao-btn-secondary:hover:not(:disabled) { background: rgba(10, 46, 31, 0.15); }

.ao-btn-complete { background: #10b981; color: #fff; }
.ao-btn-complete:hover { background: #059669; transform: translateY(-1px); }

.ao-btn-cancel { background: #fee2e2; color: #991b1b; }
.ao-btn-cancel:hover { background: #fecaca; }

.ao-btn-delete { background: #dc2626; color: #fff; }
.ao-btn-delete:hover { background: #b91c1c; }

/* ============================================================
   AUTH MODAL (Supabase Login)
   ============================================================ */

.ao-auth-modal {
  background: #FFFBF5;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 40px 32px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  position: relative;
  animation: aoModalIn 0.3s ease;
  z-index: 2147483647 !important;
  margin: auto;
}

.ao-auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.ao-auth-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: #0A2E1F;
  margin: 0 0 8px 0;
}

.ao-auth-desc {
  font-size: 13px;
  color: rgba(10, 46, 31, 0.6);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.ao-auth-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(10, 46, 31, 0.15);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: #0A2E1F;
  text-align: center;
  letter-spacing: 0.1em;
  font-family: inherit;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.ao-auth-input:focus {
  outline: none;
  border-color: #B8963E;
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.15);
}

.ao-auth-btn {
  width: 100%;
  padding: 14px 20px;
  background: #0A2E1F;
  color: #FFFBF5;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.ao-auth-btn:hover:not(:disabled) {
  background: #123a28;
  transform: translateY(-1px);
}

.ao-auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ao-auth-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

/* ============================================================
   MODAL (Order Complete)
   ============================================================ */

.ao-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  margin: 0 !important;
}

.ao-modal {
  background: #FFFBF5;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: aoModalIn 0.3s ease;
  overflow: hidden;
  position: relative;
  z-index: 2147483647 !important;
  margin: auto;
}

@keyframes aoModalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ao-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #0A2E1F;
  color: #FFFBF5;
  border-bottom: 3px solid #B8963E;
  flex-shrink: 0;
}

.ao-modal-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.ao-modal-close {
  background: rgba(255, 251, 245, 0.15);
  color: #FFFBF5;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ao-modal-close:hover {
  background: #B8963E;
  color: #0A2E1F;
  transform: rotate(90deg);
}

.ao-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ao-modal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ao-modal-customer {
  background: rgba(184, 150, 62, 0.1);
  padding: 14px;
  border-radius: 10px;
  border-left: 3px solid #B8963E;
}

.ao-modal-customer p {
  margin: 3px 0;
  font-size: 13px;
  color: #0A2E1F;
}

.ao-modal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(10, 46, 31, 0.6);
}

.ao-modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(10, 46, 31, 0.15);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #0A2E1F;
  transition: all 0.3s;
  font-family: inherit;
  box-sizing: border-box;
}

.ao-modal-input:focus {
  outline: none;
  border-color: #B8963E;
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.15);
}

.ao-modal-summary {
  background: rgba(10, 46, 31, 0.04);
  padding: 16px;
  border-radius: 12px;
  margin-top: 8px;
}

.ao-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #0A2E1F;
}

.ao-modal-profit {
  border-top: 2px solid #B8963E;
  margin-top: 8px;
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #0A2E1F;
}

.ao-modal-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

.ao-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(10, 46, 31, 0.1);
  background: #FFFBF5;
  flex-shrink: 0;
}

/* ============================================================
   SETTINGS TAB
   ============================================================ */

.ao-settings-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.ao-settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.ao-settings-header .ao-section-title {
  margin: 0;
  font-size: 18px;
}

.ao-refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(184, 150, 62, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.ao-refresh-btn:hover:not(:disabled) {
  background: #B8963E;
  transform: rotate(180deg);
}

.ao-refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ao-last-refresh {
  font-size: 10px;
  color: rgba(10, 46, 31, 0.4);
  margin: 0 0 8px 0;
  text-align: right;
}

.ao-warning-box {
  background: #fef3c7;
  color: #92400e;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ao-settings-main {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid rgba(10, 46, 31, 0.08);
}

.ao-product-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(10, 46, 31, 0.08);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.ao-product-btn:hover {
  border-color: #B8963E;
  transform: translateX(4px);
}

.ao-product-btn.active {
  background: #0A2E1F;
  border-color: #0A2E1F;
}

.ao-product-btn.active .ao-product-name { color: #FFFBF5; }
.ao-product-btn.active .ao-product-cost { color: rgba(255, 251, 245, 0.7); }

.ao-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #0A2E1F;
}

.ao-product-cost {
  font-size: 11px;
  color: rgba(10, 46, 31, 0.5);
}

.ao-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.ao-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ao-form-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10, 46, 31, 0.6);
}

.ao-form-field input,
.ao-form-field select {
  padding: 10px 12px;
  border: 1px solid rgba(10, 46, 31, 0.15);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #0A2E1F;
  transition: all 0.3s;
  font-family: inherit;
  box-sizing: border-box;
  width: 100%;
}

.ao-form-field input:focus,
.ao-form-field select:focus {
  outline: none;
  border-color: #B8963E;
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.15);
}

.ao-summary-box {
  background: rgba(10, 46, 31, 0.04);
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.ao-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: #0A2E1F;
}

/* ============================================================
   COMMISSIONS TAB
   ============================================================ */

.ao-comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.ao-comm-card {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(10, 46, 31, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ao-comm-header { margin-bottom: 4px; }

.ao-comm-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ao-comm-bank { background: #dbeafe; color: #1e40af; }
.ao-comm-koko { background: #fce7f3; color: #9d174d; }
.ao-comm-online { background: #d1fae5; color: #065f46; }

/* ============================================================
   PNL REPORT TAB
   ============================================================ */

.ao-pnl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(10, 46, 31, 0.08);
}

.ao-pnl-filters .ao-form-field { min-width: 140px; }
.ao-pnl-filters .ao-btn { flex: 0 0 auto; min-width: 100px; }

.ao-pnl-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.ao-pnl-card {
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(10, 46, 31, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s;
}

.ao-pnl-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(10, 46, 31, 0.08);
}

.ao-pnl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(10, 46, 31, 0.5);
}

.ao-pnl-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: #0A2E1F;
}

.ao-pnl-margin {
  font-size: 11px;
  color: rgba(10, 46, 31, 0.5);
}

.ao-pnl-income .ao-pnl-value { color: #0A2E1F; }
.ao-pnl-cost .ao-pnl-value { color: #dc2626; }
.ao-pnl-comm .ao-pnl-value { color: #d97706; }
.ao-pnl-exp .ao-pnl-value { color: #dc2626; }
.ao-pnl-profit .ao-pnl-value { color: #10b981; }

.ao-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(10, 46, 31, 0.08);
}

.ao-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ao-table thead {
  background: #0A2E1F;
  color: #FFFBF5;
}

.ao-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ao-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(10, 46, 31, 0.06);
  color: #0A2E1F;
}

.ao-table tr:hover td { background: rgba(184, 150, 62, 0.05); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .ao-overlay {
    padding: 0 !important;
    align-items: stretch;
  }
  
  .ao-panel {
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }
  
  .ao-header { padding: 18px 20px; }
  .ao-title { font-size: 22px; }
  .ao-tabs { padding: 0 12px; }
  .ao-tab { padding: 12px 14px; font-size: 11px; }
  .ao-content { padding: 16px 20px 30px; }
  .ao-orders-list { grid-template-columns: 1fr; }
  .ao-settings-layout { grid-template-columns: 1fr; }
  .ao-form-grid { grid-template-columns: 1fr; }
  .ao-pnl-summary { grid-template-columns: repeat(2, 1fr); }
  .ao-header-btn { padding: 8px 12px; font-size: 11px; }
  .ao-modal { max-height: 95vh; border-radius: 16px; }
  .ao-modal-footer { flex-direction: column-reverse; }
  .ao-auth-modal { padding: 32px 24px; border-radius: 16px; }
}

@media (max-width: 480px) {
  .ao-pnl-summary { grid-template-columns: 1fr; }
  .ao-order-actions { flex-direction: column; }
  .ao-pnl-filters { flex-direction: column; align-items: stretch; }
  .ao-pnl-filters .ao-form-field,
  .ao-pnl-filters .ao-btn { width: 100%; min-width: auto; }
   }

/* ============================================================
   V2 ADDITIONS — Items Edit + Discount
   ============================================================ */

/* ---- Items Edit List ---- */

.ao-items-edit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ao-item-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(10, 46, 31, 0.1);
  border-radius: 10px;
  transition: all 0.2s;
}

.ao-item-edit-row:hover {
  border-color: rgba(184, 150, 62, 0.4);
  box-shadow: 0 2px 8px rgba(10, 46, 31, 0.06);
}

.ao-item-edit-name {
  flex: 1;
  min-width: 0;
}

.ao-item-edit-title {
  font-size: 13px;
  font-weight: 600;
  color: #0A2E1F;
  margin-bottom: 2px;
  word-break: break-word;
}

.ao-item-edit-price {
  font-size: 11px;
  color: rgba(10, 46, 31, 0.5);
}

.ao-item-edit-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ao-item-edit-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(10, 46, 31, 0.2);
  background: #fff;
  color: #0A2E1F;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  padding: 0;
}

.ao-item-edit-qty button:hover {
  background: #0A2E1F;
  color: #FFFBF5;
  border-color: #0A2E1F;
}

.ao-item-edit-qty span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #0A2E1F;
}

.ao-item-edit-total {
  font-size: 13px;
  font-weight: 700;
  color: #B8963E;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.ao-item-edit-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.ao-item-edit-remove:hover {
  background: #dc2626;
  color: #fff;
  transform: scale(1.1);
}

.ao-items-empty {
  text-align: center;
  padding: 20px;
  color: rgba(10, 46, 31, 0.4);
  font-size: 12px;
  font-style: italic;
  background: rgba(10, 46, 31, 0.03);
  border-radius: 8px;
}

/* ---- Add Item Button ---- */

.ao-add-item-btn {
  width: 100%;
  padding: 12px;
  background: rgba(184, 150, 62, 0.12);
  color: #0A2E1F;
  border: 2px dashed rgba(184, 150, 62, 0.4);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.05em;
}

.ao-add-item-btn:hover:not(:disabled) {
  background: rgba(184, 150, 62, 0.2);
  border-color: #B8963E;
}

.ao-add-item-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Add Item Form ---- */

.ao-add-item-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  padding: 12px;
  background: rgba(10, 46, 31, 0.03);
  border-radius: 10px;
  align-items: center;
}

.ao-add-item-form select,
.ao-add-item-form input {
  padding: 10px 12px;
  border: 1px solid rgba(10, 46, 31, 0.15);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #0A2E1F;
  font-family: inherit;
}

.ao-add-item-form select {
  flex: 1;
  min-width: 0;
}

.ao-add-item-form input {
  width: 70px;
}

.ao-add-item-form select:focus,
.ao-add-item-form input:focus {
  outline: none;
  border-color: #B8963E;
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.15);
}

.ao-add-item-form .ao-btn {
  padding: 10px 14px;
  font-size: 12px;
  flex: 0 0 auto;
  min-width: auto;
}

/* ---- Discount highlight ---- */

.ao-modal-label[style*="d97706"] {
  color: #d97706 !important;
  font-weight: 700;
}

/* ---- PnL Report — Discount card ---- */

.ao-pnl-card .ao-pnl-value[style*="d97706"] {
  color: #d97706 !important;
}

/* ---- Mobile Responsive ---- */

@media (max-width: 640px) {
  .ao-item-edit-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }
  
  .ao-item-edit-name {
    flex: 1 1 100%;
    order: 1;
  }
  
  .ao-item-edit-qty {
    order: 2;
  }
  
  .ao-item-edit-total {
    order: 3;
    margin-left: auto;
  }
  
  .ao-item-edit-remove {
    order: 4;
  }
  
  .ao-add-item-form {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .ao-add-item-form input {
    width: 100%;
  }
  
  .ao-add-item-form .ao-btn {
    width: 100%;
  }
}
/* ============================================================
   AROMA LAB — Admin Orders Dynamic System Additions
   ============================================================ */

/* ---- Settings Sub-Tabs (Product Costs, Cost Types, Delivery) ---- */
.ao-settings-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(10, 46, 31, 0.1);
  padding-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ao-settings-tabs::-webkit-scrollbar {
  height: 3px;
}

.ao-settings-tabs::-webkit-scrollbar-thumb {
  background: #B8963E;
  border-radius: 2px;
}

.ao-settings-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(10, 46, 31, 0.5);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ao-settings-tab:hover {
  color: #0A2E1F;
  background: rgba(184, 150, 62, 0.08);
  border-radius: 6px 6px 0 0;
}

.ao-settings-tab.active {
  color: #0A2E1F;
  border-bottom-color: #B8963E;
}

/* ---- Cost Types / Delivery — Add Form ---- */
.ao-add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: stretch;
}

.ao-add-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(10, 46, 31, 0.15);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #0A2E1F;
  font-family: inherit;
  min-width: 0;
}

.ao-add-form input:focus {
  outline: none;
  border-color: #B8963E;
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.15);
}

.ao-add-form button {
  flex-shrink: 0;
  padding: 12px 24px;
  background: #0A2E1F;
  color: #FFFBF5;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.ao-add-form button:hover {
  background: #123a28;
  transform: translateY(-1px);
}

/* ---- Cost Type / Item Row ---- */
.ao-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid rgba(10, 46, 31, 0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.ao-list-item:hover {
  border-color: rgba(184, 150, 62, 0.4);
  box-shadow: 0 2px 8px rgba(10, 46, 31, 0.06);
  transform: translateX(4px);
}

.ao-list-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #0A2E1F;
  flex: 1;
  word-break: break-word;
}

.ao-list-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ao-list-item-delete {
  padding: 8px 14px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.ao-list-item-delete:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* ---- Delivery Settings Form ---- */
.ao-delivery-form {
  max-width: 500px;
}

.ao-delivery-form .ao-form-field {
  margin-bottom: 16px;
}

.ao-delivery-hint {
  font-size: 12px;
  color: rgba(10, 46, 31, 0.6);
  margin: 15px 0;
  padding: 12px 16px;
  background: rgba(184, 150, 62, 0.1);
  border-left: 3px solid #B8963E;
  border-radius: 8px;
  font-style: italic;
}

/* ---- Payment Method Dropdown (Order Complete) ---- */
.ao-modal-input option {
  padding: 8px;
  font-size: 14px;
}

/* ---- Product Costs — Dynamic Cost Fields ---- */
.ao-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

/* ---- Loading Skeleton ---- */
.ao-loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: aoShimmer 1.5s infinite;
  border-radius: 8px;
  height: 20px;
  margin-bottom: 10px;
}

@keyframes aoShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---- Product Costs — Custom Cost Fields Auto Layout ---- */
.ao-form-field input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* ---- Badge for cost types count ---- */
.ao-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(184, 150, 62, 0.2);
  color: #0A2E1F;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}

/* ---- Order Complete — Updated items styling ---- */
.ao-item-edit-qty button {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Sub-tab within Settings ---- */
.ao-settings > div:first-child .ao-tab {
  padding: 10px 18px;
  font-size: 12px;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 640px) {
  .ao-settings-tabs {
    gap: 4px;
  }
  
  .ao-settings-tab {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .ao-add-form {
    flex-direction: column;
  }
  
  .ao-add-form button {
    width: 100%;
  }
  
  .ao-form-grid {
    grid-template-columns: 1fr;
  }
  
  .ao-delivery-form {
    max-width: 100%;
  }
  
  .ao-list-item {
    padding: 12px 14px;
  }
  
  .ao-list-item-name {
    font-size: 13px;
  }
  
  .ao-list-item-delete {
    padding: 6px 12px;
    font-size: 11px;
  }
}

/* ---- Print Friendly (PnL) ---- */
@media print {
  .ao-header,
  .ao-tabs,
  .ao-close,
  .ao-pnl-filters {
    display: none !important;
  }
  
  .ao-panel {
    box-shadow: none !important;
    max-height: none !important;
  }
  
  .ao-content {
    padding: 0 !important;
    overflow: visible !important;
  }
}
