/* The owner's dashboard (2026-10-02). On the site's grey (rule 1), the leaf
   greens for marks and links, white and grey text. Charts are single-series,
   so they need one hue only: --leaf as the fill, --leaf-bright for lines. */

.db { max-width: 1240px; margin: 0 auto; padding: 28px 20px 64px; }
.db h1, .db h2, .db h3 { margin: 0; }

/* ---- sign-in gate */
.db-gate { max-width: 520px; margin: 40px auto; text-align: center; background: var(--card); border-top: 4px solid var(--leaf); border-radius: 14px; padding: 36px 28px; }
.db-gate h1 { font-size: 2rem; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.db-gate h1 span { color: var(--leaf-bright); font-style: italic; }
.db-gate p { color: var(--gray); margin-bottom: 20px; }

/* ---- top bar */
.db-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.db-hello { font-size: 1.9rem; font-weight: 800; color: var(--white); }
.db-sub { color: var(--gray); font-size: .92rem; margin-top: 4px; }
.db-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.db-range { display: inline-flex; background: #2e2e2e; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.db-range button { border: 0; background: transparent; color: var(--gray); font: 700 .88rem/1 inherit; font-family: inherit; padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.db-range button[aria-pressed="true"] { background: var(--leaf); color: var(--ink); }
.db-range button:hover:not([aria-pressed="true"]) { color: var(--white); }
.db-btn-ghost { border: 1px solid var(--rule); background: transparent; color: var(--white); font: 700 .88rem/1 inherit; font-family: inherit; padding: 10px 14px; border-radius: 999px; cursor: pointer; }
.db-btn-ghost:hover { background: #474747; }
.db-btn-ghost:disabled { opacity: .5; cursor: default; }

/* ---- "what stands out": plain sentences */
.db-insights { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.db-insights:empty { display: none; }
.db-insight { flex: 1 1 260px; display: flex; gap: 10px; align-items: flex-start; background: #2e2e2e; border-left: 4px solid var(--leaf); border-radius: 10px; padding: 12px 14px; color: var(--white); font-size: .95rem; line-height: 1.45; }
.db-insight i { color: var(--leaf-bright); margin-top: 3px; }

/* ---- tiles */
.db-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
/* 14 tiles = two rows of 7 on a wide screen (owner, 2026-10-13) */
@media (min-width: 1180px) { .db-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); } .db-tile-value { font-size: 1.6rem; } }
.db-tile { background: var(--card); border-radius: 12px; padding: 14px 16px 12px; border-top: 3px solid var(--leaf); min-height: 118px; display: flex; flex-direction: column; }
.db-tile-label { color: var(--gray); font-size: .84rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.db-tile-value { color: var(--white); font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.db-tile-note { color: var(--gray); font-size: .8rem; line-height: 1.35; margin-top: auto; }
.db-delta { font-weight: 800; }
.db-delta.up { color: var(--leaf-bright); }
.db-delta.down { color: #F2B8A0; }
.db-tile.off .db-tile-value { color: #8f968f; font-size: 1.3rem; }

/* ---- sections and cards */
.db-section { margin-bottom: 30px; }
.db-section > h2 { font-size: 1.35rem; font-weight: 800; color: var(--leaf-bright); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.db-section > p.db-why { color: var(--gray); font-size: .92rem; margin: 0 0 12px; max-width: 80ch; }
.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.db-card { background: var(--card); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.db-card h3 { font-size: 1rem; font-weight: 800; color: var(--white); margin-bottom: 2px; }
.db-card .db-hint { color: var(--gray); font-size: .82rem; margin: 0 0 12px; }
.db-empty { color: var(--gray); font-size: .9rem; font-style: italic; padding: 8px 0; }

/* ---- setup / error notices */
.db-setup { background: #2e2e2e; border: 1px dashed var(--rule); border-radius: 12px; padding: 14px 16px; color: var(--gray); font-size: .92rem; }
.db-setup strong { color: var(--white); }
.db-setup.err { border-color: #b97c66; }
.db-setup a { color: var(--leaf-bright); }

/* ---- bar lists (one hue; the numbers are text, so no legend is needed) */
.db-bars { list-style: none; margin: 0; padding: 0; }
.db-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 5px 0; font-size: .9rem; }
.db-bars .n { color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-bars .v { color: var(--gray); font-variant-numeric: tabular-nums; font-weight: 700; }
.db-bars .track { display: block; grid-column: 1 / -1; height: 8px; background: #3a3a3a; border-radius: 4px; overflow: hidden; }
.db-bars .fill { display: block; height: 100%; background: var(--leaf); border-radius: 0 4px 4px 0; min-width: 2px; }
.db-bars li:hover .fill { background: var(--leaf-bright); }

/* ---- the line chart */
.db-chart { position: relative; }
.db-chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.db-chart .grid line { stroke: #565656; stroke-width: 1; }
.db-chart .axis text { fill: #B4BAB4; font-size: 11px; font-family: inherit; }
.db-chart .area { fill: rgba(74, 183, 60, .16); }
.db-chart .line { fill: none; stroke: var(--leaf-bright); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.db-chart .cross { stroke: #C8CFC8; stroke-width: 1; stroke-dasharray: 3 3; }
.db-chart .dot { fill: var(--leaf-bright); stroke: #474747; stroke-width: 2; }
.db-tip { position: fixed; z-index: 3000; pointer-events: none; background: #1d1f1d; color: var(--white); border: 1px solid #565656; border-radius: 8px; padding: 8px 10px; font-size: .84rem; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.db-tip b { color: var(--leaf-bright); }

/* ---- tables */
.db-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.db-table th { text-align: left; background: transparent; color: var(--gray); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rule); }
.db-table td { text-align: left; color: var(--white); padding: 7px 8px 7px 0; border-bottom: 1px solid #4a4a4a; vertical-align: top; }
.db-table td.num, .db-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.db-table tr:last-child td { border-bottom: 0; }
.db-table th, .db-table td { background: transparent; border-left: 0; border-right: 0; border-top: 0; }

/* ---- social posts */
.db-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.db-post { display: flex; flex-direction: column; background: #2e2e2e; border-radius: 10px; overflow: hidden; color: var(--white); text-decoration: none; }
.db-post:hover { outline: 2px solid var(--leaf); text-decoration: none; }
.db-post img, .db-post .ph { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #3a3a3a; display: block; }
.db-post .ph { display: grid; place-items: center; padding: 12px; color: var(--gray); font-size: .85rem; text-align: center; }
.db-post .meta { padding: 8px 10px 10px; font-size: .82rem; }
.db-post .meta .t { color: var(--gray); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; min-height: 2.6em; }
.db-post .meta .s { display: flex; gap: 10px; color: var(--white); font-weight: 700; }
.db-post .meta .s i { color: var(--leaf-bright); margin-right: 3px; }
.db-post .rank { position: absolute; }

/* ---- small stat rows (Clarity) */
.db-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.db-stat { background: #2e2e2e; border-radius: 10px; padding: 12px 14px; }
.db-stat .v { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.db-stat .l { font-size: .86rem; font-weight: 700; color: var(--white); }
.db-stat .e { font-size: .8rem; color: var(--gray); margin-top: 4px; line-height: 1.4; }
.db-stat .good { color: var(--leaf-bright); }
.db-stat .watch { color: #F2B8A0; }

/* ---- newsletter sender */
.db-send { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.db-send input { flex: 1 1 200px; min-width: 0; background: #2e2e2e; color: var(--white); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 10px; font: inherit; }
.db-send .btn { padding: 9px 16px; }
.db-msg { margin-top: 8px; font-size: .88rem; color: var(--leaf-bright); min-height: 1.2em; }
.db-msg.err { color: #F2B8A0; }

.db-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.db-links a { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 999px; padding: 7px 12px; color: var(--white); font-size: .85rem; font-weight: 700; text-decoration: none; }
.db-links a:hover { background: #474747; text-decoration: none; }
.db-links a i { color: var(--leaf-bright); }

.db-loading { color: var(--gray); padding: 30px 0; text-align: center; }

@media (max-width: 600px) {
  .db { padding: 20px 14px 48px; }
  .db-grid { grid-template-columns: 1fr; }
  .db-tile-value { font-size: 1.6rem; }
  .db-chart svg { height: 200px; }
}

/* ---- store products, by tier (dashboard-store.js) */
.db-store-load { margin-bottom: 12px; }
.db-store-file { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.db-store-file label { cursor: pointer; }
.db-store-file .db-hint { margin: 0; }
.db-store-tabs { flex-wrap: wrap; border-radius: 14px; margin-bottom: 10px; }
.db-store-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.db-store-tools input, .db-store-tools select { background: #2e2e2e; color: var(--white); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .9rem; }
.db-store-tools input { flex: 1 1 260px; min-width: 0; }
.db-store-tools .db-hint { margin: 0 0 0 6px; }
.db-store-note { margin: 0 0 10px; }
.db-store-scroll { overflow-x: auto; background: var(--card); border-radius: 12px; padding: 4px 14px; }
.db-store-table { min-width: 860px; }
.db-store-table td:nth-child(2) { min-width: 240px; max-width: 360px; }
.db-store-table a { color: var(--leaf-bright); }
.db-store-sub { color: var(--gray); font-size: .76rem; margin-top: 2px; }
.db-store-why { color: var(--gray); font-size: .78rem; margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.db-store-why:hover { -webkit-line-clamp: unset; }
.db-flag { display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: 1px 7px; margin: 0 4px 4px 0; font-size: .72rem; font-weight: 700; color: var(--white); white-space: nowrap; }
.db-flag.warn { border-color: #b97c66; color: #F2B8A0; }
.db-store-more { margin-top: 10px; }
.db-store-tools select { width: auto; flex: 0 0 auto; padding-right: 34px; }
.db-store-tools input { width: auto; }

/* Making a Difference editor (2026-10-11) */
.db-impact { display: grid; gap: 8px; margin-bottom: 10px; }
.db-impact-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 70px auto auto; gap: 8px; align-items: center; }
.db-impact-row input[type=text], .db-impact-row input[type=number] { padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.25); color: inherit; font: inherit; }
.db-imp-plus { font-size: .85rem; white-space: nowrap; }
@media (max-width: 700px) { .db-impact-row { grid-template-columns: 1fr 90px; } }
.db-table-wrap { overflow-x: auto; }
.db-route { border-top: 1px solid var(--rule); padding: 12px 0; }
.db-route h4, .db-suggest h4 { margin: 0 0 6px; font-size: 1rem; }
.db-route ol { margin: 0 0 8px; padding-left: 22px; font-size: .9rem; }
.db-suggest { border-top: 1px solid var(--rule); padding-top: 12px; }
.db-total { font-weight: 700; }
/* 2026-10-12: Orders section, pick-up and registration actions, linked tiles */
.db-tile-link { text-decoration: none; color: inherit; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.db-tile-link:hover, .db-tile-link:focus-visible { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.db-tile-go { margin-left: auto; font-size: .75rem; opacity: .7; }
.db-btn-sm { padding: 4px 10px !important; font-size: .8rem !important; }
.db-actions { white-space: nowrap; }
.db-actions .db-btn-ghost { margin: 0 4px 4px 0; }
.db-on { background: var(--leaf) !important; color: #14261A !important; border-color: var(--leaf) !important; }
.db-order { margin: 0 0 16px; }
.db-order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.db-pill { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 9px; border-radius: 999px; background: #4a4a4a; color: var(--white); }
.db-pill-ok { background: var(--leaf); color: #14261A; }
.db-pill-warn { background: #b5642a; color: #fff; }
.db-cust { display: grid; gap: 4px; margin: 0 0 12px; padding: 10px 12px; background: rgba(0,0,0,.18); border-radius: 10px; }
.db-cust-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-cust-k { min-width: 7.5em; color: var(--gray); font-size: .82rem; font-weight: 700; }
.db-cust-v { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; }
.db-copy { background: none; border: 1px solid #5a5a5a; color: var(--leaf-bright, #6FD65F); border-radius: 6px; padding: 1px 8px; font: inherit; font-size: .75rem; cursor: pointer; margin-left: 4px; }
.db-copy:hover { border-color: var(--leaf-bright, #6FD65F); }
.db-ship { align-items: center; margin-top: 8px; }
.db-ship select, .db-ship input { padding: 7px 10px; border-radius: 8px; border: 1px solid #5a5a5a; background: #2e2e2e; color: var(--white); font: inherit; }
.db-st-0 { color: var(--leaf-bright, #6FD65F); font-weight: 700; }
.db-st-1 { color: #e0b04a; font-weight: 700; }
.db-pick td { vertical-align: top; }

/* Stock section (2026-10-13) */
.db-stock-q { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--rule, #565656); min-width: 220px; font: inherit; }
.db-row-out td { color: #F2B8A0; }

/* Tile links land with the section title in view, below the sticky site header (owner, 2026-10-13) */
.db-section { scroll-margin-top: calc(var(--db-hdr, 90px) + 20px); }
.db-sms-text { width: 100%; box-sizing: border-box; margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--rule, #565656); font: inherit; resize: vertical; }
.db-btn { border: 0; background: var(--leaf, #4AB73C); color: var(--ink, #14261A); font: 800 .88rem/1 inherit; font-family: inherit; padding: 11px 16px; border-radius: 999px; cursor: pointer; }
.db-btn:hover { filter: brightness(1.08); }
.db-btn:disabled { opacity: .5; cursor: default; }
.db-warn { color: #F2B8A0 !important; font-weight: 700; }
.db-group-row td { background: #2e2e2e; color: var(--leaf-bright, #6FD65F); font-weight: 800; font-size: .85rem; letter-spacing: .02em; }
