/* Wardrobe Wrapped — the one production stylesheet. The component gallery
   (/app/gallery.html) imports this file, so it cannot drift from what ships.

   Visual language: "Candy Sorted" (designs/project/) — warm white page,
   white cards, plum-cast ink, three candy accents (pink primary, blue
   secondary, yellow highlight), pills for anything tappable, soft ambient
   shadows plus the hard "candy" shadow under solid buttons. Light-first:
   the design system ships no dark theme, so neither do we. */

/* ---- Tokens (designs/project/tokens/) ---------------------------------- */
:root {
  /* Candy brights */
  --candy-pink: #FF4D8D;
  --candy-pink-deep: #D63A73;
  --candy-pink-tint: #FFE9F1;
  --candy-blue: #4DA3FF;
  --candy-blue-deep: #2F7FD6;
  --candy-blue-tint: #E9F3FF;
  --candy-yellow: #FFC53D;
  --candy-yellow-deep: #D9A125;
  --candy-yellow-tint: #FFF4D6;
  --candy-mint: #3ECF8E;
  --candy-mint-deep: #2BA36E;
  --candy-mint-tint: #E4F8EE;
  --candy-red: #E8443A;
  --candy-red-deep: #B8362E;
  --candy-red-tint: #FDE7E5;

  /* Neutrals (warm, plum-cast — never pure black or gray) */
  --ink-900: #2B2230;
  --ink-700: #4A3D52;
  --ink-500: #6E5F76;
  --ink-300: #A99BAF;
  --ink-200: #D8CDDC;
  --cream-050: #FFF9F5;
  --cream-100: #FFF2EC;
  --white: #FFFFFF;

  /* Semantic */
  --surface-page: var(--cream-050);
  --surface-card: var(--white);
  --surface-sunken: var(--cream-100);
  --surface-inverse: var(--ink-900);
  --text-heading: var(--ink-900);
  --text-body: var(--ink-700);
  --text-muted: var(--ink-500);
  --border-soft: #F0E4E8;
  --focus-ring: 0 0 0 3px var(--candy-blue-tint), 0 0 0 5px var(--candy-blue);

  /* Type — one family, weight does the talking */
  --font-sans: "Gabarito", "Avenir Next", "Nunito Sans", system-ui, sans-serif;
  --tracking-display: -0.02em;
  --tracking-caps: 0.08em;

  /* Shape */
  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-tile: 14px;
  --radius-small: 10px;

  /* Shadows */
  --shadow-card: 0 2px 10px rgba(43, 34, 48, 0.06);
  --shadow-float: 0 8px 30px rgba(43, 34, 48, 0.14);
  --shadow-candy: 0 3px 0 var(--candy-pink-deep);
  --shadow-candy-ink: 0 3px 0 var(--ink-900);

  /* Motion — springy, quick */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-quick: 150ms;
  --duration-base: 250ms;

  --nav-h: 62px;

  /* Legacy aliases — a few inline styles and the gallery still reference
     the old names; they resolve into the new palette. */
  --bg: var(--surface-page);
  --surface: var(--surface-card);
  --surface-2: var(--surface-sunken);
  --text: var(--ink-900);
  --text-dim: var(--text-muted);
  --line: var(--border-soft);
  --accent: var(--candy-pink);
  --accent-ink: var(--white);
  --good: var(--candy-mint-deep);
  --bad: var(--candy-red);
  --radius: var(--radius-card);
  --shadow: var(--shadow-card);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.5 var(--font-sans);
  background: var(--surface-page);
  color: var(--text-body);
}

.app { max-width: 720px; margin: 0 auto; padding: 14px 20px calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); }
.boot { padding: 4rem 0; text-align: center; color: var(--text-muted); font-weight: 600; }

.icon { display: inline-block; vertical-align: -0.18em; flex: none; }

.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.topbar .brand { font-weight: 900; font-size: 19px; letter-spacing: var(--tracking-display); color: var(--text-heading); }
.brand-hero { font-weight: 900; font-size: 28px; letter-spacing: var(--tracking-display); color: var(--text-heading); line-height: 1.1; margin-bottom: 6px; }

h1 { font-size: 26px; font-weight: 900; letter-spacing: var(--tracking-display); color: var(--text-heading); margin: .5rem 0 1rem; }
h2 { font-size: 17px; font-weight: 800; letter-spacing: var(--tracking-display); color: var(--text-heading); margin: 1.5rem 0 .6rem; }
a { color: var(--candy-pink); font-weight: 700; }
strong { color: var(--text-heading); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-small); }

/* ---- Nav — pill tab bar fixed at the bottom ---------------------------- */
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: flex; justify-content: center; gap: 4px;
  background: var(--surface-card); border-top: 1px solid var(--border-soft);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
}
.nav button {
  flex: 1; max-width: 132px; min-height: 50px;
  background: none; border: 0; color: var(--ink-300); cursor: pointer;
  font-family: var(--font-sans); font-size: 10px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.nav button .ico {
  width: 40px; height: 26px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-quick);
}
.nav button.active { color: var(--candy-pink); font-weight: 800; }
.nav button.active .ico { background: var(--candy-pink-tint); }

/* ---- Cards & lists ------------------------------------------------------ */
.card {
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-card);
}
/* Tint cards — area fills use the pastel tints, never the saturated accent */
.card.pink   { background: var(--candy-pink-tint);   border-color: transparent; }
.card.blue   { background: var(--candy-blue-tint);   border-color: transparent; }
.card.yellow { background: var(--candy-yellow-tint); border-color: transparent; }
.card.mint   { background: var(--candy-mint-tint);   border-color: transparent; }
.card.danger { background: var(--candy-red-tint);    border-color: transparent; }
.card.ink    { background: var(--surface-inverse);   border-color: transparent; color: var(--cream-050); }
.card.ink h1, .card.ink h2, .card.ink strong { color: var(--cream-050); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-tile);
  padding: 10px 12px; box-shadow: var(--shadow-card);
  transition: transform var(--duration-quick) var(--ease-bounce), box-shadow var(--duration-quick);
}
.row.clickable { cursor: pointer; }
.row.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-float); }
.row.clickable:active { transform: translateY(0) scale(.99); }
.row.selected { border: 2px solid var(--candy-pink); background: var(--candy-pink-tint); padding: 9px 11px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; color: var(--text-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.voided .title, .row.voided .sub { text-decoration: line-through; opacity: .55; }

/* Photo/placeholder tiles — tint fills with a glyph, never gray boxes.
   Tints rotate pink → blue → yellow across a list (the signature move). */
.thumb {
  width: 46px; height: 46px; border-radius: var(--radius-small); flex: none;
  object-fit: cover; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.thumb.lg { width: 96px; height: 96px; border-radius: var(--radius-tile); }
.thumb.t-pink   { background: var(--candy-pink-tint);   color: var(--candy-pink-deep); }
.thumb.t-blue   { background: var(--candy-blue-tint);   color: var(--candy-blue-deep); }
.thumb.t-yellow { background: var(--candy-yellow-tint); color: var(--candy-yellow-deep); }

/* ---- Badges — tiny tint pills ------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
}
.badge.out { background: var(--candy-yellow-tint); color: var(--candy-yellow-deep); }
.badge.in { background: var(--candy-mint-tint); color: var(--candy-mint-deep); }
.badge.wash { background: var(--candy-blue-tint); color: var(--candy-blue-deep); }
.badge.src { background: var(--surface-sunken); color: var(--text-muted); font-weight: 600; }
.badge.retired { background: var(--ink-200); color: var(--ink-700); }

/* ---- Charts ------------------------------------------------------------- */
.chart { width: 100%; height: 64px; display: block; }
.chart .bar { fill: var(--candy-pink); }
.chart .bar.zero { fill: var(--ink-200); }
.chart .line { fill: none; stroke: var(--candy-pink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-caption { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: var(--tracking-caps); }

/* ---- Outfit chips -------------------------------------------------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-card); border: 1.5px solid var(--border-soft); border-radius: var(--radius-pill);
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-body);
  transition: all var(--duration-quick);
}
.chip:hover { border-color: var(--ink-200); }
.chip:active { transform: translateY(1px); }
.chip .n { color: var(--text-muted); font-weight: 400; }

/* ---- Progress bar -------------------------------------------------------- */
.progress { height: 8px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.progress > div { height: 100%; background: var(--candy-mint); border-radius: var(--radius-pill); }

/* ---- Print (labels) ------------------------------------------------------ */
@media print {
  .nav, .topbar, .btnbar, .toast, .actionbar { display: none !important; }
  body { background: #fff; color: #000; }
  .label-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8mm; }
  .label { border: 1px dashed #999; padding: 4mm; break-inside: avoid; text-align: center; }
}
.label-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.label { border: 1px dashed var(--ink-200); border-radius: 8px; padding: 10px; text-align: center; background: #fff; color: #000; }
.label svg { width: 100%; height: 44px; }
.label .nm { font-size: .75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label .code { font-size: .65rem; font-family: ui-monospace, monospace; }

/* ---- Stat tiles — candy stat cards, tints rotating across the grid ------ */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { border-radius: var(--radius-card); padding: 14px 16px; }
.tile:nth-child(4n+1) { background: var(--candy-pink-tint); }
.tile:nth-child(4n+2) { background: var(--candy-blue-tint); }
.tile:nth-child(4n+3) { background: var(--candy-yellow-tint); }
.tile:nth-child(4n+4) { background: var(--candy-mint-tint); }
.tile .v { font-size: 26px; font-weight: 900; letter-spacing: var(--tracking-display); line-height: 1.15; }
.tile:nth-child(4n+1) .v { color: var(--candy-pink-deep); }
.tile:nth-child(4n+2) .v { color: var(--candy-blue-deep); }
.tile:nth-child(4n+3) .v { color: var(--candy-yellow-deep); }
.tile:nth-child(4n+4) .v { color: var(--candy-mint-deep); }
.tile .l { font-size: 12px; font-weight: 700; color: var(--text-heading); margin-top: 2px; }
.tile .s { font-size: 11px; color: var(--text-muted); }

/* ---- Buttons — pills with the candy "gumdrop" shadow -------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-card); color: var(--ink-900);
  border: 2px solid var(--ink-900); border-radius: var(--radius-pill);
  padding: 0 20px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  min-height: 44px; white-space: nowrap;
  box-shadow: var(--shadow-candy-ink);
  transition: transform var(--duration-quick) var(--ease-bounce),
    box-shadow var(--duration-quick) var(--ease-bounce),
    filter var(--duration-quick), background var(--duration-quick);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink-900); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink-900); }
.btn.primary { background: var(--candy-pink); color: var(--white); border-color: transparent; box-shadow: var(--shadow-candy); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 4px 0 var(--candy-pink-deep); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--candy-pink-deep); filter: none; }
.btn.danger { background: var(--candy-red); color: var(--white); border-color: transparent; box-shadow: 0 3px 0 var(--candy-red-deep); }
.btn.danger:hover { filter: brightness(1.06); box-shadow: 0 4px 0 var(--candy-red-deep); }
.btn.danger:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--candy-red-deep); }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 13px; }
.btn.big { width: 100%; min-height: 52px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btnbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }

/* ---- Forms — pill inputs ------------------------------------------------- */
label.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
label.field > span { display: block; margin-bottom: 5px; font-weight: 700; color: var(--text-heading); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 8px 18px; font: inherit; font-size: 15px;
  background: var(--surface-card); color: var(--text-heading);
  border: 1.5px solid var(--border-soft); border-radius: var(--radius-pill);
  transition: border-color var(--duration-quick), box-shadow var(--duration-quick);
}
textarea { border-radius: var(--radius-tile); }
input::placeholder { color: var(--ink-300); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-200); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--candy-blue);
  box-shadow: 0 0 0 3px var(--candy-blue-tint);
}
select { font-weight: 600; cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; }

.checkbox { width: 22px; height: 22px; min-height: 0; flex: none; padding: 0; accent-color: var(--candy-pink); }

/* ---- Toast — bottom-center pill that pops in with a bounce -------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 60;
  background: var(--surface-inverse); color: var(--cream-050);
  padding: 12px 20px; border-radius: var(--radius-pill); box-shadow: var(--shadow-float);
  display: flex; gap: 12px; align-items: center; max-width: 92vw;
  font-size: 14px; font-weight: 700;
  animation: toast-pop var(--duration-base) var(--ease-bounce);
}
.toast.success { background: var(--candy-mint); color: var(--white); }
.toast.error { background: var(--candy-red); color: var(--white); }
.toast button { background: none; border: 0; color: var(--candy-yellow); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
.toast.success button, .toast.error button { color: var(--white); text-decoration: underline; }
@keyframes toast-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---- Action bar (batch select) ----------------------------------------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--surface-card); border-top: 1px solid var(--border-soft);
  padding: 10px 14px; display: flex; gap: 8px; justify-content: center;
}
.actionbar .btn { flex: 1; max-width: 220px; }

/* ---- Overlay (scanner, dialogs) — ink scrim at 40% ---------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(43, 34, 48, .4);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.overlay .panel {
  background: var(--surface-card); border-radius: var(--radius-card); box-shadow: var(--shadow-float);
  padding: 22px; width: 100%; max-width: 440px;
  animation: panel-pop var(--duration-base) var(--ease-bounce);
}
.overlay video { width: 100%; border-radius: var(--radius-tile); background: var(--ink-900); }
@keyframes panel-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- Wrapped — the stats moment: one ink card, candy tints for the rest -- */
.wrapped-card {
  border-radius: var(--radius-card); padding: 24px 20px; margin-bottom: 12px;
  background: var(--surface-inverse); color: var(--cream-050);
}
.wrapped-card .k {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: var(--tracking-caps); color: var(--candy-pink);
}
.wrapped-card .big { font-size: 30px; font-weight: 900; letter-spacing: var(--tracking-display); line-height: 1.15; margin: 8px 0 6px; }
.wrapped-card .why { font-size: 13px; opacity: .75; }
.wrapped-card.pink   { background: var(--candy-pink-tint);   color: var(--text-heading); }
.wrapped-card.pink .k   { color: var(--candy-pink-deep); }
.wrapped-card.pink .why { color: var(--candy-pink-deep); opacity: 1; }
.wrapped-card.blue   { background: var(--candy-blue-tint);   color: var(--text-heading); }
.wrapped-card.blue .k   { color: var(--candy-blue-deep); }
.wrapped-card.blue .why { color: var(--candy-blue-deep); opacity: 1; }
.wrapped-card.yellow { background: var(--candy-yellow-tint); color: var(--text-heading); }
.wrapped-card.yellow .k   { color: var(--candy-yellow-deep); }
.wrapped-card.yellow .why { color: var(--candy-yellow-deep); opacity: 1; }
.wrapped-card.mint   { background: var(--candy-mint-tint);   color: var(--text-heading); }
.wrapped-card.mint .k   { color: var(--candy-mint-deep); }
.wrapped-card.mint .why { color: var(--candy-mint-deep); opacity: 1; }

/* ---- Misc --------------------------------------------------------------- */
.empty { text-align: center; color: var(--text-muted); font-weight: 600; padding: 2.6rem 1rem; }
.muted { color: var(--text-muted); }
.right { margin-left: auto; }
.center { text-align: center; }
.mt { margin-top: 14px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-soft); }
table.simple th { color: var(--text-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-caps); }
table.simple td { color: var(--text-body); }
table.simple td.num, table.simple th.num { text-align: right; }
code { font-family: ui-monospace, monospace; font-size: .85em; background: var(--surface-sunken); border-radius: 6px; padding: 1px 6px; }

.login-wrap { max-width: 360px; margin: 10vh auto 0; padding: 24px; }

/* ---- Calendar ------------------------------------------------------------ */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.cal-head { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-muted); padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1; border: 1px solid var(--border-soft); border-radius: var(--radius-small);
  background: var(--surface-card); color: var(--text-body); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform var(--duration-quick) var(--ease-bounce);
}
.cal-cell:active { transform: scale(.94); }
.cal-cell.empty { visibility: hidden; }
.cal-cell.has { background: var(--candy-pink-tint); border-color: transparent; color: var(--candy-pink-deep); font-weight: 700; }
.cal-cell .d { font-size: 13px; }
.cal-cell .dots { color: var(--candy-pink); font-size: 11px; line-height: .5; letter-spacing: 1px; }
