/* FILE: css/dash-premium.css — premium dashboard + shared icon styles (loaded last) */

/* ---------- Icons (js/icons.js) ---------- */
:where(svg.ic) { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }
.empty-ic {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #f0fdfa, #e6f7f4); color: #0d9488;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, .16);
}
.empty-ic svg { width: 26px; height: 26px; }
html.dark .empty-ic { background: rgba(20, 184, 166, .12); color: #5eead4; box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .16); }
.toast-ic svg { width: 14px; height: 14px; display: block; }
.toast-ic { display: inline-flex; align-items: center; justify-content: center; }
.sec-ic { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #f0fdfa; color: #0d9488; }
.sec-ic svg { width: 22px; height: 22px; }
.sec-evt { display: inline-flex; align-items: center; gap: 6px; }
.sec-evt svg { width: 15px; height: 15px; color: #059669; }
.sec-ev.bad .sec-evt svg { color: #e11d48; }
#mt-cover svg { width: 56px; height: 56px; }
.lk-foot { display: flex; align-items: center; justify-content: center; gap: 6px; }
.lk-foot svg { width: 12px; height: 12px; }
.gs-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f0fdfa; color: #0d9488; }
.gs-ic svg { width: 17px; height: 17px; }
.gs-tx { min-width: 0; }
button[data-view] svg, button[data-edit] svg, button[data-delete] svg, button[data-del] svg,
button[data-st-edit] svg, button[data-st-del] svg { display: block; }

/* ---------- Dashboard ---------- */
body[data-page="dashboard"] {
  --dp-ink: #0b1b3a;
  --dp-line: #e6ecec;
  --dp-soft: #f1f5f4;
  --dp-shadow: 0 1px 2px rgba(11, 27, 58, .04), 0 14px 30px -18px rgba(11, 27, 58, .18);
}

/* Hero: a calm deep-teal field with two soft lights, no moving gradient */
body[data-page="dashboard"] .hero-teal {
  animation: none; background-size: auto;
  background:
    radial-gradient(120% 140% at 88% -25%, rgba(94, 234, 212, .30), transparent 55%),
    radial-gradient(80% 110% at -5% 115%, rgba(245, 166, 35, .18), transparent 58%),
    linear-gradient(160deg, #0b524b 0%, #0a3f3b 58%, #082f36 100%);
  border-radius: 0 0 34px 34px;
}
body[data-page="dashboard"] .hero-teal::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(250, 194, 77, .55), transparent);
}
body[data-page="dashboard"] .fx-orb { opacity: .16; animation-duration: 18s; }
body[data-page="dashboard"] .hero-teal h1 { letter-spacing: -.01em; }
html.dark body[data-page="dashboard"] .hero-teal {
  background:
    radial-gradient(120% 140% at 88% -25%, rgba(45, 212, 191, .18), transparent 55%),
    radial-gradient(80% 110% at -5% 115%, rgba(245, 166, 35, .10), transparent 58%),
    linear-gradient(160deg, #09403b 0%, #072d2f 58%, #061f27 100%);
}

/* Solid, confident numbers (replaces the old teal-to-gold text gradient) */
body[data-page="dashboard"] #stat-total-sales,
body[data-page="dashboard"] #stat-stock-value {
  background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--dp-ink, #0b1b3a);
}
html.dark body[data-page="dashboard"] #stat-total-sales,
html.dark body[data-page="dashboard"] #stat-stock-value { color: #f1f5f9; }

.dp-body { margin-top: -3.4rem; position: relative; z-index: 3; padding-bottom: .5rem; }

/* Shared card */
.dp-card {
  position: relative; background: #fff; border: 1px solid var(--dp-line, #e6ecec);
  border-radius: 22px; box-shadow: var(--dp-shadow, 0 8px 24px -16px rgba(11, 27, 58, .2));
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.dp-card:hover { border-color: var(--dp-line, #e6ecec) !important; box-shadow: var(--dp-shadow); }
.dp-card::after { display: none; }
.dp-panel { padding: 1.1rem 1.15rem 1.15rem; }
.dp-stat { padding: 1rem 1rem .95rem; overflow: hidden; }
html.dark .dp-card { background: #131b2c; border-color: #232d42; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .6); }
html.dark .dp-card:hover { border-color: #232d42 !important; }

/* The one big number */
.dp-summary {
  position: relative; overflow: hidden; padding: 1.15rem 1.2rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border: 1px solid rgba(15, 118, 110, .12); border-radius: 26px;
  box-shadow: 0 1px 2px rgba(11, 27, 58, .05), 0 26px 44px -26px rgba(8, 60, 58, .42), 0 0 0 4px rgba(255, 255, 255, .22);
  animation: riseIn .55s cubic-bezier(.16, 1, .3, 1) both;
}
.dp-summary::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, #14b8a6 0%, #5eead4 38%, #f5a623 72%, rgba(245, 166, 35, 0) 100%);
}
html.dark .dp-summary { background: linear-gradient(180deg, #152033, #121a2b); border-color: rgba(94, 234, 212, .14); box-shadow: 0 26px 44px -26px rgba(0, 0, 0, .75), 0 0 0 4px rgba(255, 255, 255, .03); }
.dp-hero-num {
  font-family: Fraunces, serif; font-weight: 600; font-size: clamp(2rem, 9.4vw, 2.7rem); line-height: 1.05;
  letter-spacing: -.025em; color: var(--dp-ink, #0b1b3a); margin-top: .55rem;
}
html.dark .dp-hero-num { color: #f1f5f9; }
.dp-spark { margin-top: .8rem; height: 46px; }
.dp-spark svg { height: 46px; }
.dp-spark.sm { margin-top: .55rem; height: 28px; }
.dp-spark.sm svg { height: 28px; }
.dp-foot {
  display: flex; align-items: center; justify-content: space-between; margin-top: .85rem; padding-top: .7rem;
  border-top: 1px dashed var(--dp-line, #e6ecec); font-size: 11.5px; color: #64748b;
}
.dp-foot > span { display: inline-flex; align-items: center; gap: 6px; }
html.dark .dp-foot { border-top-color: #232d42; color: #93a1b8; }

.dp-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; color: #0f766e; background: #ecfdf9; border: 1px solid #c9f2ea;
  transition: background-color .15s ease;
}
.dp-chip b { font-weight: 700; }
.dp-chip:hover { background: #dcf8f2; }
html.dark .dp-chip { color: #5eead4; background: rgba(20, 184, 166, .12); border-color: rgba(94, 234, 212, .2); }

.dp-label { font-size: 12px; font-weight: 600; color: #64748b; letter-spacing: .005em; }
html.dark .dp-label { color: #93a1b8; }
.dp-num { font-family: Fraunces, serif; font-weight: 600; font-size: 1.4rem; line-height: 1.15; letter-spacing: -.015em; color: var(--dp-ink, #0b1b3a); margin-top: .6rem; }
.dp-num.rose { color: #be123c; margin-top: .15rem; }
html.dark .dp-num { color: #f1f5f9; }
html.dark .dp-num.rose { color: #fda4af; }
.dp-note { margin-top: .5rem; font-size: 11px; color: #94a3b8; line-height: 1.35; height: 28px; }

/* Icon tiles (squircle, tinted) */
.dp-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 12px; }
.dp-ic.sm { width: 26px; height: 26px; border-radius: 9px; }
.dp-ic.lg { width: 44px; height: 44px; border-radius: 14px; }
.t-teal    { background: #e3f8f4; color: #0d9488; }
.t-emerald { background: #e2f7ec; color: #059669; }
.t-gold    { background: #fdf0d3; color: #b7791f; }
.t-sky     { background: #e1f1fb; color: #0284c7; }
.t-violet  { background: #eee9fd; color: #6d4fd8; }
.t-amber   { background: #fdf0cf; color: #b45309; }
.t-rose    { background: #fde8ec; color: #be123c; }
.t-cyan    { background: #def5f9; color: #0e7490; }
.t-slate   { background: #eef1f4; color: #475569; }
html.dark .t-teal    { background: rgba(20, 184, 166, .14); color: #5eead4; }
html.dark .t-emerald { background: rgba(16, 185, 129, .14); color: #6ee7b7; }
html.dark .t-gold    { background: rgba(245, 166, 35, .14); color: #fcd34d; }
html.dark .t-sky     { background: rgba(14, 165, 233, .15); color: #7dd3fc; }
html.dark .t-violet  { background: rgba(139, 109, 245, .17); color: #c4b5fd; }
html.dark .t-amber   { background: rgba(245, 158, 11, .15); color: #fbbf24; }
html.dark .t-rose    { background: rgba(244, 63, 94, .15); color: #fda4af; }
html.dark .t-cyan    { background: rgba(34, 211, 238, .13); color: #67e8f9; }
html.dark .t-slate   { background: rgba(148, 163, 184, .14); color: #cbd5e1; }

/* Projection meter */
.dp-meter { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: var(--dp-soft, #f1f5f4); margin-top: .15rem; }
.dp-meter i { display: block; height: 100%; transition: width .9s cubic-bezier(.16, 1, .3, 1); }
.dp-meter-cost { background: linear-gradient(90deg, #94a3b8, #b6c2d0); }
.dp-meter-profit { background: linear-gradient(90deg, #10b981, #34d399); }
html.dark .dp-meter { background: #0f1729; }
.dp-fig-l { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #64748b; }
.dp-fig-v { font-family: Fraunces, serif; font-weight: 600; font-size: 1rem; margin-top: 3px; color: var(--dp-ink, #0b1b3a); letter-spacing: -.01em; }
.dp-fig-v.profit { color: #059669; }
html.dark .dp-fig-l { color: #93a1b8; }
html.dark .dp-fig-v { color: #f1f5f9; }
html.dark .dp-fig-v.profit { color: #6ee7b7; }
.dp-dot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; }
.dp-dot.cost { background: #94a3b8; } .dp-dot.profit { background: #10b981; } .dp-dot.total { background: #f5a623; }

/* Alert pills: still, and quiet when there is nothing to worry about */
body[data-page="dashboard"] .pill-alert { animation: none; box-shadow: 0 1px 2px rgba(11, 27, 58, .04); }
.pill-alert.is-zero { opacity: .62; filter: saturate(.55); }

/* Credit card */
.dp-credit { display: flex; align-items: center; gap: .85rem; padding: .95rem 1.05rem; transition: transform .15s ease; }
.dp-credit:active { transform: scale(.985); }
.dp-credit-note { font-size: 12px; font-weight: 500; color: #94a3b8; flex: none; }
.dp-chev { color: #cbd5e1; flex: none; }

/* Section headers */
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.dp-title { display: flex; align-items: center; gap: .6rem; font-size: 14px; font-weight: 650; color: var(--dp-ink, #0b1b3a); letter-spacing: -.005em; }
html.dark .dp-title { color: #eef2f7; }
.dp-count { font-size: 11px; font-weight: 600; color: #64748b; background: var(--dp-soft, #f1f5f4); padding: 3px 9px; border-radius: 99px; }
.dp-count:empty { display: none; }
html.dark .dp-count { background: #0f1729; color: #93a1b8; }
.dp-link { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: #0f766e; transition: color .15s ease; }
.dp-link:hover { color: #0d9488; }
html.dark .dp-link { color: #5eead4; }
.dp-section { display: flex; align-items: center; gap: .5rem; margin: 1.6rem 0 .8rem; font-size: 14px; font-weight: 650; color: var(--dp-ink, #0b1b3a); }
html.dark .dp-section { color: #eef2f7; }
.dp-bolt { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: #fdf0d3; color: #b7791f; }
html.dark .dp-bolt { background: rgba(245, 166, 35, .15); color: #fcd34d; }

/* Quick actions */
.dp-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center;
  padding: .95rem .5rem .85rem; background: #fff; border: 1px solid var(--dp-line, #e6ecec); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(11, 27, 58, .03); -webkit-tap-highlight-color: transparent;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .2s ease, border-color .2s ease;
}
.dp-tile-label { font-size: 12.5px; font-weight: 600; color: #334155; }
.quick-tile.dp-tile:active { transform: scale(.96); }
@media (hover: hover) { .quick-tile.dp-tile:hover { transform: translateY(-2px); box-shadow: var(--dp-shadow); border-color: #cfe3e0; } }
html.dark .dp-tile { background: #131b2c; border-color: #232d42; }
html.dark .dp-tile-label { color: #cbd5e1; }

/* Lists */
.dp-list > * + * { border-top: 1px solid var(--dp-line, #e6ecec); }
html.dark .dp-list > * + * { border-top-color: #1c2536; }
.dp-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 0; font-size: 13.5px; }
.dp-row:first-child { padding-top: .1rem; }
.dp-row-main { min-width: 0; flex: 1; }
.dp-row-t { color: #1e293b; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-row-s { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.dp-row-r { text-align: right; flex: none; }
.dp-row-v { font-weight: 600; color: var(--dp-ink, #0b1b3a); }
.dp-row-p { font-size: 11.5px; font-weight: 600; color: #059669; margin-top: 2px; }
html.dark .dp-row-t { color: #e2e8f0; }
html.dark .dp-row-v { color: #f1f5f9; }
html.dark .dp-row-p { color: #6ee7b7; }
.dp-lead { width: 34px; height: 34px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.dp-lead svg { width: 16px; height: 16px; }
.dp-qty { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.dp-qty.amber { background: #fdf0cf; color: #b45309; }
.dp-qty.rose { background: #fde8ec; color: #be123c; }
html.dark .dp-qty.amber { background: rgba(245, 158, 11, .15); color: #fbbf24; }
html.dark .dp-qty.rose { background: rgba(244, 63, 94, .15); color: #fda4af; }

/* Category rows with share bar */
.dp-bar { height: 4px; border-radius: 99px; background: var(--dp-soft, #f1f5f4); overflow: hidden; margin-top: 7px; }
.dp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #14b8a6, #5eead4); transition: width .9s cubic-bezier(.16, 1, .3, 1); }
html.dark .dp-bar { background: #0f1729; }

/* Empty states inside dashboard cards */
.dp-empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.4rem .5rem 1.2rem; text-align: center; font-size: 13px; color: #94a3b8; }
.dp-empty .dp-ic { width: 44px; height: 44px; border-radius: 14px; }
.dp-empty .dp-ic svg { width: 21px; height: 21px; }

@media (prefers-reduced-motion: reduce) {
  .dp-summary { animation: none; }
  .dp-meter i, .dp-bar i { transition: none; }
}
