/* Plaza Pickup — warehouse manager tool */
:root {
  --blue-primary: #1d4ed8;
  --blue-dark: #1e3a8a;
  --blue-light: #dbeafe;
  --green: #16a34a;
  --green-light: #dcfce7;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--blue-dark);
  color: var(--white);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  box-shadow: var(--shadow-md);
}

.header-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-manager {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  min-height: 44px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.2;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--blue-primary); color: var(--white); }
.btn-primary:hover { opacity: 0.9; }
.btn-green { background: var(--green); color: var(--white); font-size: 1.1rem; padding: 0.75rem 1.5rem; min-height: 52px; }
.btn-green:hover { opacity: 0.9; }
.btn-amber { background: var(--amber); color: var(--white); font-size: 1.1rem; padding: 0.75rem 1.5rem; min-height: 52px; }
.btn-amber:hover { opacity: 0.9; }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.4rem 0.9rem;
  min-height: 36px;
  font-size: 0.875rem;
  font-weight: 500;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 0.35rem 0.8rem; min-height: 36px; font-size: 0.875rem; }
.btn-back { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-200); }
.btn-back:hover { background: var(--gray-200); }

/* Main layout */
.main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem; }

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 1rem;
}

.auth-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  display: block;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--blue-dark);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--gray-800);
  text-align: center;
}

/* Forms */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.35rem; }
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--blue-primary); box-shadow: 0 0 0 3px rgba(29,78,216,0.1); }
.form-input.input-code { font-size: 1.5rem; letter-spacing: 0.2em; text-align: center; font-weight: 700; }
.form-input[type="email"] { text-transform: lowercase; }

textarea.form-input { min-height: 100px; resize: vertical; }

.form-btn-full { width: 100%; }

/* Alert / Flash */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #86efac; }
.alert-warning { background: var(--amber-light); color: var(--amber); border: 1px solid #fcd34d; }
.alert-info { background: var(--blue-light); color: var(--blue-primary); border: 1px solid #93c5fd; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-link { text-decoration: none; color: inherit; display: block; }

.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--blue-dark); }
.card-subtitle { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.2rem; }
.card-meta { font-size: 0.85rem; color: var(--gray-600); margin-top: 0.5rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-blue { background: var(--blue-light); color: var(--blue-primary); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-red { background: var(--red-light); color: var(--red); }

/* Section headings */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-divider {
  border: none;
  border-top: 1.5px solid var(--gray-200);
  margin: 1.5rem 0;
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.search-bar .form-input { flex: 1; }

/* Details / summary (collapsible) */
details.collapsible {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
details.collapsible > summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-800);
}
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::before {
  content: "▶";
  font-size: 0.7rem;
  transition: transform 0.2s;
  color: var(--gray-400);
}
details.collapsible[open] > summary::before { transform: rotate(90deg); }
details.collapsible .details-content { padding: 0 1.25rem 1.25rem; }

/* Order detail */
.order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.order-id { font-size: 1.5rem; font-weight: 800; color: var(--blue-dark); }
.order-ref { font-size: 0.95rem; color: var(--gray-600); margin-top: 0.25rem; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.info-item {}
.info-label { font-size: 0.78rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.info-value { font-size: 0.95rem; color: var(--gray-800); }

/* Product table */
.product-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.product-table th { text-align: left; padding: 0.5rem 0.75rem; font-size: 0.78rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; border-bottom: 1.5px solid var(--gray-200); }
.product-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.product-table tr:last-child td { border-bottom: none; }
.product-table .sku { font-family: monospace; font-size: 0.85rem; color: var(--gray-600); }
.product-table .num { text-align: right; }
.product-table .backorder-row td { color: var(--amber); font-weight: 600; }

/* Comments */
.comment {
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--gray-200);
}
.comment-meta { font-size: 0.78rem; color: var(--gray-400); margin-bottom: 0.3rem; }
.comment-body { font-size: 0.9rem; white-space: pre-wrap; }

/* Receive section */
.receive-section {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.receive-section.receive-green { border-color: var(--green); }
.receive-section.receive-amber { border-color: var(--amber); }
.receive-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.receive-green .receive-title { color: var(--green); }
.receive-amber .receive-title { color: var(--amber); }

/* Already received box */
.received-box {
  background: var(--green-light);
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.received-box .received-label { font-weight: 700; color: var(--green); margin-bottom: 0.3rem; }
.received-box .received-meta { font-size: 0.9rem; color: var(--gray-600); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Language switcher */
.lang-switcher { display: flex; gap: 0.25rem; }
.lang-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  transition: background 0.15s, color 0.15s;
}
.lang-btn:hover, .lang-btn.active { background: rgba(255,255,255,0.15); color: var(--white); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-400); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 640px) {
  .header { padding: 0 1rem; }
  .header-title { font-size: 1rem; }
  .main { padding: 1rem 0.75rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}
