/* Cupido Preferiti – pagina nell'admin */
:root { --ink: #2a2b2a; --muted: #6d6d6a; --line: #e5e1da; --bg: #f6f3ee; --red: #bf301a; --cream: #fdf6ee; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Manrope, Roboto, sans-serif; }
#app { max-width: 1400px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font: 600 24px/1.2 Lora, Georgia, serif; margin: 0 0 2px; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 400; }
.err { color: #b42318; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.loading, .empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.demo { background: var(--cream); border: 1px solid #ecdcc7; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; font-size: 13px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.top p { margin: 0; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .6; }
.in { border: 1px solid #d6d0c6; border-radius: 8px; padding: 6px 10px; font: inherit; min-width: 200px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; }
.kpi b { display: block; font-size: 26px; margin: 4px 0 2px; }
.kpi span { color: var(--muted); font-size: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; min-width: 0; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.chart .bar { flex: 1; background: var(--red); border-radius: 3px 3px 0 0; opacity: .85; min-width: 3px; }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 6px; border-bottom: 1px solid var(--line); }
td { white-space: nowrap; padding: 8px 6px; border-bottom: 1px solid #f0ede8; vertical-align: middle; }
tbody tr[data-handle] { cursor: pointer; }
tbody tr[data-handle]:hover td { background: #faf8f5; }
tr.sel td { background: #f1f6ff !important; }
.prod { white-space: normal; display: flex; align-items: center; gap: 10px; }
.prod img, .prod .ph { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: #eee; }
.hbar { display: inline-block; height: 6px; border-radius: 3px; background: var(--red); margin-right: 7px; vertical-align: middle; }
.tag { font-size: 11px; background: #eee; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.tag.ok { background: #dff3e8; color: #0b6b3a; }
a { color: #005bd3; }
.modal-back { position: fixed; inset: 0; background: #1d1d1b66; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head .x { border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 14px 18px; overflow: auto; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.klaviyo h3 { display: flex; align-items: center; gap: 8px; } .klaviyo p { margin: 0; max-width: 820px; }

/* Avvisi automatici */
.al-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.al-row:first-of-type { border-top: 0; }
.al-row input.sw { margin-top: 3px; }
.in.sm { width: 64px; min-width: 0; padding: 3px 6px; display: inline-block; }
.al-n { font-size: 13px; }

/* Account nati dai preferiti */
.accs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
@media (max-width: 1000px) { .accs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.acc { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: #faf7f3; min-width: 0; }
.acc b { font-size: 22px; } .acc span { font-size: 13px; font-weight: 600; } .acc small { font-size: 12px; }
