/* =========================================================================
   The 100's · Console — Design System v3
   Glassmorphism premium sobre fundo aurora quente + hero editorial.
   Paleta da marca (cream/gold/charcoal, Playfair + Aller).
   ========================================================================= */

:root {
  --cream:      #F6F1E9;
  --cream-2:    #EFE8DB;
  --cream-3:    #E7DECC;
  --paper:      #FFFFFF;
  --charcoal:   #2B2A28;
  --ink:        #1F1E1C;
  --gold:       #C9A96E;
  --gold-dark:  #A07D4A;
  --gold-light: #E0C992;
  --dark-brown: #5C3D2E;
  --warm-brown: #8B6F47;
  --muted:      #9A8B72;
  --sage:       #8FA98C;

  --green:  #3E8A66;  --green-bg: rgba(62,138,102,0.14);
  --amber:  #C08A3E;  --amber-bg: rgba(192,138,62,0.16);
  --rose:   #B25B4E;  --rose-bg: rgba(178,91,78,0.14);

  --line:    rgba(92,61,46,0.10);
  --line-2:  rgba(92,61,46,0.16);
  --hairline: rgba(92,61,46,0.07);

  /* Vidro */
  --glass:      rgba(255,255,255,0.46);
  --glass-2:    rgba(255,255,255,0.62);
  --glass-strong: rgba(255,255,255,0.74);
  --glass-brd:  rgba(255,255,255,0.7);
  --glass-blur: blur(26px) saturate(1.6);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,0.65), inset 0 -1px 0 rgba(92,61,46,0.04);

  /* Sombras warm suaves */
  --sh-sm: 0 1px 2px rgba(92,61,46,0.05), 0 2px 8px rgba(92,61,46,0.05);
  --sh:    0 8px 28px rgba(92,61,46,0.10);
  --sh-md: 0 18px 46px rgba(92,61,46,0.14);
  --sh-lg: 0 30px 80px rgba(92,61,46,0.22);
  --sh-gold: 0 10px 30px rgba(201,169,110,0.4);

  --r-xs: 10px; --r-sm: 14px; --r: 18px; --r-md: 22px; --r-lg: 28px; --r-xl: 34px; --r-pill: 980px;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --num: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;

  --sidebar: 256px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  overflow: hidden;
  /* Aurora mesh quente — gold / sage / cream */
  background:
    radial-gradient(820px 680px at 10% 12%, rgba(201,169,110,0.40), transparent 56%),
    radial-gradient(760px 620px at 92% 8%, rgba(143,169,140,0.30), transparent 55%),
    radial-gradient(1000px 820px at 84% 96%, rgba(224,201,146,0.42), transparent 58%),
    radial-gradient(720px 620px at 8% 98%, rgba(140,111,71,0.22), transparent 52%),
    linear-gradient(135deg, #F3EDE2, #EAE1D1);
  background-attachment: fixed;
  transition: background 0.5s var(--ease);
}

/* =========================================================================
   Dark glass theme (modo noturno)
   ========================================================================= */
[data-theme="dark"] {
  --cream:      #16140F;
  --cream-2:    #211E18;
  --cream-3:    #2A261F;
  --paper:      #1B1914;
  --charcoal:   #F2ECDF;
  --ink:        #FFFFFF;
  --gold:       #D4B57E;
  --gold-dark:  #E2CB95;
  --gold-light: #EBD9AE;
  --dark-brown: #C9B392;
  --warm-brown: #B5A484;
  --muted:      #8C7E68;
  --green: #5FB287; --green-bg: rgba(95,178,135,0.16);
  --amber: #D6A45A; --amber-bg: rgba(214,164,90,0.18);
  --rose:  #D17A6C; --rose-bg: rgba(209,122,108,0.18);
  --line:    rgba(255,255,255,0.09);
  --line-2:  rgba(255,255,255,0.16);
  --hairline: rgba(255,255,255,0.06);
  --glass:      rgba(38,35,29,0.55);
  --glass-2:    rgba(44,40,33,0.62);
  --glass-strong: rgba(58,52,43,0.82);
  --glass-brd:  rgba(255,255,255,0.10);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.2);
  --sh-sm: 0 1px 2px rgba(0,0,0,0.3);
  --sh:    0 8px 28px rgba(0,0,0,0.4);
  --sh-md: 0 18px 46px rgba(0,0,0,0.5);
  --sh-lg: 0 30px 80px rgba(0,0,0,0.6);
}
[data-theme="dark"] body {
  background:
    radial-gradient(820px 680px at 10% 12%, rgba(201,169,110,0.18), transparent 56%),
    radial-gradient(760px 620px at 92% 8%, rgba(143,169,140,0.12), transparent 55%),
    radial-gradient(1000px 820px at 84% 96%, rgba(201,169,110,0.16), transparent 58%),
    radial-gradient(720px 620px at 8% 98%, rgba(92,61,46,0.30), transparent 52%),
    linear-gradient(135deg, #15130E, #100E0B);
}
.serif { font-family: var(--serif); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-light); color: var(--ink); }

.content::-webkit-scrollbar, .drawer::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb, .drawer::-webkit-scrollbar-thumb { background: rgba(160,125,74,0.4); border: 3px solid transparent; background-clip: padding-box; border-radius: var(--r-pill); }

/* Helper de vidro */
.glass {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--sh), var(--glass-edge);
}

/* =========================================================================
   Shell
   ========================================================================= */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100dvh; padding: 16px 16px 16px 0; }

.sidebar {
  background: var(--glass);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  color: var(--charcoal);
  display: flex; flex-direction: column; padding: 24px 16px 18px;
  position: relative; z-index: 10; margin-left: 16px;
  border-radius: var(--r-xl); box-shadow: var(--sh-md), var(--glass-edge);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 4px 8px 24px; }
.brand .logo-img { height: 38px; width: auto; display: block; }
.brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark { display: block; }
.brand .brand-sub { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-dark); padding-left: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; position: relative; }
.nav .nlabel { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); padding: 14px 14px 8px; }
/* Indicador deslizante da sidebar */
.nav-ind { position: absolute; left: 0; right: 0; top: 0; height: 46px; background: var(--glass-strong); border: 1px solid var(--glass-brd); border-radius: var(--r-sm); box-shadow: var(--sh), var(--glass-edge); transition: transform 0.5s var(--spring), height 0.3s var(--ease); z-index: 0; opacity: 0; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px;
  color: var(--warm-brown); font-size: 14.5px; transition: color 0.28s var(--ease);
  text-align: left; width: 100%; border-radius: var(--r-sm); position: relative; z-index: 1;
}
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: 0.85; transition: transform 0.3s var(--spring), color 0.28s var(--ease); }
.nav-item:hover { color: var(--charcoal); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item.active { color: var(--charcoal); font-weight: 700; }
.nav-item.active svg { opacity: 1; color: var(--gold-dark); }
.nav-item .badge-count { margin-left: auto; background: var(--gold); color: var(--charcoal); font-size: 11px; font-weight: 700; padding: 2px 9px; min-width: 22px; text-align: center; border-radius: var(--r-pill); }

.side-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.pulse-pill { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--warm-brown); padding: 9px 14px; background: rgba(255,255,255,0.4); border-radius: var(--r-pill); }
.pulse-pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(62,138,102,0.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(62,138,102,0.5);} 70%{box-shadow:0 0 0 8px rgba(62,138,102,0);} 100%{box-shadow:0 0 0 0 rgba(62,138,102,0);} }

.main { display: flex; flex-direction: column; min-width: 0; height: calc(100dvh - 32px); margin-left: 16px; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 13px 16px 13px 24px; margin: 0 6px 14px;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd); border-radius: var(--r-pill); box-shadow: var(--sh), var(--glass-edge);
}
.topbar h1 { font-family: var(--serif); font-weight: 500; font-size: 23px; letter-spacing: -0.01em; }
.topbar .crumb { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-dark); font-weight: 700; }
.search-global { margin-left: auto; position: relative; width: min(320px, 34vw); }
.search-global input {
  width: 100%; background: rgba(255,255,255,0.55); border: 1px solid var(--glass-brd);
  padding: 11px 16px 11px 40px; border-radius: var(--r-pill); font-family: inherit; font-size: 14px;
  color: var(--charcoal); transition: all 0.25s var(--ease);
}
.search-global input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(201,169,110,0.18); }
.search-global svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.tb-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--warm-brown); position: relative; transition: all 0.25s var(--ease); background: rgba(255,255,255,0.55); border-radius: var(--r-pill); }
.tb-icon svg { width: 19px; height: 19px; }
.tb-icon:hover { color: var(--charcoal); background: #fff; transform: translateY(-1px); }
.tb-icon .dot-n { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }

.content { flex: 1; overflow-y: auto; padding: 2px 6px 60px; -webkit-overflow-scrolling: touch; }
.view { animation: viewIn 0.6s var(--ease) both; display: flex; flex-direction: column; gap: 18px; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px);} to {opacity:1; transform: none;} }

/* =========================================================================
   Hero editorial
   ========================================================================= */
.hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 26px; padding: 38px 40px; border-radius: var(--r-xl); overflow: hidden; }
.hero .eyebrow { color: var(--gold-dark); }
.hero-title { font-family: var(--serif); font-weight: 700; font-size: clamp(40px, 5.6vw, 74px); line-height: 0.98; letter-spacing: -0.025em; margin: 12px 0 18px; }
.hero-title em { font-style: normal; color: transparent; -webkit-text-stroke: 1.4px var(--gold-dark); background: linear-gradient(120deg, rgba(201,169,110,0.25), transparent); -webkit-background-clip: text; background-clip: text; }
.hero-sub { font-size: 16px; line-height: 1.6; color: var(--dark-brown); max-width: 56ch; opacity: 0.85; }
.hero-stats { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-stat { background: rgba(255,255,255,0.4); border: 1px solid var(--glass-brd); border-radius: var(--r-md); padding: 16px 20px; min-width: 180px; }
.hero-stat .hl { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--warm-brown); }
.hero-stat .hv { font-family: var(--num); font-size: 30px; font-weight: 700; margin-top: 5px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hero-stat .hd { font-size: 12.5px; margin-top: 4px; }
.hero-side { background: linear-gradient(165deg, rgba(43,42,40,0.92), rgba(33,31,28,0.92)); border-radius: var(--r-lg); padding: 22px; color: var(--cream); display: flex; flex-direction: column; box-shadow: var(--sh); }
.hero-side .hs-top { display: flex; align-items: center; justify-content: space-between; }
.hero-side .hs-lbl { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-light); }
.flow-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: auto; }
.flow-bars .fb { flex: 1; background: linear-gradient(180deg, var(--gold-light), rgba(201,169,110,0.35)); border-radius: 7px 7px 3px 3px; transition: height 0.9s var(--spring); }

/* =========================================================================
   Tipos comuns
   ========================================================================= */
.section-title { font-family: var(--num); font-size: 19px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark); font-weight: 700; }
.muted { color: var(--warm-brown); }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 18px; }

.card { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); padding: 24px; position: relative; border-radius: var(--r-md); }
.card.hover { transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); cursor: pointer; }
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--sh-md), var(--glass-edge); }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpi { background: var(--glass-2); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); padding: 22px; border-radius: var(--r-md); overflow: hidden; position: relative; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-md), var(--glass-edge); }
.kpi .kicon { width: 40px; height: 40px; border-radius: 13px; background: rgba(201,169,110,0.18); color: var(--gold-dark); display: grid; place-items: center; margin-bottom: 14px; }
.kpi .kicon svg { width: 20px; height: 20px; }
.kpi .klabel { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--warm-brown); }
.kpi .kval { font-family: var(--num); font-size: 31px; font-weight: 700; margin-top: 6px; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpi .kfoot { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; }
.kpi .delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); }
.kpi .delta.up { color: var(--green); background: var(--green-bg); }
.kpi .delta.down { color: var(--rose); background: var(--rose-bg); }
.kpi .delta svg, .delta svg, .hero-stat .delta svg { width: 13px; height: 13px; }
.hero-stat .delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.kpi .kspark { margin-top: 10px; }
/* KPI clicável (cross-filter Power BI) */
.kpi-btn { text-align: left; cursor: pointer; width: 100%; }
.kpi-btn .kpi-pick { position: absolute; top: 18px; right: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--gold-dark); opacity: 0; transform: translateX(-4px); transition: all 0.25s var(--ease); }
.kpi-btn:hover .kpi-pick, .kpi-btn.active .kpi-pick { opacity: 1; transform: none; }
.kpi-btn:hover { border-color: rgba(201,169,110,0.5); }
.kpi-btn.active { background: linear-gradient(160deg, rgba(201,169,110,0.22), var(--glass-2)); border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,169,110,0.3), var(--sh); }
.kpi-btn.active .kicon { background: var(--gold); color: var(--ink); }

/* Badges */
.badge { display: inline-flex; align-items: center; font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; padding: 5px 11px; white-space: nowrap; border-radius: var(--r-pill); }
.badge.paid, .badge.active { background: var(--green-bg); color: var(--green); }
.badge.pending, .badge.partial, .badge.draft { background: var(--amber-bg); color: var(--amber); }
.badge.refunded, .badge.archived { background: var(--rose-bg); color: var(--rose); }
.badge.fulfilled { background: var(--charcoal); color: var(--cream); }
.badge.unfulfilled { background: rgba(201,169,110,0.26); color: var(--gold-dark); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.shopify, .dot.online { background: var(--green); }
.dot.winmax4, .dot.store { background: var(--gold); }

.pill-toggle { display: inline-flex; background: rgba(255,255,255,0.5); padding: 4px; gap: 2px; border-radius: var(--r-pill); border: 1px solid var(--glass-brd); }
.pill-toggle button { padding: 8px 16px; font-size: 13px; color: var(--warm-brown); transition: all 0.25s var(--ease); border-radius: var(--r-pill); }
.pill-toggle button.active { background: var(--charcoal); color: var(--cream); font-weight: 700; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field { position: relative; flex: 1; min-width: 220px; }
.field input { width: 100%; background: var(--glass-2); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); padding: 13px 16px 13px 42px; font-family: inherit; font-size: 14.5px; border-radius: var(--r-pill); transition: all 0.25s var(--ease); }
.field input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(201,169,110,0.18); }
.field svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.chips { display: flex; gap: 9px; overflow-x: auto; padding: 2px; }
.chip { white-space: nowrap; border: 1px solid var(--glass-brd); background: var(--glass-2); color: var(--warm-brown); font-size: 13px; padding: 10px 17px; transition: all 0.25s var(--ease); border-radius: var(--r-pill); }
.chip:hover { color: var(--charcoal); transform: translateY(-1px); }
.chip.active { background: var(--charcoal); color: var(--cream); border-color: var(--charcoal); box-shadow: var(--sh); }

/* Listas */
.rows { display: flex; flex-direction: column; }
.lrow { display: grid; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); cursor: pointer; transition: background 0.22s var(--ease); position: relative; opacity: 0; transform: translateY(8px); animation: rise 0.5s var(--ease) forwards; }
.lrow:hover { background: rgba(255,255,255,0.45); }
@keyframes rise { to { opacity: 1; transform: none; } }
.list-card { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); overflow: hidden; border-radius: var(--r-md); }
.list-card .lrow:last-child { border-bottom: none; }
.list-head { display: grid; gap: 16px; padding: 15px 20px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.3); }
.list-head.orow, .list-head.crow { animation: none; opacity: 1; transform: none; }

.orow { grid-template-columns: 140px 1fr 168px 120px; grid-template-areas: "id cust badges total"; }
.orow .o-id { grid-area: id; } .orow .o-cust { grid-area: cust; min-width: 0; }
.orow .o-badges { grid-area: badges; display: flex; gap: 6px; flex-wrap: wrap; }
.orow .o-total { grid-area: total; text-align: right; }
.crow { grid-template-columns: 1fr 110px 150px 120px; grid-template-areas: "cust ord loc spent"; }
.crow .c-cust { grid-area: cust; min-width: 0; } .crow .c-ord { grid-area: ord; }
.crow .c-loc { grid-area: loc; } .crow .c-spent { grid-area: spent; text-align: right; }

.avatar { width: 40px; height: 40px; background: linear-gradient(150deg, rgba(255,255,255,0.7), var(--cream-3)); color: var(--gold-dark); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; border-radius: 13px; box-shadow: inset 0 0 0 1px rgba(201,169,110,0.4); }
.avatar.lg { width: 58px; height: 58px; font-size: 21px; border-radius: 18px; }
.thumb { width: 48px; height: 48px; background: var(--cream-2); object-fit: cover; flex: none; border-radius: var(--r-xs); }
.thumb.ph { display: grid; place-items: center; color: var(--gold-dark); font-family: var(--serif); }

/* Produtos */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.prod-card { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); overflow: hidden; cursor: pointer; transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease); border-radius: var(--r-md); }
.prod-card:hover { transform: translateY(-6px); box-shadow: var(--sh-md), var(--glass-edge); }
.prod-card .pimg { aspect-ratio: 4/3; background: radial-gradient(circle at 50% 36%, rgba(255,255,255,0.5), rgba(201,169,110,0.18)); display: grid; place-items: center; overflow: hidden; }
.prod-card .pimg img { width: 100%; height: 100%; object-fit: cover; }
.prod-card .pimg .glyph { font-family: var(--serif); font-size: 40px; color: var(--gold-dark); transition: transform 0.5s var(--spring); }
.prod-card:hover .pimg .glyph { transform: scale(1.12) rotate(4deg); }
.prod-card .pbody { padding: 16px 18px 18px; }
.prod-card .ptitle { font-size: 14.5px; font-weight: 700; line-height: 1.3; min-height: 38px; }
.prod-card .pvar { font-size: 12px; color: var(--warm-brown); margin-top: 4px; }
.prod-card .pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.prod-card .price { font-family: var(--num); font-size: 19px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stock { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
.stock.ok { background: var(--green-bg); color: var(--green); }
.stock.low { background: var(--amber-bg); color: var(--amber); }
.stock.out { background: var(--rose-bg); color: var(--rose); }

/* Charts */
.chart-card { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); padding: 24px 26px 20px; border-radius: var(--r-md); }
.chart-svg { width: 100%; display: block; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--warm-brown); }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 11px; height: 11px; border-radius: 4px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.bar-row:last-child { border-bottom: none; }
.bar-row .bt { font-size: 14px; font-weight: 700; }
.bar-row .bv { font-family: var(--serif); font-weight: 700; }
.bar-track { grid-column: 1 / -1; height: 7px; background: rgba(201,169,110,0.2); overflow: hidden; border-radius: var(--r-pill); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); width: 0; transition: width 1s var(--ease); border-radius: var(--r-pill); }

/* Supply chain */
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: var(--r-pill); }
.trend svg { width: 13px; height: 13px; }
.trend.up { color: var(--green); background: var(--green-bg); }
.trend.down { color: var(--rose); background: var(--rose-bg); }
.srow { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; border-bottom: 1px solid var(--hairline); cursor: pointer; transition: background 0.2s var(--ease); opacity: 0; transform: translateY(8px); animation: rise 0.5s var(--ease) forwards; }
.srow:hover { background: rgba(255,255,255,0.45); }
.list-card .srow:last-child { border-bottom: none; }
.s-main { flex: 1; min-width: 0; }
.s-rank { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--gold-dark); width: 22px; flex: none; text-align: center; }
.s-trend { flex: none; padding-top: 4px; }
.drow { display: grid; grid-template-columns: 1fr auto 72px; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.drow:last-child { border-bottom: none; }
.badge.weekday { background: var(--cream-2); color: var(--warm-brown); }
.badge.weekend { background: rgba(143,169,140,0.22); color: var(--green); }
.badge.holiday { background: var(--amber-bg); color: var(--amber); }
.badge.festival { background: rgba(201,169,110,0.26); color: var(--gold-dark); }
.season-row { padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.season-row:last-child { border-bottom: none; }

/* Supply — chooser */
.sup-choose { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.sup-card { text-align: left; background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); border-radius: var(--r-md); overflow: hidden; cursor: pointer; transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease); display: flex; flex-direction: column; }
.sup-card:hover { transform: translateY(-5px); box-shadow: var(--sh-md), var(--glass-edge); }
.sup-img { position: relative; aspect-ratio: 16/7; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.5), rgba(201,169,110,0.18)); overflow: hidden; }
.sup-img img { width: 100%; height: 100%; object-fit: cover; }
.sup-badge { position: absolute; bottom: -16px; right: 18px; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(160deg, var(--gold-light), var(--gold)); color: var(--ink); display: grid; place-items: center; box-shadow: var(--sh); border: 3px solid var(--paper); }
.sup-badge svg { width: 21px; height: 21px; }
.sup-body { padding: 20px; }
.sup-ttl { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.sup-go { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--gold-dark); }
.sup-head { aspect-ratio: 16/7; background: linear-gradient(150deg, rgba(201,169,110,0.30), rgba(143,169,140,0.18)); display: grid; place-items: center; }
.sup-ic { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(160deg, var(--gold-light), var(--gold)); color: var(--ink); display: grid; place-items: center; box-shadow: var(--sh); }
.sup-ic svg { width: 28px; height: 28px; }
.s-mono { width: 38px; height: 38px; flex: none; border-radius: 12px; background: linear-gradient(150deg, rgba(255,255,255,0.7), var(--cream-3)); color: var(--gold-dark); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 17px; box-shadow: inset 0 0 0 1px rgba(201,169,110,0.4); }
.s-mono.s-draw { background: linear-gradient(160deg, rgba(201,169,110,0.22), rgba(201,169,110,0.10)); }
.s-mono.s-draw svg { width: 22px; height: 22px; }

/* Pulse — Live banner (Live · Today) */
.live-banner { background: linear-gradient(160deg, #322F2B, #211F1C); color: var(--cream); border-radius: var(--r-lg); padding: 26px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: var(--sh-md); }
.live-banner .hs-lbl { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-light); }
.live-banner .total { font-family: var(--num); font-size: 54px; font-weight: 800; line-height: 1; margin: 8px 0; color: var(--cream); transition: color 0.6s; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.live-banner .total.flash { color: var(--gold-light); }
.lb-sub { color: rgba(246,241,233,0.78); font-size: 14px; }
.lb-sub b { color: var(--cream); }
.lb-target { color: var(--gold-light); font-weight: 700; }
.lb-vs { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: rgba(246,241,233,0.72); }
.lb-vs .delta { font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 3px; }

/* Vendas por hora — valores (preferido ao gráfico) */
.hour-list { display: flex; flex-direction: column; }
.hour-row { display: grid; grid-template-columns: 46px 1fr 84px; grid-template-areas: "h bar val" "h sub sub"; gap: 3px 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.hour-row:last-child { border-bottom: none; }
.hour-row .hr-h { grid-area: h; font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--charcoal); }
.hour-row .bar-track { grid-area: bar; margin: 0; }
.hour-row .hr-val { grid-area: val; text-align: right; font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--charcoal); letter-spacing: -0.02em; }
.hour-row .hr-sub { grid-area: sub; font-size: 11.5px; color: var(--warm-brown); }
.hour-row.total { border-top: 2px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 13px; }
.hour-row.total .hr-h, .hour-row.total .hr-val { color: var(--gold-dark); }
.lb-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.lb-btn { background: linear-gradient(160deg, var(--gold-light), var(--gold)); color: var(--ink); padding: 13px 20px; box-shadow: var(--sh); }
.lb-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.pulse-intro { text-align: center; max-width: 640px; margin: 8px auto 0; }
.pulse-intro .hero-sub { max-width: 52ch; }

/* Supply — timeframe bar */
.sup-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.month-strip { display: flex; gap: 4px; background: var(--glass-2); border: 1px solid var(--glass-brd); padding: 4px; border-radius: var(--r-pill); overflow-x: auto; max-width: 100%; }
.month-strip button { padding: 7px 14px; font-size: 13px; color: var(--warm-brown); border-radius: var(--r-pill); transition: all 0.25s var(--ease); white-space: nowrap; }
.month-strip button.active { background: var(--charcoal); color: var(--cream); font-weight: 700; }
.tf-label svg { width: 16px; height: 16px; }
.kpi-row.pulse-kpis, .grid.pulse-kpis { gap: 16px; }

/* Live Flow chart (preenche em altura — maior no telemóvel) */
.flow-svg { width: 100%; height: 210px; display: block; }
.flow-x { display: flex; justify-content: space-between; padding: 6px 6px 0; font-size: 11px; color: var(--warm-brown); }
.daily-pill { display: inline-block; background: rgba(224,201,146,0.18); color: var(--gold-light); font-weight: 700; font-size: 13px; padding: 7px 15px; border-radius: var(--r-pill); }

/* Calendário (escolher mês/ano) */
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-years { display: inline-flex; gap: 2px; background: var(--cream-2); padding: 4px; border-radius: var(--r-pill); align-self: flex-start; }
.cal-yr { padding: 6px 16px; font-size: 13px; color: var(--warm-brown); border-radius: var(--r-pill); transition: all 0.25s var(--ease); }
.cal-yr.active { background: var(--charcoal); color: var(--cream); font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.cal-m { padding: 11px 0; font-size: 13px; font-weight: 600; color: var(--warm-brown); background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-sm); transition: all 0.22s var(--ease); }
.cal-m:hover { border-color: var(--gold); color: var(--charcoal); }
.cal-m.active { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--ink); border-color: transparent; font-weight: 700; box-shadow: var(--sh-sm); }
@media (max-width: 980px) { .cal-grid { grid-template-columns: repeat(4, 1fr); } }

/* Calendário premium recolhível (estilo Apple) */
.cal-card { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); border-radius: var(--r-lg); overflow: hidden; }
.cal-bar { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 18px; text-align: left; transition: background 0.2s var(--ease); }
.cal-bar:hover { background: rgba(255,255,255,0.35); }
.cal-bar-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: rgba(201,169,110,0.18); color: var(--gold-dark); }
.cal-bar-ic svg { width: 19px; height: 19px; }
.cal-bar-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-bar-lbl { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cal-bar-val { font-family: var(--serif); font-size: 16.5px; font-weight: 700; color: var(--charcoal); letter-spacing: -0.01em; }
.cal-chev { margin-left: auto; width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: var(--warm-brown); transition: transform 0.4s var(--spring); }
.cal-chev svg { width: 18px; height: 18px; }
.cal-card.open .cal-chev { transform: rotate(180deg); }
.cal-expand { padding: 2px 18px 16px; animation: calIn 0.4s var(--ease); }
@keyframes calIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.daycal { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 380px; margin: 0 auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--charcoal); }
.cal-nav { width: 36px; height: 36px; border-radius: 50%; background: var(--cream-2); color: var(--charcoal); font-size: 19px; line-height: 1; transition: all 0.2s var(--ease); }
.cal-nav:hover { background: var(--gold); color: var(--ink); }
.cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd span { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cd { height: 38px; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--charcoal); background: transparent; border: none; border-radius: 11px; transition: all 0.16s var(--ease); }
.cd.empty { background: transparent; }
.cd:hover { background: var(--cream-2); }
.cd.weekend { color: var(--green); }
.cd.holiday { color: var(--amber); font-weight: 700; }
.cd.festival { color: var(--gold-dark); font-weight: 700; }
/* Período A (dourado) */
.cd.a-in { background: rgba(201,169,110,0.18); }
.cd.a-edge { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--ink); font-weight: 700; }
/* Período B / comparação (charcoal, contorno) */
.cd.b-in { box-shadow: inset 0 0 0 1.5px rgba(43,42,40,0.35); }
.cd.b-edge { background: var(--charcoal); color: var(--cream); font-weight: 700; box-shadow: none; }
.cd.a-edge.weekend, .cd.a-edge.holiday, .cd.a-edge.festival { color: var(--ink); }
.cd.b-edge.weekend, .cd.b-edge.holiday, .cd.b-edge.festival { color: var(--cream); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; color: var(--warm-brown); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; }
.lg-dot.weekend { background: var(--green); }
.lg-dot.holiday { background: var(--amber); }
.lg-dot.festival { background: var(--gold); }

/* Lista de semanas (granularidade week) */
.cal-list { display: flex; flex-direction: column; gap: 6px; max-width: 380px; margin: 0 auto; }
.cal-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-sm); transition: all 0.18s var(--ease); position: relative; }
.cal-opt:hover { border-color: var(--gold); background: var(--paper); }
.cal-opt .co-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-opt .co-main b { font-size: 14px; font-weight: 700; color: var(--charcoal); letter-spacing: -0.01em; }
.cal-opt .co-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.cal-opt .co-val { margin-left: auto; font-family: var(--num); font-size: 13px; font-weight: 700; color: var(--warm-brown); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-opt .co-tag { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: 11px; font-weight: 800; color: var(--cream); }
.cal-opt .co-tag.a { background: var(--gold-dark); } .cal-opt .co-tag.b { background: var(--charcoal); }
.cal-opt.a-sel { border-color: var(--gold); background: linear-gradient(160deg, rgba(201,169,110,0.22), var(--cream)); box-shadow: 0 0 0 2px rgba(201,169,110,0.28); }
.cal-opt.b-sel { border-color: var(--charcoal); background: var(--cream-2); box-shadow: 0 0 0 2px rgba(43,42,40,0.18); }
.cal-opt.a-sel .co-val, .cal-opt.b-sel .co-val { color: var(--charcoal); }
/* Grelha de meses (granularidade month) */
.cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 380px; margin: 0 auto; }
.cal-mo { position: relative; padding: 16px 0; font-size: 14px; font-weight: 600; color: var(--charcoal); background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-sm); transition: all 0.18s var(--ease); }
.cal-mo:hover { border-color: var(--gold); background: var(--paper); }
.cal-mo .mo-tag { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; font-size: 10px; font-weight: 800; font-style: normal; color: var(--cream); }
.cal-mo .mo-tag.a { background: var(--gold-dark); } .cal-mo .mo-tag.b { background: var(--charcoal); }
.cal-mo.a-sel { border-color: transparent; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--ink); font-weight: 700; }
.cal-mo.b-sel { border-color: transparent; background: var(--charcoal); color: var(--cream); font-weight: 700; }

/* Controlos do calendário — granularidade + comparar */
.cal-controls { display: flex; align-items: center; gap: 10px; max-width: 380px; margin: 0 auto 6px; }
.cal-gran { display: inline-flex; background: var(--cream-2); padding: 3px; border-radius: var(--r-pill); gap: 2px; }
.cal-gran button { padding: 7px 14px; font-size: 12.5px; color: var(--warm-brown); border-radius: var(--r-pill); transition: all 0.22s var(--ease); }
.cal-gran button.active { background: var(--paper); color: var(--charcoal); font-weight: 700; box-shadow: var(--sh-sm); }
.cal-cmp-tog { margin-left: auto; padding: 7px 15px; font-size: 12.5px; font-weight: 700; color: var(--gold-dark); background: rgba(201,169,110,0.16); border-radius: var(--r-pill); transition: all 0.22s var(--ease); }
.cal-cmp-tog.active { background: var(--charcoal); color: var(--cream); }
/* Slots A/B */
.cal-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 380px; margin: 10px auto 0; }
.cal-slot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--warm-brown); background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-sm); text-align: left; transition: all 0.2s var(--ease); }
.cal-slot i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cal-slot.a i { background: var(--gold); }
.cal-slot.b i { background: var(--charcoal); }
.cal-slot.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,110,0.18); color: var(--charcoal); }

.cal-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 16px 14px; padding: 13px 16px; background: var(--cream-2); border-radius: var(--r-md); font-size: 13px; color: var(--warm-brown); }
.cal-summary b { color: var(--charcoal); }
/* Comparação A vs B */
.cal-compare { margin: 0 16px 14px; padding: 14px 16px; background: var(--cream-2); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 9px; }
.cc-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--charcoal); }
.cc-row b { font-weight: 700; }
.cc-tag { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: 11px; font-weight: 800; color: var(--cream); }
.cc-tag.a { background: var(--gold-dark); } .cc-tag.b { background: var(--charcoal); }
.cc-val { margin-left: auto; font-family: var(--num); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-delta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; padding-top: 9px; border-top: 1px solid var(--line); }

/* Supply — página de detalhe do item */
.item-hero { display: flex; align-items: center; gap: 18px; padding: 22px; background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-brd); box-shadow: var(--sh), var(--glass-edge); border-radius: var(--r-lg); }
.item-ic { width: 74px; height: 74px; flex: none; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; background: linear-gradient(150deg, rgba(255,255,255,0.7), var(--cream-3)); color: var(--gold-dark); font-family: var(--serif); font-weight: 700; font-size: 30px; box-shadow: inset 0 0 0 1px rgba(201,169,110,0.4); }
.item-ic img { width: 100%; height: 100%; object-fit: cover; }
.item-ic.s-draw { background: linear-gradient(160deg, rgba(201,169,110,0.22), rgba(201,169,110,0.10)); }
.item-ic.s-draw svg { width: 40px; height: 40px; }
.item-h-copy { min-width: 0; }
.item-title { font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 4px 0 6px; }
.item-trend { margin-left: auto; text-align: right; flex: none; }

/* Feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--hairline); align-items: center; border-radius: var(--r-sm); transition: background 0.2s; }
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: rgba(255,255,255,0.4); }
.feed-item .fi-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: rgba(201,169,110,0.18); color: var(--gold-dark); border-radius: 12px; }
.feed-item .fi-ic svg { width: 18px; height: 18px; }
.feed-item .ft { font-size: 14px; } .feed-item .ft b { font-weight: 700; }
.feed-item .fm { font-size: 12px; color: var(--warm-brown); margin-top: 2px; }
.feed-item .fa { margin-left: auto; font-family: var(--serif); font-weight: 700; white-space: nowrap; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(31,30,28,0.30); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity 0.45s var(--ease); z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(472px, 92vw); background: rgba(246,241,233,0.82); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); border: 1px solid var(--glass-brd); box-shadow: var(--sh-lg); z-index: 41; transform: translateX(calc(100% + 28px)); transition: transform 0.5s var(--ease); display: flex; flex-direction: column; overflow-y: auto; border-radius: var(--r-xl); }
.drawer.open { transform: none; }
.dhead { padding: 26px 28px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(246,241,233,0.7); backdrop-filter: blur(12px); z-index: 2; border-radius: var(--r-xl) var(--r-xl) 0 0; }
.dclose { position: absolute; top: 22px; right: 22px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--warm-brown); background: rgba(92,61,46,0.07); border-radius: var(--r-pill); transition: all 0.2s; }
.dclose svg { width: 18px; height: 18px; }
.dclose:hover { color: var(--charcoal); background: rgba(92,61,46,0.14); }
.dhead h2 { font-family: var(--serif); font-size: 27px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.dmeta { font-size: 13px; color: var(--warm-brown); margin-top: 9px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dbody { padding: 22px 28px 50px; display: flex; flex-direction: column; gap: 26px; }
.dsec .dst { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-dark); font-weight: 700; margin-bottom: 13px; }
.litem { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.litem:last-child { border-bottom: none; }
.litem .lt { font-size: 14px; font-weight: 700; }
.litem .lv { font-size: 12px; color: var(--warm-brown); margin-top: 3px; }
.litem .lp { font-family: var(--serif); font-weight: 700; white-space: nowrap; }
.totrow { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; color: var(--warm-brown); }
.totrow.grand { color: var(--charcoal); font-weight: 700; font-size: 21px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; font-family: var(--serif); }
.kv { font-size: 14px; line-height: 1.8; } .kv .k { color: var(--warm-brown); }
.tagrow { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; background: rgba(201,169,110,0.16); color: var(--gold-dark); padding: 5px 12px; border-radius: var(--r-pill); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 15px 20px; font-size: 14.5px; font-weight: 700; transition: all 0.3s var(--ease); border-radius: var(--r-pill); }
.btn.primary { background: var(--charcoal); color: var(--cream); box-shadow: var(--sh); }
.btn.primary:hover { background: var(--dark-brown); transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn.ghost { border: 1px solid var(--line-2); color: var(--charcoal); background: rgba(255,255,255,0.4); }
.btn.ghost:hover { border-color: var(--gold); background: rgba(255,255,255,0.7); }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.7; cursor: default; transform: none; }

.empty { text-align: center; color: var(--warm-brown); padding: 60px 20px; }
.empty .glyph { font-family: var(--serif); font-size: 42px; color: var(--gold); opacity: 0.5; }
.skeleton { background: linear-gradient(90deg, var(--cream-2) 25%, var(--cream-3) 37%, var(--cream-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes sk { 0%{background-position:100% 0;} 100%{background-position:-100% 0;} }
.demo-flag { font-size: 11px; color: var(--warm-brown); text-align: center; padding: 18px 0 0; opacity: 0.7; }

/* Pulse */
.pulse-hero { text-align: center; padding: 22px 0 30px; }
.pulse-hero .total { font-family: var(--serif); font-size: 74px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; transition: color 0.6s; }
.pulse-hero .total.flash { color: var(--gold-dark); }

.tabbar { display: none; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; padding: 0; }
  .sidebar { display: none; }
  .main { margin-left: 0; height: 100dvh; padding-top: env(safe-area-inset-top); }
  .topbar { margin: 10px 14px; position: sticky; top: 0; z-index: 20; }
  .sup-choose { grid-template-columns: 1fr; }
  .flow-svg { height: 250px; }
  .live-banner { flex-direction: column; align-items: flex-start; padding: 22px; }
  .live-banner .total { font-size: 46px; }
  .lb-actions { align-items: stretch; width: 100%; }
  .lb-btn { width: 100%; }
  /* Supply timeframe bar: barra organizada, month strip em linha própria */
  .sup-bar { gap: 10px; }
  .tf-label { display: none !important; }
  .sup-bar [data-supply-back] { order: 1; }
  #sup-cmp { order: 2; margin-left: auto !important; }
  .month-strip { order: 3; flex: 1 0 100%; width: 100%; }
  .pulse-kpis { grid-template-columns: 1fr 1fr !important; }
  .topbar h1 { font-size: 20px; }
  .search-global { display: none; }
  .content { padding: 4px 14px 100px; }
  .hero { grid-template-columns: 1fr; padding: 28px 22px; gap: 20px; text-align: center; }
  .hero-side { order: -1; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-stats { justify-content: center; }
  .hero-stat { text-align: center; flex: 1; min-width: 0; }
  .pulse-cta { justify-content: center; }
  .flow-bars { height: 90px; }
  /* KPIs centrados no telemóvel — 2 colunas (bate inline repeat(3|4)) */
  .kpi-row { grid-template-columns: 1fr 1fr !important; gap: 12px; }
  .kpi { text-align: center; }
  .kpi .kval { font-size: 26px; }
  .kpi .kicon { margin-left: auto; margin-right: auto; }
  .kpi .kfoot, .kpi .kspark svg { justify-content: center; }
  .kpi .kfoot { justify-content: center; }
  /* Títulos de secção centrados */
  .chart-card .eyebrow, .chart-card .section-title, .card > .eyebrow { text-align: center; }
  .chart-card .spread { flex-direction: column; gap: 4px; text-align: center; }

  .content .grid[style*="1.6fr"], .content .grid[style*="1fr 1fr"], .content .grid[style*="1.3fr"], .content .grid[style*="1.4fr"] { grid-template-columns: 1fr !important; }
  .toolbar { gap: 10px; }
  .list-head { display: none; }
  .lrow { padding: 16px; }
  .orow { grid-template-columns: 1fr auto; grid-template-areas: "id total" "cust cust" "badges badges"; gap: 8px 12px; }
  .orow .o-total { align-self: start; font-size: 17px; }
  .crow { grid-template-columns: 1fr auto; grid-template-areas: "cust spent" "loc loc"; gap: 6px 12px; }
  .crow .c-ord { display: none; }
  .crow .c-spent { align-self: start; }

  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(100%); }
  .drawer.open { transform: none; }
  /* Empurrar o cabeçalho e o botão de fechar para baixo da barra de estado (notch) */
  .dhead { border-radius: var(--r-xl) var(--r-xl) 0 0; padding-top: calc(20px + env(safe-area-inset-top)); }
  .dclose { top: calc(16px + env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; background: rgba(92,61,46,0.12); }
  .dclose svg { width: 22px; height: 22px; }

  .tabbar { display: flex; position: fixed; bottom: 14px; left: 16px; right: 16px; z-index: 30; background: rgba(38,36,33,0.9); backdrop-filter: blur(24px) saturate(1.6); padding: 14px 6px calc(12px + env(safe-area-inset-bottom)); justify-content: space-around; border-radius: var(--r-lg); box-shadow: var(--sh-lg); border: 1px solid rgba(255,255,255,0.12); overflow: visible; }
  /* Magic nav: bolha dourada deslizante */
  .tab-ind { display: block; position: absolute; top: -26px; left: -29px; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(160deg, var(--gold-light), var(--gold)); box-shadow: 0 10px 24px rgba(201,169,110,0.55), inset 0 1px 0 rgba(255,255,255,0.6); border: 5px solid rgba(38,36,33,0.9); transition: transform 0.55s var(--spring); z-index: 0; pointer-events: none; }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 4px; color: rgba(246,241,233,0.55); font-size: 10px; padding: 4px 10px; flex: 1; transition: color 0.3s var(--ease); border-radius: var(--r-sm); position: relative; z-index: 1; }
  .tab svg { width: 23px; height: 23px; transition: transform 0.5s var(--spring), color 0.3s var(--ease); }
  .tab.active { color: var(--gold-light); }
  .tab.active svg { color: var(--ink); transform: translateY(-33px); }
  .tab.active span { transform: translateY(-2px); transition: transform 0.4s var(--spring); }
}

/* Motif (line-art do ícone) quando não há foto */
.prod-motif { display: grid; place-items: center; color: var(--gold-dark); }
.prod-motif svg { width: 64px; height: 64px; opacity: 0.85; }
.prod-motif.lg svg { width: 110px; height: 110px; }

/* Galeria de produto (detalhe) */
.pgal { display: flex; flex-direction: column; gap: 10px; }
.pgal-main { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.pgal-main img { width: 100%; height: 100%; object-fit: contain; }
.pgal-price { position: absolute; top: 12px; left: 12px; z-index: 2; background: var(--charcoal); color: var(--cream); font-family: var(--num); font-weight: 700; font-size: 15px; padding: 7px 13px; border-radius: var(--r-pill); box-shadow: var(--sh); }
.pgal-thumbs { display: flex; gap: 8px; }
.pgthumb { width: 60px; height: 60px; flex: none; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); padding: 0; transition: all 0.2s var(--ease); }
.pgthumb img { width: 100%; height: 100%; object-fit: cover; }
.pgthumb.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,169,110,0.4); }
.bom-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.bom-row:last-of-type { border-bottom: none; }
.bom-row b { font-size: 14px; color: var(--charcoal); }
.bom-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgba(201,169,110,0.18); color: var(--gold-dark); }
.bom-ic svg { width: 18px; height: 18px; }

/* Loading do catálogo */
.prod-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 20px; color: var(--warm-brown); text-align: center; }
.prod-loading svg { width: 34px; height: 34px; color: var(--gold-dark); opacity: 0.7; }
.prod-loading p { font-size: 15px; font-weight: 600; color: var(--charcoal); }
.prod-loading .spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--cream-3); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Estado da ligação WinMax4 */
.wm-status { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 12.5px; color: var(--warm-brown); background: var(--cream-2); border: 1px solid var(--line); padding: 7px 14px; border-radius: var(--r-pill); }
.wm-status svg { width: 14px; height: 14px; color: var(--muted); }
.wm-status b { color: var(--charcoal); }
.wm-status.ok { color: var(--green); background: var(--green-bg); border-color: transparent; }
.wm-status.ok svg { color: var(--green); }
.wm-status.ok b { color: var(--green); }

/* =========================================================================
   Access gate (PIN lock screen)
   ========================================================================= */
#gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(720px 600px at 12% 10%, rgba(201,169,110,0.40), transparent 56%),
    radial-gradient(760px 620px at 90% 6%, rgba(143,169,140,0.26), transparent 55%),
    radial-gradient(900px 740px at 86% 98%, rgba(224,201,146,0.42), transparent 58%),
    linear-gradient(135deg, #F3EDE2, #EAE1D1);
  animation: gateIn 0.4s var(--ease); }
#gate.out { opacity: 0; transform: scale(1.02); transition: opacity 0.38s var(--ease), transform 0.38s var(--ease); pointer-events: none; }
@keyframes gateIn { from { opacity: 0; } to { opacity: 1; } }
.gate-card { width: min(360px, 92vw); text-align: center; display: flex; flex-direction: column; align-items: center; }
.gate-card.shake { animation: gshake 0.45s var(--ease); }
@keyframes gshake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }
.gate-logo { height: 46px; width: auto; }
.gate-sub { font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-dark); font-weight: 700; margin-top: 14px; }
.gate-title { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--charcoal); margin-top: 6px; }
.gate-dots { display: flex; gap: 16px; margin: 26px 0 30px; }
.gate-dots .gd { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(160,125,74,0.45); transition: all 0.2s var(--spring); }
.gate-dots .gd.on { background: linear-gradient(160deg, var(--gold-light), var(--gold)); border-color: transparent; transform: scale(1.12); box-shadow: 0 4px 12px rgba(201,169,110,0.45); }
.gate-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gate-pad .gk { width: 74px; height: 74px; border-radius: 50%; font-family: var(--num); font-size: 28px; font-weight: 600; color: var(--charcoal);
  background: rgba(255,255,255,0.6); border: 1px solid var(--glass-brd); box-shadow: var(--sh-sm); transition: all 0.15s var(--ease); }
.gate-pad .gk:hover { background: #fff; }
.gate-pad .gk:active { transform: scale(0.93); background: var(--gold); color: var(--ink); }
.gate-pad .gk-del { font-size: 22px; color: var(--warm-brown); background: transparent; box-shadow: none; border-color: transparent; }
.gate-err { min-height: 20px; margin-top: 20px; font-size: 13px; font-weight: 600; color: var(--rose); }
.gate-foot { font-size: 12px; color: var(--warm-brown); opacity: 0.8; margin-top: 4px; }

/* =========================================================================
   Premium mobile polish — arredondado, minimalista, mais ar (estilo Apple)
   ========================================================================= */
@media (max-width: 980px) {
  .content { padding: 4px 12px 112px; }
  .view { gap: 14px; }
  .card, .chart-card, .list-card, .kpi, .cal-card, .item-hero, .prod-card, .sup-card { border-radius: 24px; }
  .card { padding: 20px; }
  .chart-card { padding: 20px 18px 16px; }
  .kpi { padding: 16px 14px 18px; box-shadow: var(--sh-sm), var(--glass-edge); }
  .kpi .kicon { width: 36px; height: 36px; border-radius: 12px; margin-bottom: 10px; }
  .kpi .kicon svg { width: 18px; height: 18px; }
  .kpi .klabel { font-size: 9.5px; letter-spacing: 0.1em; }
  .kpi .kval { margin-top: 5px; }
  .kpi .kfoot { margin-top: 9px; font-size: 11.5px; flex-wrap: wrap; }
  /* Comparação Week/Month/Year — pílula a toda a largura, bem distribuída */
  .sup-bar { gap: 8px; align-items: center; }
  .sup-bar [data-supply-back], .sup-bar [data-item-back] { order: 1; }
  #sup-cmp, #item-cmp { order: 2; width: 100%; margin-left: 0 !important; justify-content: space-between; }
  #sup-cmp button, #item-cmp button { flex: 1; text-align: center; padding: 9px 6px; font-size: 12.5px; }
  /* Página de detalhe do item */
  .item-hero { flex-wrap: wrap; gap: 14px; padding: 18px; }
  .item-ic { width: 60px; height: 60px; font-size: 24px; }
  .item-h-copy { flex: 1; min-width: 0; }
  .item-trend { order: 3; margin-left: 0; width: 100%; text-align: left; }
  .cal-bar { padding: 14px 16px; }
  .cal-bar-val { font-size: 15px; }
  .cal-summary { font-size: 12.5px; margin: 0 14px 13px; padding: 12px 14px; }
  .section-title { font-size: 18px; }
}

@media (max-width: 520px) {
  .kpi-row { grid-template-columns: 1fr 1fr !important; }
  .pulse-hero .total { font-size: 56px; }
  .hero-title { font-size: 44px; }
  .cd { font-size: 12.5px; }
}

/* --- Forecast · Reposição ------------------------------------------------ */
.fcrow { padding: 13px 20px; border-bottom: 1px solid var(--hairline); cursor: pointer; transition: background 0.2s var(--ease); opacity: 0; transform: translateY(8px); animation: rise 0.5s var(--ease) forwards; }
.fcrow:hover { background: rgba(255,255,255,0.45); }
.list-card .fcrow:last-child { border-bottom: none; }
.fc-thumb { width: 46px; height: 46px; flex: 0 0 46px; border-radius: var(--r-xs); overflow: hidden; display: grid; place-items: center; background: var(--cream-2); }
.fc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fc-thumb .prod-motif.sm { transform: scale(0.46); opacity: 0.85; }

/* --- Toast / notificação de nova venda ---------------------------------- */
#toast-host { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; gap: 12px; align-items: center; background: var(--charcoal, #2C2C2C); color: var(--cream, #F5F0E8); padding: 13px 18px; border-radius: 14px; box-shadow: 0 14px 36px rgba(92,61,46,.30); opacity: 0; transform: translateY(14px); transition: all .35s var(--ease); max-width: 92vw; }
.toast.in { opacity: 1; transform: translateY(0); }
.toast-ic { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; color: var(--gold-light, #E0C992); }
.toast-ic svg { width: 22px; height: 22px; }
.toast b { font-size: 14px; }
.toast-sub { font-size: 12px; opacity: .78; margin-top: 2px; }
@media (min-width: 1024px) { #toast-host { bottom: 28px; right: 28px; left: auto; transform: none; align-items: flex-end; } }
