/* Operatività lane: section-specific styles (shared components live in private.css). */

.section-title { font-size:17px; margin:var(--s6) 0 var(--s3); }
.inline-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--s2) var(--s3); }
.inline-form label { display:flex; flex-direction:column; gap:var(--s1); font-size:13px; font-weight:600; color:var(--muted); margin:0; }
.page-header h1 .badge { vertical-align:middle; margin-left:var(--s2); }
.page-header .eyebrow a { text-decoration:none; }
.field-errors { margin:var(--s2) 0; padding-left:1.2rem; }
.card-details > summary { cursor:pointer; list-style:none; min-height:var(--control-h); }
.card-details > summary::-webkit-details-marker { display:none; }
.card-details > summary::after { content:"+"; font-size:20px; font-weight:700; line-height:1; }
.card-details[open] > summary::after { content:"\2212"; }
.card-details[open] > summary { border-bottom:1px solid var(--border); }
.card-details:not([open]) > summary { border-bottom:0; }
button.big,.button.big { min-height:52px; font-size:17px; font-weight:650; padding-inline:var(--s5); }

/* ---------- Oggi ---------- */
.quick-links { display:flex; flex-wrap:wrap; gap:var(--s2); margin:0 0 var(--s6); }
.route-cards { list-style:none; margin:var(--s3) 0 var(--s6); padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:var(--s3); }
.route-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); }
.route-card > a { display:flex; align-items:center; gap:var(--s3); min-height:84px; padding:var(--s4); text-decoration:none; border-radius:inherit; }
.route-card > a:hover { background:var(--row-hover); }
.route-card-icon { display:grid; place-items:center; flex:none; width:48px; height:48px; border-radius:50%; background:var(--highlight); }
.route-card-icon .icon { width:24px; height:24px; }
.route-card-body { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.route-card-body strong { font-size:18px; overflow-wrap:anywhere; }
.route-card-meta { font-size:13px; color:var(--muted); }
.route-card-go { color:var(--muted); }

/* ---------- Giro: stop timeline ---------- */
.stop-timeline { list-style:none; margin:var(--s4) 0 var(--s6); padding:0; position:relative; }
.stop-item { position:relative; display:flex; gap:var(--s3); padding-bottom:var(--s3); }
.stop-item::before { content:""; position:absolute; left:19px; top:40px; bottom:0; width:2px; background:var(--border); }
.stop-item:last-child::before { display:none; }
.stop-marker { flex:none; display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:var(--ink); color:#fff; font-weight:700; font-variant-numeric:tabular-nums; z-index:1; }
.stop-item-body { flex:1; min-width:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:var(--s3) var(--s4); }
.stop-link { display:block; min-height:var(--control-h); padding-top:var(--s1); text-decoration:none; font-size:16px; overflow-wrap:anywhere; }
.stop-link:hover { text-decoration:underline; }
.stop-times { margin:var(--s1) 0 var(--s2); font-size:13px; color:var(--muted); }
.stop-attempt { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--s2); margin:var(--s2) 0 0; padding-top:var(--s2); border-top:1px dashed var(--border); font-size:14px; }
.stop-timeline .stop-item:has(.badge-info) .stop-marker { background:var(--primary); color:var(--ink); box-shadow:0 0 0 3px var(--ink); }

/* ---------- Tappa ---------- */
.stop-hero address { font-style:normal; font-size:20px; font-weight:650; line-height:1.35; margin:0 0 var(--s2); overflow-wrap:anywhere; }
.access-notes { margin:0 0 var(--s3); padding:var(--s2) var(--s3); background:var(--warning-bg); border-left:4px solid var(--warning); border-radius:var(--radius); }
.stop-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:var(--s3); margin:var(--s3) 0; }
.stop-actions .button { min-width:0; text-align:center; }
.item-card .card-header h2 { overflow-wrap:anywhere; }
.item-card form.form-grid { margin-top:var(--s3); }
.item-card .form-grid label:has(textarea) { grid-column:1 / -1; }
.item-card .form-grid textarea,.item-card .form-grid input:not([type=checkbox]),.item-card .form-grid select { width:100%; }
.item-card .form-grid label { display:flex; flex-direction:column; gap:var(--s1); font-weight:600; font-size:14px; }
.subpanel { margin-top:var(--s3); }
.delay-details,.item-card details { margin-top:var(--s3); border:1px solid var(--border); border-radius:var(--radius); padding:0 var(--s3); }
.delay-details > summary,.item-card details > summary { display:flex; align-items:center; min-height:var(--control-h); cursor:pointer; font-weight:650; }
.delay-details[open] > summary,.item-card details[open] > summary { border-bottom:1px solid var(--border); margin-bottom:var(--s3); }
.item-card .form-grid .big { width:100%; }

/* ---------- Carichi ---------- */
.filter-bar .filter-fields label { display:flex; flex-direction:column; gap:var(--s1); font-size:13px; font-weight:600; color:var(--muted); }
.load-form { display:flex; flex-direction:column; gap:var(--s3); margin:var(--s4) 0; }
.load-row { margin:0; padding:0; min-width:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
.load-check { display:flex; align-items:center; gap:var(--s3); min-height:72px; padding:var(--s3) var(--s4); cursor:pointer; border-radius:var(--radius-lg); min-width:0; }
.load-check:hover { background:var(--row-hover); }
.load-check input[type=checkbox] { width:28px; height:28px; min-height:28px; flex:none; accent-color:var(--ink); }
.load-main { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.load-main strong { overflow-wrap:anywhere; }
.load-counts,.load-dates { font-size:13px; color:var(--muted); }
.load-row:has(input[type=checkbox]:checked) { border-color:var(--ink); background:var(--highlight); }
.load-row:has(input[type=checkbox]:checked) .load-check:hover { background:transparent; }
.load-qty { display:flex; flex-direction:column; gap:2px; padding:var(--s2) var(--s4) var(--s2) 0; font-size:13px; font-weight:600; color:var(--muted); }
.load-qty input { width:96px; }
.sticky-confirm { position:sticky; bottom:calc(var(--tabbar-h) + var(--safe-bottom) + var(--s2)); z-index:5; padding:var(--s3) 0; background:linear-gradient(to top,var(--background) 70%,transparent); }
.sticky-confirm button { width:100%; }
.problem-form,.line-actions { margin:0 0 var(--s3); }
.problem-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--s3); }
.problem-form label { display:flex; flex-direction:column; gap:var(--s1); flex:1 1 260px; font-size:13px; font-weight:600; color:var(--muted); }
.problem-form input { width:100%; }
.line-title { font-size:15px; margin:0 0 var(--s2); }
.line-actions form { margin:var(--s3) 0; display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:var(--s2) var(--s3); align-items:end; }
.line-actions form label { display:flex; flex-direction:column; gap:var(--s1); font-size:13px; font-weight:600; color:var(--muted); }
.line-actions form input,.line-actions form select,.line-actions form textarea { width:100%; }
.line-actions details { border:1px solid var(--border); border-radius:var(--radius); padding:0 var(--s3); }
.line-actions details > summary { display:flex; align-items:center; min-height:var(--control-h); cursor:pointer; font-weight:650; }
.line-actions details form { margin:0 0 var(--s3); }

/* ---------- Avvisi ---------- */
.notification-status { color:var(--muted); font-size:13px; margin:0 0 var(--s3); }
.notification-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--s3); }
.notification-list > li { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:var(--s3) var(--s4); }
.notification-list > li[data-read="false"] { order:-1; border-left:4px solid var(--info); background:var(--info-bg); }
.notification-list > li.empty-state { order:0; }
.notification-list a { display:block; min-height:var(--control-h); padding:var(--s2) 0; text-decoration:none; font-weight:600; overflow-wrap:anywhere; }
.notification-list a:hover { text-decoration:underline; }
.notification-actions { display:flex; flex-wrap:wrap; gap:var(--s2); margin-top:var(--s1); }
.notification-actions form { margin:0; }
.notification-actions button { min-height:44px; min-width:88px; }
.notification-actions button[data-notification-read-id] { background:var(--primary); border-color:var(--primary); }

/* ---------- Accordo sul posto ---------- */
.card .form-grid fieldset { border:1px solid var(--border); border-radius:var(--radius); padding:var(--s3) var(--s4); margin:var(--s3) 0; min-width:0; }
.card .form-grid textarea { width:100%; }

@media (max-width:767px) {
  .route-cards { grid-template-columns:minmax(0,1fr); }
  .route-card > a { min-height:96px; }
  .stop-actions { grid-template-columns:minmax(0,1fr); }
  .stop-hero address { font-size:19px; }
  .load-row { grid-template-columns:minmax(0,1fr); }
  .load-qty { flex-direction:row; align-items:center; justify-content:space-between; padding:0 var(--s4) var(--s3); }
  .load-qty input { width:110px; }
  .inline-form { width:100%; }
  .inline-form label { flex:1; }
  .inline-form input { width:100%; }
  .notification-actions button { flex:1; }
  .stop-item-body { padding:var(--s3); }
  .stop-timeline .stop-item::before { left:17px; }
  .stop-marker { width:36px; height:36px; }
}
@media (pointer:fine) { button.big,.button.big { min-height:44px; } }

/* Bare forms are cards in private.css; reset that where a form is only a layout wrapper. */
.load-form,.inline-form,.item-card form,.line-actions form,.stop-hero form,.card form.form-grid { border:0; border-radius:0; box-shadow:none; background:none; padding:0; }
.inline-form { margin:0; }
.load-form { margin:var(--s4) 0; }
.line-actions form,.item-card form { margin:var(--s3) 0; }
.filter-bar { background:var(--surface); }
button.primary { background:var(--primary); border-color:var(--primary); font-weight:650; }
button.primary:hover { background:var(--primary-hover); border-color:var(--primary-hover); }
button.primary:disabled { background:var(--surface-2); border-color:var(--border); color:var(--muted); }

/* Deferred items: complete button, own routes first, unread badge */
.item-card .complete-form { margin-top:var(--s3); }
.item-card .complete-form .button,.item-card .complete-form button { width:100%; }
.item-card .not-done-details { margin-top:var(--s3); }
.route-cards-mine { grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); }
.route-card-mine { border-color:var(--primary); border-width:2px; }
.route-card-mine > a { min-height:104px; }
.route-card-mine .route-card-body strong { font-size:20px; }
@media (max-width:640px) { .route-cards-mine { grid-template-columns:1fr; } }
.nav-count { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; margin-left:auto; border-radius:999px; background:var(--primary); color:var(--ink); font-size:12px; font-weight:700; line-height:1; flex:none; }
.tabbar a,.sidebar-nav a { position:relative; }
.tabbar .nav-count,.sidebar:not(.is-expanded) .nav-count { position:absolute; top:4px; left:calc(50% + 6px); margin-left:0; min-width:18px; height:18px; font-size:11px; padding:0 5px; }
@media (min-width:1200px) { .sidebar:not(.is-expanded) .nav-count { position:static; margin-left:auto; min-width:20px; height:20px; font-size:12px; padding:0 6px; } }
.tabbar .sheet-nav .nav-count { position:static; margin-left:auto; min-width:20px; height:20px; font-size:12px; padding:0 6px; }
