/* Gestionale dello psicologo: app con barra laterale su desktop, barra superiore e tab in basso su telefono.
   Tokens locali per restare coerente con il tema (blu #1665cf, rosso #d72924, Oswald + Open Sans). */
.po-practice, .pp-login { --pp-blue: #1665cf; --pp-blue-dark: #0f4fa6; --pp-blue-soft: #e8f0fc; --pp-red: #d72924; --pp-green: #15803d; --pp-green-soft: #e6f6ec; --pp-red-soft: #fdecec; --pp-ink: #1c1f26; --pp-muted: #5f6673; --pp-line: #e6e9ef; --pp-bg: #f3f5f9; --pp-card: #fff; --pp-radius: 16px; --pp-radius-sm: 10px; --pp-shadow: 0 1px 2px #10182808, 0 8px 24px #1018280a; --pp-heading: 'Oswald', 'Arial Narrow', sans-serif; --pp-tabs: 0px; }
body.one-practice { background: #f3f5f9; }
body.one-practice .one-brandbar, body.one-practice .one-topbar, body.one-practice .site-header, body.one-practice .skip-link { display: none; }
body.one-practice .site-footer { display: none; }
body.pp-has-drawer { overflow: hidden; }
.po-practice { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height: 100vh; font-size: 14px; color: var(--pp-ink); }
.po-practice *, .po-practice *::before, .po-practice *::after { box-sizing: border-box; }
.po-practice a { color: inherit; }
.po-practice h1, .po-practice h2, .po-practice h3, .po-practice h4 { font-family: var(--pp-heading); letter-spacing: .2px; }
.pp-main h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.1; }
.pp-main h2 { margin: 28px 0 12px; font-size: 20px; }
.pp-main h3 { margin: 0 0 12px; font-size: 16px; }
.pp-main h4 { margin: 14px 0 6px; font-size: 14px; }
.pp-main p { margin: 0 0 10px; }
.muted { color: var(--pp-muted); }

/* Barra laterale (desktop) */
.pp-nav { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100vh; padding: 14px 0 12px; background: var(--pp-card); border-right: 1px solid var(--pp-line); }
.pp-nav-brand { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px; border-radius: 14px; background: linear-gradient(135deg, #2b7ae6, var(--pp-blue)); color: #fff; box-shadow: 0 8px 18px -8px #1665cf99; }
.pp-nav-brand .po-icon { width: 22px; height: 22px; }
.pp-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 68px; min-height: 58px; padding: 8px 0 6px; border: 0; border-radius: 14px; background: transparent; color: var(--pp-muted); font: 700 10px/1.1 var(--pp-heading); letter-spacing: .4px; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.pp-nav-item .po-icon { width: 22px; height: 22px; }
.pp-nav-item:hover { background: var(--pp-bg); color: var(--pp-ink); }
.pp-nav-item.is-active { background: var(--pp-blue-soft); color: var(--pp-blue); }
.pp-nav-bottom { margin-top: auto; }
.pp-install { color: var(--pp-blue); }

/* Barra superiore e tab (telefono) */
.pp-topbar, .pp-tabs { display: none; }
.pp-main { padding: 26px 30px 48px; min-width: 0; }
.pp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.pp-head p { margin: 2px 0 0; }
.pp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Schede, avvisi, badge, pulsanti */
.pp-card { padding: 22px; background: var(--pp-card); border: 1px solid var(--pp-line); border-radius: var(--pp-radius); box-shadow: var(--pp-shadow); }
.pp-card + .pp-card { margin-top: 16px; }
.pp-card--feature { border-color: #cfe0fa; background: linear-gradient(135deg, #f4f8ff, #fff); }
.pp-big { margin: 0; font: 700 34px/1.1 var(--pp-heading); color: var(--pp-blue); }
.pp-notice { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: #eef3fb; color: var(--pp-ink); font-size: 14px; }
.pp-notice--ok { background: var(--pp-green-soft); color: #14532d; }
.pp-notice--error { background: var(--pp-red-soft); color: #8a1c1c; }
.pp-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--pp-blue-soft); color: var(--pp-blue); font: 700 11px/1 var(--pp-heading); letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.pp-badge--paid { background: var(--pp-green-soft); color: var(--pp-green); }
.pp-badge--unpaid { background: var(--pp-red-soft); color: #b42318; }
.pp-strong { font-weight: 700; color: var(--pp-ink); }
.pp-strong:hover { color: var(--pp-blue); }
.pp-link { padding: 0; border: 0; background: none; color: var(--pp-blue); font: 700 13px/1 inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pp-link:hover { color: var(--pp-red); }
.pp-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f0f2f5; }
.pp-inline:last-of-type { border-bottom: 0; }
.pp-pad { padding: 20px; }
.po-practice .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border: 1px solid transparent; border-radius: 999px; font: 700 13px/1.2 var(--pp-heading); letter-spacing: .5px; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s; }
.po-practice .btn .po-icon { width: 16px; height: 16px; }
.po-practice .btn-primary { background: var(--pp-blue); color: #fff; }
.po-practice .btn-primary:hover { background: var(--pp-blue-dark); box-shadow: 0 10px 20px -10px #1665cf99; }
.po-practice .btn-outline { background: #fff; border-color: #d5d9e0; color: var(--pp-ink); }
.po-practice .btn-outline:hover { border-color: var(--pp-blue); color: var(--pp-blue); }
.po-practice .btn-red { background: var(--pp-red); color: #fff; }
.po-practice .btn-red:hover { background: #b31f1b; }
.po-practice .btn-small { min-height: 40px; padding: 8px 16px; font-size: 12px; }
.po-practice .text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--pp-blue); font-weight: 700; text-decoration: none; }
.po-practice .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.po-practice .text-link .po-icon { width: 16px; height: 16px; }

/* Tabelle */
.pp-table-wrap { padding: 4px 6px; overflow-x: auto; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pp-table th { padding: 12px 14px; border-bottom: 1px solid var(--pp-line); font: 700 11px/1.3 var(--pp-heading); letter-spacing: .6px; text-transform: uppercase; color: var(--pp-muted); text-align: left; white-space: nowrap; }
.pp-table td { padding: 13px 14px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.pp-table tr:last-child td { border-bottom: 0; }
.pp-table tbody tr:hover td { background: #fafbfd; }
.pp-table .text-link { font-size: 13px; }
.pp-table td.pp-actions { white-space: nowrap; }

/* Moduli */
.pp-form { display: grid; gap: 14px; }
.pp-form--compact { gap: 8px; margin-top: 10px; }
.pp-field { display: grid; gap: 5px; font-size: 13px; }
.pp-field > span, .pp-label { font-weight: 700; color: #2b3240; font-size: 12px; }
.pp-field input, .pp-field select, .pp-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d5d9e0; border-radius: var(--pp-radius-sm); background: #fff; font: inherit; font-size: 15px; color: var(--pp-ink); }
.pp-field input:focus, .pp-field select:focus, .pp-field textarea:focus { outline: 2px solid var(--pp-blue); outline-offset: 0; border-color: var(--pp-blue); }
.pp-field input[type=color] { padding: 3px; height: 44px; }
.pp-field input[type=file] { padding: 9px 12px; font-size: 13px; }
.pp-field textarea { resize: vertical; min-height: 90px; }
.pp-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.pp-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--pp-blue); }
.pp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pp-grid-2--wide { align-items: start; gap: 20px; }
.pp-grid-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.pp-span-2 { min-width: 0; }
.pp-days { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-chip-check { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 14px; border: 1px solid #d5d9e0; border-radius: 999px; font-size: 13px; cursor: pointer; }
.pp-chip-check:has(input:checked) { background: var(--pp-blue-soft); border-color: var(--pp-blue); color: var(--pp-blue); }
.pp-chip-check input { width: 14px; height: 14px; accent-color: var(--pp-blue); }
.pp-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.pp-dl dt { color: var(--pp-muted); }
.pp-dl dd { margin: 0; font-weight: 700; }
.pp-copy { display: flex; gap: 6px; margin: 8px 0; }
.pp-copy input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #d5d9e0; border-radius: var(--pp-radius-sm); font-size: 12px; color: var(--pp-muted); }
.pp-details summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; color: var(--pp-blue); font-size: 13px; list-style: none; }
.pp-details summary .po-icon { width: 16px; height: 16px; }
.pp-details summary::-webkit-details-marker { display: none; }
.pp-details--menu { position: relative; }
.pp-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 320px; max-height: 320px; overflow: auto; padding: 8px; background: #fff; border: 1px solid var(--pp-line); border-radius: 14px; box-shadow: 0 18px 40px #10182826; }
.pp-menu a { padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--pp-ink); text-decoration: none; }
.pp-menu a:hover { background: var(--pp-blue-soft); color: var(--pp-blue); }
.pp-empty { display: grid; place-items: center; gap: 10px; padding: 50px 20px; text-align: center; color: var(--pp-muted); }
.pp-empty .po-icon { width: 44px; height: 44px; color: var(--pp-blue); }
.pp-empty p { margin: 0; max-width: 520px; }
.pp-empty--small { padding: 28px 10px; }
.pp-empty--small .po-icon { width: 30px; height: 30px; }

/* Accesso: pannello di presentazione a sinistra, modulo a destra (impilati su telefono). */
.pp-login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; font-family: 'Open Sans', system-ui, sans-serif; color: var(--pp-ink); }
.pp-login *, .pp-login *::before, .pp-login *::after { box-sizing: border-box; }
.pp-login-panel { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 56px clamp(28px, 6vw, 88px); overflow: hidden; background: radial-gradient(circle at 15% 15%, #3f8bff 0%, #1665cf 42%, #0f3d85 100%); color: #fff; }
.pp-login-panel::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: #ffffff12; pointer-events: none; }
.pp-login-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px; color: #fff; font: 700 18px var(--pp-heading); letter-spacing: .3px; text-decoration: none; }
.pp-login-brand img { width: 44px; height: 44px; border-radius: 12px; background: #fff; }
.pp-login-kicker { font: 700 13px/1 var(--pp-heading); letter-spacing: 1.4px; text-transform: uppercase; color: #cfe0fa; }
.pp-login-panel h1 { margin: 0; font: 700 clamp(34px, 4vw, 52px)/1.08 var(--pp-heading); color: #fff; }
.pp-login-list { display: grid; gap: 12px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 15px; }
.pp-login-list li { display: flex; align-items: center; gap: 12px; }
.pp-login-list .po-icon { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: #ffffff1f; flex-shrink: 0; }
.pp-login-foot { margin: 26px 0 0; font-size: 12px; color: #cfe0fa; }
.pp-login-side { display: grid; place-items: center; padding: 40px 24px; background: var(--pp-bg); }
.pp-login-card { width: min(420px, 100%); padding: 36px 34px; background: #fff; border: 1px solid var(--pp-line); border-radius: 22px; box-shadow: 0 20px 50px #10182814; }
.pp-login-card h2 { margin: 0 0 6px; font: 700 28px/1.1 var(--pp-heading); }
.pp-login-card > p { margin: 0 0 18px; font-size: 14px; }
.pp-login-card .login-username, .pp-login-card .login-password { margin-bottom: 14px; }
.pp-login-card label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #2b3240; }
.pp-login-card input[type=text], .pp-login-card input[type=password] { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #d5d9e0; border-radius: var(--pp-radius-sm); background: #fff; font-size: 16px; color: var(--pp-ink); }
.pp-login-card input[type=text]:focus, .pp-login-card input[type=password]:focus { outline: 2px solid var(--pp-blue); border-color: var(--pp-blue); }
.pp-login-card .login-remember { margin: 4px 0 18px; font-size: 13px; }
.pp-login-card .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.pp-login-card .login-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--pp-blue); }
.pp-login-card .login-submit { margin: 0; }
.pp-login-card #wp-submit { width: 100%; min-height: 50px; border: 0; border-radius: 999px; background: var(--pp-blue); color: #fff; font: 700 14px var(--pp-heading); letter-spacing: .6px; text-transform: uppercase; cursor: pointer; box-shadow: 0 12px 22px -12px #1665cfcc; transition: background .15s, transform .15s; }
.pp-login-card #wp-submit:hover { background: var(--pp-blue-dark); transform: translateY(-1px); }
.pp-login-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #f0f2f5; font-size: 13px; }
.pp-login-links a { color: var(--pp-blue); font-weight: 700; text-decoration: none; }
.pp-login-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pp-login .pp-notice { margin-bottom: 14px; }
.pp-login-card h1 { margin: 10px 0 8px; font-size: 28px; font-family: var(--pp-heading); }
.pp-login-card .text-link { display: inline-block; margin: 12px 0; color: var(--pp-blue); font-weight: 700; }
@media (max-width: 800px) {
  .pp-login { grid-template-columns: 1fr; min-height: 0; }
  .pp-login-panel { gap: 10px; padding: 28px 22px 26px; }
  .pp-login-panel h1 { font-size: 28px; }
  .pp-login-list { display: none; }
  .pp-login-foot { display: none; }
  .pp-login-brand { margin-bottom: 4px; }
  .pp-login-side { padding: 20px 14px 40px; }
  .pp-login-card { padding: 26px 22px; border-radius: 18px; }
}
.pp-profile-list { margin: 0; padding: 0; list-style: none; }
.pp-profile-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.pp-profile-list a { font-weight: 700; color: var(--pp-blue); }

/* Agenda */
.pp-agenda { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 20px; align-items: start; }
.pp-agenda-side { display: grid; gap: 16px; }
.pp-minical, .pp-side-block { padding: 16px; background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); }
.pp-side-block h3 { font-size: 14px; margin-bottom: 10px; }
.pp-minical-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.pp-minical-head strong { text-transform: capitalize; }
.pp-minical-head a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; color: var(--pp-muted); text-decoration: none; }
.pp-minical-head a:hover { background: var(--pp-bg); }
.pp-minical-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.pp-minical-dow { padding: 4px 0; font-size: 10px; font-weight: 700; color: #9aa3b2; text-transform: uppercase; }
.pp-minical-day { position: relative; display: grid; place-items: center; height: 32px; border-radius: 10px; font-size: 12px; color: var(--pp-ink); text-decoration: none; }
.pp-minical-day.is-muted { color: #b5bcc8; }
.pp-minical-day.is-week { background: var(--pp-blue-soft); color: var(--pp-blue); }
.pp-minical-day.is-selected { outline: 2px solid var(--pp-blue); outline-offset: -2px; }
.pp-minical-day.is-today { background: var(--pp-blue); color: #fff; font-weight: 700; }
.pp-minical-day.has-events::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateX(-50%); opacity: .8; }
.pp-minical-day:hover { background: #dfe9fb; }
.pp-today-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; color: var(--pp-ink); text-decoration: none; }
.pp-today-item small { grid-column: 2; color: var(--pp-muted); }
.pp-legend { margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; }
.pp-legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.pp-legend li span { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.pp-legend li small { color: var(--pp-muted); margin-left: auto; white-space: nowrap; }
.pp-agenda-main { min-width: 0; }
.pp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.pp-arrows { display: inline-flex; gap: 4px; }
.pp-arrow { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #d5d9e0; border-radius: 50%; background: #fff; font-size: 20px; color: var(--pp-muted); text-decoration: none; }
.pp-arrow:hover { border-color: var(--pp-blue); color: var(--pp-blue); }
.pp-range { font: 700 17px var(--pp-heading); text-transform: capitalize; }
.pp-segment { display: inline-flex; padding: 3px; border-radius: 999px; background: #e3e7ee; }
.pp-segment a { padding: 7px 14px; border-radius: 999px; font: 700 12px/1 var(--pp-heading); letter-spacing: .4px; text-transform: uppercase; color: var(--pp-muted); text-decoration: none; }
.pp-segment a.is-active { background: #fff; color: var(--pp-blue); box-shadow: 0 1px 3px #10182820; }
.pp-search { display: flex; margin-left: auto; border: 1px solid #d5d9e0; border-radius: 999px; background: #fff; overflow: hidden; }
.pp-search input { width: 250px; min-height: 40px; padding: 8px 14px; border: 0; font-size: 14px; }
.pp-search button { display: grid; place-items: center; width: 42px; border: 0; background: var(--pp-blue); color: #fff; cursor: pointer; }
.pp-search .po-icon { width: 17px; height: 17px; }
.pp-search--wide { margin: 0 0 16px; max-width: 560px; }
.pp-search--wide input { flex: 1; width: auto; }
.pp-week { background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); overflow: hidden; }
.pp-week-head { display: grid; grid-template-columns: 56px repeat(auto-fit, minmax(0, 1fr)); border-bottom: 1px solid var(--pp-line); }
.pp-week-day { padding: 10px 6px; text-align: center; border-left: 1px solid #f0f2f5; text-decoration: none; color: var(--pp-ink); }
.pp-week-day small { display: block; font-size: 11px; color: var(--pp-muted); text-transform: uppercase; }
.pp-week-day strong { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 700 17px var(--pp-heading); }
.pp-week-day:hover strong { background: var(--pp-blue-soft); color: var(--pp-blue); }
.pp-week-day.is-today strong { background: var(--pp-blue); color: #fff; }
.pp-week-body { display: grid; grid-template-columns: 56px repeat(auto-fit, minmax(0, 1fr)); height: calc(var(--grid-minutes) * 1px); }
.pp-week-hours { display: grid; grid-auto-rows: 60px; align-items: start; }
.pp-week-hours span { padding-right: 8px; font-size: 11px; color: var(--pp-muted); text-align: right; transform: translateY(-50%); }
.pp-week-hours span:first-child { transform: none; padding-top: 2px; }
.pp-week-col { position: relative; border-left: 1px solid #f0f2f5; background: repeating-linear-gradient(180deg, transparent 0 59px, #f0f2f5 59px 60px); }
.pp-week-col.is-closed { background: repeating-linear-gradient(180deg, #f6f8fb 0 59px, #e9edf3 59px 60px); }
.pp-week-col.is-today { background-color: #fbfcff; }
.pp-week-slot { display: block; height: 60px; }
.pp-week-slot:hover { background: #e8f0fc66; }
.pp-event { position: absolute; left: 3px; right: 3px; top: calc(var(--top) * 1px); height: calc(var(--height) * 1px - 2px); overflow: hidden; padding: 4px 8px 4px 10px; border-radius: 10px; background: color-mix(in srgb, var(--color) 16%, #fff); border-left: 4px solid var(--color); color: var(--pp-ink); font-size: 12px; line-height: 1.3; text-decoration: none; box-shadow: 0 1px 2px #10182814; transition: box-shadow .15s; }
.pp-event:hover, .pp-event.is-selected { box-shadow: 0 8px 20px #10182833; z-index: 5; }
.pp-event small { display: block; color: var(--pp-muted); font-size: 11px; }
.pp-event strong { display: block; }
.pp-event span { display: block; color: var(--pp-muted); }
.pp-event.is-pending { border-left-style: dashed; opacity: .85; }
.pp-event.is-done { opacity: .65; }
.pp-now { position: absolute; left: 0; right: 0; top: calc(var(--now, 0) * 1px); height: 2px; background: var(--pp-red); z-index: 4; pointer-events: none; }
.pp-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--pp-red); }
.pp-now[hidden] { display: none; }
.pp-daylist { display: none; background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); overflow: hidden; }
.pp-agenda.is-day-view .pp-week { display: none; }
.pp-agenda.is-day-view .pp-daylist { display: block; }
.pp-daylist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--pp-line); text-align: center; }
.pp-daylist-head strong { display: block; font: 700 17px var(--pp-heading); text-transform: capitalize; }
.pp-daylist-head small { color: var(--pp-muted); }
.pp-daylist-note { margin: 0; padding: 10px 16px; background: #f6f8fb; color: var(--pp-muted); font-size: 13px; }
.pp-dayitem { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px 12px 0; margin-left: 14px; border-bottom: 1px solid #f0f2f5; text-decoration: none; color: var(--pp-ink); }
.pp-dayitem:last-of-type { border-bottom: 0; }
.pp-dayitem-time { display: grid; padding-left: 10px; border-left: 4px solid var(--color); border-radius: 2px; }
.pp-dayitem-time strong { font: 700 16px var(--pp-heading); }
.pp-dayitem-time small { color: var(--pp-muted); font-size: 11px; }
.pp-dayitem-body { display: grid; min-width: 0; }
.pp-dayitem-body strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-dayitem-body small { color: var(--pp-muted); }
.pp-dayitem-meta { display: flex; align-items: center; gap: 8px; color: #b5bcc8; }
.pp-dayitem-meta .po-icon { width: 18px; height: 18px; }
.pp-dayitem.is-done { opacity: .7; }
.pp-daylist-add { margin: 14px; width: calc(100% - 28px); }

/* Pannello laterale */
.pp-backdrop { position: fixed; inset: 0; z-index: 55; background: #0b0f1766; backdrop-filter: blur(2px); }
.pp-drawer { position: fixed; top: 0; right: 0; z-index: 60; width: min(500px, 100%); height: 100vh; height: 100dvh; overflow: auto; padding: 24px 28px 48px; background: #fff; box-shadow: -20px 0 50px #10182833; animation: pp-slide .22s ease-out; }
@keyframes pp-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pp-drawer h2 { margin: 6px 48px 10px 0; font-size: 24px; }
.pp-drawer-close { position: sticky; top: 0; float: right; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; margin: -4px -8px 0 0; border-radius: 50%; background: var(--pp-bg); color: var(--pp-ink); text-decoration: none; }
.pp-drawer-close .po-icon { width: 18px; height: 18px; }
.pp-drawer-meta { font-size: 13px; line-height: 1.8; color: var(--pp-muted); }
.pp-drawer-meta .po-icon { width: 15px; height: 15px; vertical-align: -3px; color: var(--pp-blue); }
.pp-drawer-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid #f0f2f5; }
.pp-drawer-block h3 { font-size: 14px; }
.pp-drawer .pp-form { margin-top: 16px; }
.pp-new-patient { display: grid; gap: 14px; }
.pp-new-patient[hidden] { display: none; }

/* Messaggi */
.pp-messages { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 520px; background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); overflow: hidden; }
.pp-threads { border-right: 1px solid var(--pp-line); overflow: auto; }
.pp-thread { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px 16px; border-bottom: 1px solid #f0f2f5; color: var(--pp-ink); text-decoration: none; }
.pp-thread:hover, .pp-thread.is-active { background: var(--pp-bg); }
.pp-thread.is-active { box-shadow: inset 3px 0 0 var(--pp-blue); }
.pp-thread small { font-size: 11px; color: var(--pp-muted); }
.pp-thread span { grid-column: 1 / -1; font-size: 12px; color: var(--pp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-thread-view { display: flex; flex-direction: column; min-width: 0; }
.pp-thread-head { padding: 16px 20px; border-bottom: 1px solid var(--pp-line); }
.pp-thread-head h2 { margin: 0 0 2px; font-size: 18px; }
.pp-bubbles { flex: 1; display: grid; gap: 12px; align-content: start; max-height: 420px; padding: 20px; overflow: auto; }
.pp-bubble { max-width: 80%; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: var(--pp-blue-soft); font-size: 13.5px; justify-self: end; }
.pp-bubble--in { justify-self: start; background: var(--pp-bg); border-radius: 16px 16px 16px 4px; }
.pp-bubble p { margin: 4px 0 6px; color: var(--pp-ink); }
.pp-bubble small { font-size: 11px; color: var(--pp-muted); }
.pp-compose { padding: 16px 20px 20px; border-top: 1px solid var(--pp-line); }
.pp-templates { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip { min-height: 36px; padding: 6px 12px; border: 1px solid #d5d9e0; border-radius: 999px; background: #fff; font-size: 12px; cursor: pointer; }
.pp-chip:hover { border-color: var(--pp-blue); color: var(--pp-blue); }

/* Pagamenti, fatture, impostazioni */
.pp-split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.pp-subnav { display: grid; gap: 4px; padding: 16px; background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); }
.pp-subnav h2 { margin: 0 0 8px; font-size: 16px; }
.pp-subnav h3 { margin: 14px 0 6px; font-size: 13px; }
.pp-subnav > a { padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--pp-ink); text-decoration: none; }
.pp-subnav > a:hover { background: var(--pp-bg); }
.pp-subnav > a.is-active { background: var(--pp-blue-soft); color: var(--pp-blue); }
.pp-subcontent { min-width: 0; }
.pp-cards-3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
.pp-cards-3 .pp-card + .pp-card { margin-top: 0; }
.pp-visit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pp-visit { padding: 16px 18px; background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); }
.pp-visit-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 15px; }
.pp-visit p { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; color: var(--pp-muted); }
.pp-visit .po-icon { width: 16px; height: 16px; color: var(--pp-blue); }
.pp-visit-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.pp-amount { font: 700 18px var(--pp-heading); }
.pp-settings-list { display: grid; gap: 4px; }
.pp-settings-list a, .pp-settings-list button.pp-install { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--pp-ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.pp-settings-list a:hover, .pp-settings-list button.pp-install:hover { background: var(--pp-bg); }
.pp-settings-list strong { display: block; font-size: 14px; }
.pp-settings-list small { color: var(--pp-muted); }
.pp-settings-list .pp-logout { color: var(--pp-red); }
.pp-settings-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--pp-bg); color: var(--pp-ink); flex-shrink: 0; }
.pp-settings-icon .po-icon { width: 20px; height: 20px; }
.pp-service { padding: 14px 0; border-bottom: 1px solid #f0f2f5; }
.pp-profile-photo { display: flex; align-items: center; gap: 16px; }
.pp-profile-photo img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.pp-profile-photo > .po-icon { width: 48px; height: 48px; color: #9aa3b2; }
.pp-ios-hint { padding: 8px 10px; font-size: 12px; }

@media (max-width: 1100px) {
  .pp-agenda { grid-template-columns: 1fr; }
  .pp-agenda-side { grid-template-columns: 1fr 1fr; }
  .pp-cards-3 { grid-template-columns: 1fr; }
  .pp-grid-3, .pp-grid-2--wide { grid-template-columns: 1fr; }
}

/* Telefono: barra superiore, tab in basso, agenda a giorno, pannelli a tutto schermo, tabelle a schede. */
@media (max-width: 800px) {
  .po-practice { grid-template-columns: 1fr; min-height: 100vh; --pp-tabs: 64px; }
  .pp-nav { display: none; }
  .pp-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 12px 0 10px; background: #fff; border-bottom: 1px solid var(--pp-line); }
  .pp-topbar strong { flex: 1; font: 700 18px var(--pp-heading); }
  .pp-topbar-brand { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #2b7ae6, var(--pp-blue)); color: #fff; }
  .pp-topbar-brand .po-icon { width: 20px; height: 20px; }
  .pp-topbar-action { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--pp-ink); }
  .pp-topbar-action .po-icon { width: 20px; height: 20px; }
  .pp-install--top { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--pp-blue-soft); color: var(--pp-blue); font: 700 12px var(--pp-heading); text-transform: uppercase; }
  .pp-install--top[hidden] { display: none; }
  .pp-install--top .po-icon { width: 14px; height: 14px; transform: rotate(-90deg); }
  .pp-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--pp-line); box-shadow: 0 -8px 24px #1018280f; }
  .pp-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--pp-muted); font: 700 10px/1 var(--pp-heading); letter-spacing: .4px; text-transform: uppercase; text-decoration: none; }
  .pp-tabs a .po-icon { width: 22px; height: 22px; }
  .pp-tabs a.is-active { color: var(--pp-blue); }
  .pp-tabs a.is-active .po-icon { filter: drop-shadow(0 4px 8px #1665cf55); }
  .pp-main { padding: 14px 14px calc(var(--pp-tabs) + 24px); }
  .pp-main h1 { font-size: 24px; }
  .pp-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .pp-head .btn { width: 100%; }
  .pp-card { padding: 16px; border-radius: 14px; }
  .pp-agenda-side { grid-template-columns: 1fr; order: 2; }
  .pp-agenda-main { order: 1; }
  .pp-side-block:nth-child(3) { display: none; }
  .pp-toolbar { display: none; }
  .pp-daylist-today { display: inline-block; margin-top: 2px; color: var(--pp-blue); font-weight: 700; font-size: 12px; text-decoration: none; }
  .pp-week { display: none; }
  .pp-daylist { display: block; }
  .pp-agenda.is-day-view .pp-week { display: none; }
  .pp-split, .pp-messages { grid-template-columns: 1fr; }
  .pp-subnav { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .pp-subnav h2 { flex: 1 1 100%; margin: 2px 4px 4px; }
  .pp-subnav h3, .pp-subnav .pp-form, .pp-subnav .text-link { flex: 1 1 100%; }
  .pp-subnav > a { padding: 9px 12px; border: 1px solid var(--pp-line); border-radius: 999px; font-size: 12px; }
  .pp-threads { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--pp-line); }
  .pp-bubble { max-width: 92%; }
  .pp-grid-2 { grid-template-columns: 1fr; }
  .pp-search--wide { max-width: none; }
  .pp-search--wide input { flex: 1; width: auto; }
  .pp-drawer { width: 100%; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); animation: pp-rise .22s ease-out; }
  @keyframes pp-rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
  .pp-drawer h2 { font-size: 22px; }
  .pp-drawer .btn { width: 100%; }
  .pp-drawer .pp-inline .btn { width: auto; }
  .pp-menu { position: fixed; left: 14px; right: 14px; top: auto; bottom: calc(var(--pp-tabs) + 12px); min-width: 0; max-height: 50vh; }
  .pp-table-wrap { padding: 4px 12px; overflow: visible; }
  .pp-table thead { display: none; }
  .pp-table, .pp-table tbody, .pp-table tr, .pp-table td { display: block; width: 100%; }
  .pp-table tr { padding: 10px 0; border-bottom: 1px solid var(--pp-line); }
  .pp-table tr:last-child { border-bottom: 0; }
  .pp-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .pp-table td::before { content: attr(data-label); flex-shrink: 0; font: 700 11px/1.2 var(--pp-heading); letter-spacing: .5px; text-transform: uppercase; color: var(--pp-muted); text-align: left; }
  .pp-table td:not([data-label])::before { content: none; }
  .pp-table td:first-child { justify-content: flex-start; padding-bottom: 8px; font-size: 16px; text-align: left; }
  .pp-table td:first-child::before { content: none; }
  .pp-table td.pp-actions { justify-content: flex-end; flex-wrap: wrap; }
  .pp-table td.pp-actions::before { margin-right: auto; }
  .pp-table tbody tr:hover td { background: transparent; }
  .pp-visit-cards { grid-template-columns: 1fr; }
  .pp-settings-list--card { padding: 8px; }
}
@media (max-width: 420px) {
  .pp-segment a { padding: 7px 10px; }
  .pp-dayitem { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; }
}
@media (display-mode: standalone) {
  .pp-topbar { padding-top: env(safe-area-inset-top); min-height: calc(56px + env(safe-area-inset-top)); }
}
