/* Pannello del titolare — si appoggia ai token di style.css */
.owner { background: #F2EEE8; }
.owner-head { background: var(--c-sea); color: #fff; padding: 12px 0 56px; background-image: radial-gradient(circle at 90% 0%, rgba(242, 193, 78, .22), transparent 50%); }
.owner-head__inner { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.owner-head__kicker { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.owner-head h1 { color: #fff; font-size: 26px; white-space: nowrap; }
@media (min-width: 560px) { .owner-head h1 { font-size: 32px; } }
.icon-btn--light { color: #fff; background: rgba(255, 255, 255, .12); }
.icon-btn--light:hover { background: rgba(255, 255, 255, .22) !important; }
.owner-head :focus-visible { outline-color: var(--c-lemon); }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .12); white-space: nowrap; }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); } 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

.owner-main { margin-top: -40px; padding-bottom: 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 980px; }
.owner-date { color: #fff; font-weight: 400; text-transform: capitalize; margin-top: -8px; font-size: 15px; position: relative; top: -6px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--c-surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.kpi__label { font-size: 13px; font-weight: 700; color: var(--c-muted); line-height: 1.3; }
.kpi__value { font-family: var(--f-head); font-size: 30px; font-weight: 600; color: var(--c-sea); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi__sub { font-size: 13px; color: var(--c-muted); line-height: 1.3; }
.kpi--accent { background: var(--c-success-soft); }
.kpi--accent .kpi__value { color: var(--c-success); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 16px; } .kpi { padding: 20px; } }

.owner-card { background: var(--c-surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
@media (min-width: 760px) { .owner-card { padding: 24px; } }
.owner-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.owner-card__head h2 { font-size: 22px; }
.owner-card__hint { font-size: 14px; color: var(--c-muted); }
.count-badge { padding: 4px 12px; border-radius: var(--r-pill); background: var(--c-primary); color: #fff; font-weight: 700; font-size: 13px; animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.filters { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.filter { min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--c-line); background: #fff; font-weight: 700; font-size: 14px; color: var(--c-muted); cursor: pointer; white-space: nowrap; }
.filter.is-on { background: var(--c-sea); border-color: var(--c-sea); color: #fff; }

.bookings, .leads { list-style: none; display: grid; gap: 12px; }
.bk { border: 1.5px solid var(--c-line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; transition: border-color .3s, box-shadow .3s; }
.bk.is-new { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); animation: arrive .6s var(--ease); }
@keyframes arrive { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.bk__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bk__name { font-weight: 700; font-size: 17px; color: var(--c-ink); line-height: 1.3; }
.bk__meta { font-size: 13px; color: var(--c-muted); font-weight: 400; }
.bk__grid { display: grid; gap: 6px; font-size: 15px; }
.bk__grid p { display: flex; align-items: flex-start; gap: 8px; }
.bk__grid .ico { width: 18px; height: 18px; color: var(--c-primary); margin-top: 3px; }
.bk__note { font-size: 14px; color: var(--c-muted); font-style: italic; background: var(--c-bg); padding: 8px 12px; border-radius: var(--r-sm); }
.bk__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid var(--c-line); }
.bk__total { font-family: var(--f-head); font-size: 22px; font-weight: 600; color: var(--c-sea); line-height: 1.1; }
.bk__total small { display: block; font-family: var(--f-body); font-size: 13px; font-weight: 400; color: var(--c-success); margin-top: 2px; }
.bk__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bk__total { white-space: nowrap; }
.icon-btn--wa { background: var(--c-wa); color: #fff; }
.icon-btn--wa:hover { background: var(--c-wa-hover) !important; }
.icon-btn--outline { border: 1.5px solid var(--c-line); }
.pill { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill::first-letter { text-transform: uppercase; }
.pill--new { background: var(--c-primary); color: #fff; vertical-align: 2px; }
.pill--ok { background: var(--c-success-soft); color: var(--c-success); }
.pill--wait { background: #FFF1D1; color: #8A5A00; }
.pill--no { background: var(--c-error-soft); color: var(--c-error); }
.empty { padding: 16px; border: 1.5px dashed var(--c-line); border-radius: var(--r-md); color: var(--c-muted); font-size: 15px; }

.occ-scroll { position: relative; overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; }
.occ { border-collapse: separate; border-spacing: 2px; font-size: 13px; min-width: 100%; }
.occ th { font-weight: 700; color: var(--c-muted); text-align: center; padding: 2px 0 6px; min-width: 26px; line-height: 1.2; }
.occ thead th span { display: block; font-weight: 400; font-size: 11px; text-transform: uppercase; }
.occ thead th.is-we { color: var(--c-primary); }
.occ thead th.is-today { color: var(--c-sea); }
.occ thead th.is-today::after { content: ""; display: block; width: 4px; height: 4px; margin: 3px auto 0; border-radius: 50%; background: var(--c-sea); }
.occ tbody th { text-align: left; color: var(--c-ink); padding-right: 8px; white-space: nowrap; font-size: 13px; position: sticky; left: 0; background: var(--c-surface); z-index: 1; }
.occ__corner { text-align: left !important; position: sticky; left: 0; background: var(--c-surface); z-index: 1; }
.cell { height: 32px; min-width: 26px; background: #F1EDE6; border-radius: 4px; }
/* colori dei canali: contrasto AA con testo bianco */
.owner { --src-sito: #1F6F4A; --src-telefono: #5B6573; --src-booking: #1D5FA6; --src-airbnb: #9C2F6B; }
.cell--sito { background: var(--src-sito); }
.cell--telefono { background: var(--src-telefono); }
.cell--booking { background: var(--src-booking); }
.cell--airbnb { background: var(--src-airbnb); }
.cell { position: relative; }
.cell__k { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.cell.is-start { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.occ-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 14px; color: var(--c-muted); }
.occ-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw--freecell { background: #F1EDE6; }
.owner-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 14px; color: var(--c-muted); }
.owner-note .ico { width: 18px; height: 18px; margin-top: 2px; color: var(--c-sea); }

.lead { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px; border: 1.5px solid var(--c-line); border-radius: var(--r-md); }
.lead__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--c-tint); color: var(--c-sea); }
.lead__icon .ico { width: 18px; height: 18px; }
.lead__req { font-size: 15px; margin: 4px 0; }
.lead a { font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }

.owner-actions { display: grid; gap: 10px; }
@media (min-width: 560px) { .owner-actions { grid-template-columns: auto auto; justify-content: start; } }
.toast--owner { top: auto; bottom: 20px; transform: translate(-50%, 160%); background: var(--c-primary); }
.toast--owner.is-on { transform: translate(-50%, 0); }
/* spazio riservato prima del caricamento dati (evita spostamenti del layout) */
.bookings:empty { min-height: 620px; }
.occ:empty { display: block; height: 190px; }
.leads:empty { min-height: 96px; }
.kpi__value { min-height: 1.2em; }

/* ---------- secondo giro: tutti i canali in un posto ---------- */
.owner-lead { color: #fff; font-family: var(--f-head); font-weight: 600; font-size: 20px; line-height: 1.3; margin-top: -10px; position: relative; top: -6px; }
.kpi--warn { background: #FBEAEA; }
.kpi--warn .kpi__value { color: #A3262A; }
.src { display: inline-grid; place-items: center; min-width: 22px; padding: 2px 8px; border-radius: var(--r-pill); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.4; }
.src--sito { background: var(--src-sito); }
.src--telefono { background: var(--src-telefono); }
.src--booking { background: var(--src-booking); }
.src--airbnb { background: var(--src-airbnb); }
.occ-legend .src { min-width: 22px; padding: 2px 0; width: 22px; }
.bk__meta .src { margin-right: 4px; vertical-align: 1px; }
.bk { border-left-width: 5px; }
.bk--sito { border-left-color: var(--src-sito); }
.bk--telefono { border-left-color: var(--src-telefono); }
.bk--booking { border-left-color: var(--src-booking); }
.bk--airbnb { border-left-color: var(--src-airbnb); }
.bk__comm { display: block; font-family: var(--f-body); font-size: 13px; font-weight: 700; margin-top: 2px; }
.bk__comm--ok { color: var(--c-success); }
.bk__comm--ko { color: #A3262A; }
.bk__total small.bk__comm { color: inherit; }
.bk__total small.bk__comm--ok { color: var(--c-success); }
.bk__total small.bk__comm--ko { color: #A3262A; }
.bk__via { font-size: 14px; color: var(--c-muted); }
.filter { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.filter__n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--c-tint); color: var(--c-ink); font-size: 13px; }
.filter.is-on .filter__n { background: rgba(255, 255, 255, .22); color: #fff; }
.mix__bar { display: flex; height: 18px; border-radius: var(--r-pill); overflow: hidden; background: #F1EDE6; gap: 2px; }
.mix__seg { display: block; height: 100%; transition: width .4s var(--ease); }
.mix__seg--sito { background: var(--src-sito); }
.mix__seg--telefono { background: var(--src-telefono); }
.mix__seg--booking { background: var(--src-booking); }
.mix__seg--airbnb { background: var(--src-airbnb); }
.mix__legend { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin-top: 14px; font-size: 15px; }
.mix__legend li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--c-line); }
.mix__legend strong { font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .mix__legend { grid-template-columns: repeat(4, 1fr); } }
.mix__legend:empty { min-height: 84px; }
.filters:empty { min-height: 56px; }
.owner-head .owner-date { margin: 14px 0 0; top: 0; }
.owner-head .owner-lead { margin: 6px 0 0; top: 0; font-size: 19px; max-width: 32ch; }
@media (min-width: 760px) { .owner-head .owner-lead { font-size: 22px; max-width: none; } }
