/* ==========================================================================
   시트리(CITRY) × 눈별 원장님 B2B 제품 공급·발주 시스템 스타일시트
   ========================================================================== */

:root {
  --primary: #111827;
  --primary-light: #1f2937;
  --accent-gold: #c5a059;
  --accent-gold-hover: #b08d48;
  --accent-gold-soft: rgba(197, 160, 89, 0.12);
  --accent-rose: #e11d48;
  --accent-rose-soft: rgba(225, 29, 72, 0.1);
  --accent-emerald: #059669;
  --accent-emerald-soft: rgba(5, 150, 105, 0.1);
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg-page: #f9fafb;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --border-focus: #c5a059;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  /* Status Colors */
  --status-pending: #6b7280;
  --status-pending-bg: #f3f4f6;
  --status-preparing: #d97706;
  --status-preparing-bg: #fef3c7;
  --status-shipping: #2563eb;
  --status-shipping-bg: #dbeafe;
  --status-delivered: #059669;
  --status-delivered-bg: #d1fae5;
  --status-unpaid: #dc2626;
  --status-unpaid-bg: #fee2e2;
  --status-paid: #0d9488;
  --status-paid-bg: #ccfbf1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 90px;
}

.admin-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px 90px;
}

/* Header & Branding */
.brand-header {
  text-align: center;
  padding: 30px 22px 34px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #111827 100%);
  border-radius: var(--radius-lg);
  color: #ffffff;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.brand-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.brand-partnership {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-radius: var(--radius-full);
  font-size: 13px;
  letter-spacing: 1px;
  color: #e2e8f0;
  margin-bottom: 14px;
}

.brand-partnership .highlight {
  color: var(--accent-gold);
  font-weight: 800;
}

.brand-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, #f1f5f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 13.5px;
  color: #cbd5e1;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Mode Bar */
.mode-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.nav-link-btn:hover {
  background: #f9fafb;
  color: var(--primary);
  border-color: #cbd5e1;
}

/* Card Section */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent-gold);
  color: #ffffff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Contract Info Notice Box */
.contract-badge-box {
  background: #fdfaf2;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: #78350f;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Form Controls */
.form-group {
  margin-bottom: 15px;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-label .req {
  color: #ef4444;
  margin-left: 3px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 13px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-main);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Product Selection Cards */
.product-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card.has-qty {
  border-color: var(--accent-gold);
  background: rgba(197, 160, 89, 0.03);
}

.product-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.product-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent-gold-hover);
  margin-bottom: 4px;
}

.product-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.4;
}

.product-spec {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.product-desc {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}

/* Price Details */
.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

.price-tags {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.retail-price {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: line-through;
}

.supply-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-rose);
  background: var(--accent-rose-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.supply-price {
  font-size: 17px;
  font-weight: 900;
  color: var(--primary);
}

/* Quantity Control */
.qty-controller {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.qty-btn {
  width: 34px;
  height: 34px;
  background: #f9fafb;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: #e5e7eb;
}

.qty-input {
  width: 44px;
  height: 34px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}
.qty-input:focus {
  outline: none;
}

/* Quick Set Buttons */
.quick-set-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.quick-set-btn {
  padding: 7px 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-set-btn:hover {
  background: #e5e7eb;
}

/* Order Summary Box */
.order-summary-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 10px;
  box-shadow: var(--shadow-md);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: #94a3b8;
}

.summary-row.total-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 15px;
  color: #ffffff;
}

.total-amount {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent-gold);
}

.margin-highlight {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #c5a059 0%, #b08d48 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #b08d48 0%, #9a7837 100%);
  transform: translateY(-1px);
}

/* ==========================================================================
   ADMIN DASHBOARD STYLES
   ========================================================================== */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

.admin-title-box h1 {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-title-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f9fafb;
}

.btn-gold {
  background: var(--accent-gold);
  color: #ffffff;
  border: none;
}
.btn-gold:hover {
  background: var(--accent-gold-hover);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

/* Product Inventory Widgets */
.prod-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.prod-stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.prod-stat-box .pname { font-size: 12.5px; font-weight: 700; color: #334155; }
.prod-stat-box .pqty { font-size: 17px; font-weight: 900; color: var(--accent-gold-hover); }

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
  background: #ffffff;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.search-box {
  flex: 1;
  min-width: 220px;
}

.filter-select {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #ffffff;
  color: var(--text-main);
  min-width: 140px;
}

/* Table */
.table-responsive {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 800;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}

.badge-pending { background: var(--status-pending-bg); color: var(--status-pending); }
.badge-preparing { background: var(--status-preparing-bg); color: var(--status-preparing); }
.badge-shipping { background: var(--status-shipping-bg); color: var(--status-shipping); }
.badge-delivered { background: var(--status-delivered-bg); color: var(--status-delivered); }
.badge-unpaid { background: var(--status-unpaid-bg); color: var(--status-unpaid); }
.badge-paid { background: var(--status-paid-bg); color: var(--status-paid); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f9fafb;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}
