/* ============================================================
   Cakes in the Bay — Label Manager Styles
   Brand primary: #b5294e  accent-light: #f5d5de  text: #2d1a1a
   ============================================================ */

:root {
  --citb-primary:  #b5294e;
  --citb-dark:     #8a1e3a;
  --citb-light:    #f5d5de;
  --citb-bg:       #fdf7f9;
  --citb-text:     #2d1a1a;
}

body {
  background: var(--citb-bg);
  color: var(--citb-text);
}

/* ---- Navbar ---- */
.citb-nav {
  background: var(--citb-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.citb-nav .nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}

.citb-nav .nav-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.citb-nav .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.citb-nav .nav-link:hover,
.citb-nav .nav-link.active {
  background: rgba(255,255,255,0.18);
  color: #fff !important;
}

.nav-print {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
}
.nav-print:hover, .nav-print.active {
  background: rgba(255,255,255,0.25) !important;
}

/* ---- Buttons ---- */
.btn-citb {
  background: var(--citb-primary);
  color: #fff;
  border: none;
}
.btn-citb:hover, .btn-citb:focus {
  background: var(--citb-dark);
  color: #fff;
}

/* ---- Page headings ---- */
.page-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--citb-primary);
  margin-bottom: 0;
}

/* ---- Dashboard stat cards ---- */
.stat-card {
  background: #fff;
  border: 1px solid #f0e0e6;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(181,41,78,0.15); }

.stat-icon {
  font-size: 2.2rem;
  color: var(--citb-primary);
  margin-bottom: 0.5rem;
}
.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--citb-primary);
  line-height: 1;
}
.stat-label {
  color: #666;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}
.stat-link {
  color: var(--citb-primary);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-decoration: none;
}
.stat-link:hover { text-decoration: underline; }

.action-card { cursor: default; }

/* ---- Cards ---- */
.card-header.citb-card-header {
  background: var(--citb-primary);
  color: #fff;
  border-bottom: none;
}
.border-citb { border-color: var(--citb-primary) !important; }

/* ---- Help list ---- */
.help-list {
  padding-left: 1.2rem;
}
.help-list li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ---- Ingredient picker ---- */
.ing-picker-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}

.ing-picker-item {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
}
.ing-picker-item:last-child { border-bottom: none; }
.ing-picker-item:hover { background: var(--citb-light); }
.ing-picker-item.is-allergen { color: #c0392b; }

.allergen-badge {
  font-size: 0.65rem;
  background: #fce8e8;
  color: #c0392b;
  border: 1px solid #f5c6cb;
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ---- Sorted ingredient list (cake editor) ---- */
.sorted-list {
  min-height: 48px;
}

.sorted-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  border-radius: 4px;
  margin-bottom: 3px;
  font-size: 0.875rem;
  cursor: default;
  user-select: none;
}
.sorted-item:last-child { border-bottom: none; }

.drag-handle {
  color: #aaa;
  cursor: grab;
  font-size: 1rem;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

.ing-label { flex: 1; }

/* ---- Label preview (in cake editor) ---- */
.label-preview .label-box {
  width: 102mm;
  min-height: 152mm;
  background: #fff;
  border: 1px solid #ccc;
  padding: 5mm 5mm 5mm 4mm;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.label-box .lb-inner {
  display: flex;
  gap: 3.5mm;
}

.label-box .lb-logo {
  flex-shrink: 0;
  width: 23mm;
  display: flex;
  align-items: flex-start;
  padding-top: 1mm;
}

.label-box .lb-logo img {
  width: 22mm;
  height: 22mm;
  border-radius: 50%;
  object-fit: cover;
  border: 0.4mm solid #555;
}

.label-box .lb-content {
  flex: 1;
  min-width: 0;
}

.label-box .lb-name {
  font-size: 9.5pt;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 1.5mm;
  line-height: 1.2;
}

.label-box .lb-ingredients {
  font-size: 7pt;
  line-height: 1.28;
  word-break: break-word;
}

.label-box .lb-may-contain {
  font-size: 6.5pt;
  font-style: italic;
  margin-top: 1.5mm;
}

.label-box .lb-allergens {
  font-size: 7.5pt;
  font-weight: bold;
  margin-top: 2mm;
  padding-top: 1.5mm;
  border-top: 0.3mm solid #333;
}

/* ---- Print page: cake row highlight ---- */
.cake-row.selected { background: var(--citb-light); }

/* ---- Builder ---- */
.builder-base-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.builder-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid #e5d2d9;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  min-height: 96px;
}

.builder-choice-card:has(input:checked) {
  border-color: var(--citb-primary);
  background: #fff3f6;
  box-shadow: 0 0 0 2px rgba(181,41,78,0.08);
}

.builder-base-radio {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

.builder-choice-title {
  font-weight: 700;
  color: var(--citb-primary);
}

.builder-choice-meta {
  font-size: 0.78rem;
  color: #666;
}

.builder-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
}

.builder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #e1d0d7;
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.builder-chip:has(input:checked) {
  border-color: var(--citb-primary);
  background: #fff0f4;
  color: var(--citb-primary);
  font-weight: 600;
}

.builder-chip input {
  margin: 0;
}

.builder-bowl {
  background: radial-gradient(circle at top, #fff6f9, #f2d8e1);
  border: 1px solid #ead6dd;
  border-radius: 24px 24px 42px 42px;
  min-height: 180px;
  padding: 1rem;
}

.builder-bowl-inner {
  border: 2px dashed rgba(181,41,78,0.25);
  border-radius: 18px 18px 34px 34px;
  min-height: 146px;
  padding: 1rem;
  text-align: center;
}

.builder-bowl-title {
  font-weight: 700;
  color: var(--citb-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin-bottom: 0.75rem;
}

.builder-bowl-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.builder-bowl-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.bowl-base {
  background: #b5294e;
  color: #fff;
}

.bowl-flavour {
  background: #fff;
  color: var(--citb-primary);
  border: 1px solid #e5c6d0;
}

.bowl-extra {
  background: #f4f4f4;
  color: #555;
  border: 1px solid #ddd;
}
