:root{
  --accent:#2563eb;--accent-strong:#1d4ed8;--accent-soft:#dbeafe;--accent-rgb:37,99,235;
  --bg:#f4f7fb;--surface:#fff;--surface-2:#f8fafc;--text:#172033;--muted:#667085;
  --border:#dfe5ee;--shadow:0 12px 32px rgba(16,24,40,.09);--danger:#d92d20;--danger-soft:#fee4e2;
  --success:#15803d;--success-soft:#dcfce7;--warning:#b54708;--warning-soft:#ffead5;
  --radius:18px;--topbar:76px;--bottom-nav:0px;
}
:root[data-color="purple"]{--accent:#7c3aed;--accent-strong:#6d28d9;--accent-soft:#ede9fe;--accent-rgb:124,58,237}
:root[data-color="green"]{--accent:#15803d;--accent-strong:#166534;--accent-soft:#dcfce7;--accent-rgb:21,128,61}
:root[data-color="orange"]{--accent:#ea580c;--accent-strong:#c2410c;--accent-soft:#ffedd5;--accent-rgb:234,88,12}
:root[data-color="red"]{--accent:#dc2626;--accent-strong:#b91c1c;--accent-soft:#fee2e2;--accent-rgb:220,38,38}
:root[data-appearance="dark"]{--bg:#0b1220;--surface:#111a2b;--surface-2:#172236;--text:#eef2f8;--muted:#a5b0c1;--border:#28354b;--shadow:0 16px 36px rgba(0,0,0,.35);--accent-soft:rgba(var(--accent-rgb),.2);--danger-soft:rgba(217,45,32,.18);--success-soft:rgba(21,128,61,.2);--warning-soft:rgba(181,71,8,.2)}
@media(prefers-color-scheme:dark){:root[data-appearance="system"]{--bg:#0b1220;--surface:#111a2b;--surface-2:#172236;--text:#eef2f8;--muted:#a5b0c1;--border:#28354b;--shadow:0 16px 36px rgba(0,0,0,.35);--accent-soft:rgba(var(--accent-rgb),.2);--danger-soft:rgba(217,45,32,.18);--success-soft:rgba(21,128,61,.2);--warning-soft:rgba(181,71,8,.2)}}
*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);scroll-behavior:smooth}body{margin:0;min-height:100vh;background:var(--bg)}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh}.topbar{height:calc(var(--topbar) + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(18px,env(safe-area-inset-right)) 0 max(18px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:30}.brand{display:flex;align-items:center;gap:12px;min-width:0}.brand-mark{width:44px;height:44px;border-radius:14px;background:linear-gradient(145deg,var(--accent),var(--accent-strong));color:#fff;font-weight:800;display:grid;place-items:center;box-shadow:0 8px 18px rgba(var(--accent-rgb),.28);letter-spacing:-.5px}.brand h1{font-size:20px;line-height:1.1;margin:0;white-space:nowrap}.brand p{font-size:12px;color:var(--muted);margin:4px 0 0}.top-actions{display:flex;align-items:center;gap:8px}.icon-button{min-height:42px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:12px;padding:0 13px;display:flex;align-items:center;gap:8px;font-weight:650}.icon-button:hover{border-color:var(--accent);background:var(--accent-soft)}.sync-dot{width:9px;height:9px;border-radius:50%;background:#98a2b3;box-shadow:0 0 0 3px rgba(152,162,179,.15)}.sync-dot.ready{background:#16a34a;box-shadow:0 0 0 3px rgba(22,163,74,.16)}.sync-dot.busy{background:#f59e0b;animation:pulse 1s infinite}.sync-dot.error{background:#dc2626}@keyframes pulse{50%{opacity:.35}}
main{width:min(1500px,100%);margin:0 auto;padding:22px 24px 48px}.summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:20px}.summary-card{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);padding:18px;display:flex;align-items:center;gap:14px;box-shadow:0 2px 10px rgba(16,24,40,.035);transition:.18s ease}.summary-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:rgba(var(--accent-rgb),.3)}.summary-card strong{display:block;font-size:28px;line-height:1}.summary-card span:not(.summary-icon){display:block;color:var(--muted);font-size:13px;margin-top:6px}.summary-icon{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;font-size:22px;background:var(--accent-soft)}.summary-pending .summary-icon{background:#fff1d6}.summary-battery .summary-icon{background:#dcfce7}.summary-history .summary-icon{background:#dbeafe}.summary-card .summary-subline{color:var(--danger);font-weight:850;margin-top:3px}.summary-card .summary-subline.all-closed{color:var(--success)}.workspace{background:var(--surface);border:1px solid var(--border);border-radius:22px;box-shadow:0 3px 14px rgba(16,24,40,.04);overflow:hidden}.tabs-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);padding:0 18px}.tabs{display:flex;gap:8px;overflow:auto}.tab{height:62px;border:0;border-bottom:3px solid transparent;background:transparent;color:var(--muted);font-weight:750;padding:0 16px;white-space:nowrap}.tab span{font-size:11px;background:var(--surface-2);border:1px solid var(--border);padding:2px 7px;border-radius:999px;margin-left:5px}.tab.active{color:var(--accent);border-bottom-color:var(--accent)}.tab.active span{background:var(--accent-soft);border-color:transparent}.primary-button,.secondary-button,.danger-button{min-height:42px;border-radius:12px;padding:0 15px;font-weight:750;border:1px solid transparent}.primary-button{background:var(--accent);color:#fff;box-shadow:0 5px 12px rgba(var(--accent-rgb),.22)}.primary-button:hover{background:var(--accent-strong)}.secondary-button{background:var(--surface-2);color:var(--text);border-color:var(--border)}.secondary-button:hover{border-color:var(--accent);color:var(--accent)}.danger-button{background:var(--danger-soft);color:var(--danger);border-color:rgba(217,45,32,.18)}.toolbar{display:grid;grid-template-columns:minmax(280px,1fr) 190px 170px auto;gap:10px;padding:16px 18px;border-bottom:1px solid var(--border);background:var(--surface-2)}.search-box{display:flex;align-items:center;gap:9px;border:1px solid var(--border);background:var(--surface);border-radius:12px;padding:0 12px;min-height:44px}.search-box:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.12)}.search-box span{font-size:22px;color:var(--muted);transform:rotate(-20deg)}.search-box input{border:0;outline:0;background:transparent;color:var(--text);width:100%;min-width:0}.toolbar select,.form-grid input,.form-grid select,.form-grid textarea,.cloud-settings input{min-height:44px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:9px 11px;outline:0}.toolbar select:focus,.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus,.cloud-settings input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.12)}.content{min-height:420px;padding:18px}.section-block{margin-bottom:22px}.section-block:last-child{margin-bottom:0}.section-heading{display:flex;align-items:center;justify-content:space-between;margin:0 2px 10px}.section-heading h2{font-size:15px;margin:0;display:flex;align-items:center;gap:8px}.section-heading h2::before{content:"";width:4px;height:18px;border-radius:5px;background:var(--accent)}.section-heading span{font-size:12px;color:var(--muted);background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:4px 9px}.cards-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.item-card{position:relative;border:1px solid var(--border);border-left:5px solid #94a3b8;border-radius:16px;background:var(--surface);padding:15px;min-width:0;transition:.16s ease}.item-card:hover{border-color:rgba(var(--accent-rgb),.35);box-shadow:0 8px 24px rgba(16,24,40,.07)}.item-card.type-eac{border-left-color:#b48bb5}.item-card.type-cardtronic{border-left-color:#7aa6cd}.item-card.type-banco{border-left-color:#4ba477}.card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.card-id{font-size:12px;font-weight:800;color:var(--accent);background:var(--accent-soft);border-radius:8px;padding:4px 7px;display:inline-block}.card-title{font-size:15px;margin:9px 0 0;line-height:1.35}.card-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.meta-chip,.status-badge{font-size:11px;border-radius:999px;padding:4px 8px;background:var(--surface-2);border:1px solid var(--border);color:var(--muted);font-weight:700}.status-badge.hecho,.status-badge.repuestas{color:var(--success);background:var(--success-soft);border-color:transparent}.status-badge.pausado{color:var(--warning);background:var(--warning-soft);border-color:transparent}.status-badge.sin-estado,.status-badge.pendiente{color:var(--muted)}.card-observation{font-size:13px;color:var(--text);line-height:1.45;margin:11px 0 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line}.card-address{font-size:12px;color:var(--muted);line-height:1.4;margin:10px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.card-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:13px;padding-top:12px;border-top:1px solid var(--border)}.card-actions button{min-height:36px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font-size:12px;font-weight:750;padding:0 11px}.card-actions button:hover{border-color:var(--accent);color:var(--accent)}.card-actions .done-action{background:var(--success-soft);color:var(--success);border-color:transparent}.menu-button{width:34px;height:34px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);color:var(--text);font-weight:900}.date-group{margin-bottom:20px}.date-heading{position:sticky;top:calc(var(--topbar) + env(safe-area-inset-top));z-index:6;display:flex;align-items:center;gap:10px;background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(10px);padding:10px 3px 8px;border-bottom:1px solid var(--border);margin-bottom:10px}.date-heading strong{font-size:14px}.date-heading span{color:var(--muted);font-size:12px}.history-list{display:grid;gap:9px}.history-row{display:grid;grid-template-columns:120px minmax(220px,1.15fr) minmax(280px,1.8fr) 120px auto;gap:12px;align-items:center;border:1px solid var(--border);border-left:4px solid #94a3b8;border-radius:14px;padding:12px;background:var(--surface)}.history-row.type-eac{border-left-color:#b48bb5}.history-row.type-cardtronic{border-left-color:#7aa6cd}.history-row.type-banco{border-left-color:#4ba477}.history-row:hover{box-shadow:0 7px 20px rgba(16,24,40,.06)}.history-activity{font-size:12px;font-weight:800;color:var(--accent);word-break:break-word}.history-service{font-size:13px;font-weight:750;line-height:1.35}.history-observation{font-size:12px;color:var(--muted);line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-side{display:flex;flex-direction:column;align-items:flex-start;gap:5px}.history-time{font-size:11px;color:var(--muted)}.history-row .open-detail{width:38px;height:38px;border-radius:11px;border:1px solid var(--border);background:var(--surface-2);color:var(--text)}.empty-state{min-height:330px;display:grid;place-items:center;text-align:center;color:var(--muted);padding:35px}.empty-state div{max-width:420px}.empty-state .empty-icon{font-size:48px;display:block;margin-bottom:10px}.empty-state h3{color:var(--text);margin:0 0 7px}.empty-state p{margin:0;line-height:1.5}.floating-add,.bottom-nav{display:none}
.dialog{width:min(720px,calc(100% - 24px));max-height:min(88vh,900px);border:1px solid var(--border);border-radius:22px;background:var(--surface);color:var(--text);padding:0;box-shadow:0 28px 80px rgba(0,0,0,.28)}.dialog::backdrop{background:rgba(15,23,42,.55);backdrop-filter:blur(3px)}.dialog form{max-height:88vh;display:flex;flex-direction:column}.dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:20px 20px 14px;border-bottom:1px solid var(--border)}.dialog-header h2{margin:0;font-size:20px}.dialog-header p{margin:4px 0 0;color:var(--muted);font-size:13px}.close-button{width:38px;height:38px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:12px;font-size:24px;line-height:1}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:18px 20px;overflow:auto}.form-grid label,.cloud-settings label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:750;color:var(--muted)}.form-grid .full{grid-column:1/-1}.form-grid textarea{min-height:100px;resize:vertical}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;padding:14px 20px 20px;border-top:1px solid var(--border)}.detail-content{padding:18px 20px;overflow:auto}.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.detail-field{border:1px solid var(--border);border-radius:13px;padding:11px 12px;background:var(--surface-2)}.detail-field.full{grid-column:1/-1}.detail-field span{display:block;color:var(--muted);font-size:11px;font-weight:750;margin-bottom:5px;text-transform:uppercase;letter-spacing:.03em}.detail-field p{margin:0;line-height:1.45;white-space:pre-wrap;word-break:break-word}.settings-dialog{width:min(620px,calc(100% - 24px))}.settings-sections{padding:18px 20px;overflow:auto}.settings-sections section{padding:0 0 18px;margin-bottom:18px;border-bottom:1px solid var(--border)}.settings-sections section:last-child{border-bottom:0;margin-bottom:0}.settings-sections h3{font-size:14px;margin:0 0 10px}.settings-sections p{font-size:12px;color:var(--muted);line-height:1.5}.color-options{display:flex;gap:10px}.color-options button{width:34px;height:34px;border-radius:50%;border:3px solid var(--surface);box-shadow:0 0 0 1px var(--border);background:#2563eb}.color-options button[data-color="purple"]{background:#7c3aed}.color-options button[data-color="green"]{background:#15803d}.color-options button[data-color="orange"]{background:#ea580c}.color-options button[data-color="red"]{background:#dc2626}.color-options button.active{box-shadow:0 0 0 3px var(--accent)}.segmented{display:inline-flex;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:3px}.segmented button{border:0;background:transparent;color:var(--muted);padding:8px 13px;border-radius:9px;font-weight:700}.segmented button.active{background:var(--surface);color:var(--accent);box-shadow:0 2px 8px rgba(16,24,40,.08)}.cloud-settings input{margin-top:2px}.button-row{display:flex;gap:9px;margin-top:11px}.button-row.wrap{flex-wrap:wrap}.small-text{font-size:11px!important}.about-box{display:flex;align-items:center;justify-content:space-between!important;color:var(--muted);font-size:12px}.about-box strong{color:var(--text)}.toast{position:fixed;left:50%;bottom:24px;z-index:100;transform:translate(-50%,20px);background:#101828;color:#fff;border-radius:12px;padding:11px 15px;font-size:13px;box-shadow:0 12px 34px rgba(0,0,0,.25);opacity:0;pointer-events:none;transition:.2s ease;max-width:min(90vw,520px);text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:920px){:root{--bottom-nav:72px}.desktop-only,.desktop-add{display:none}.topbar{padding-left:14px;padding-right:14px}.brand-mark{width:40px;height:40px;border-radius:12px}.brand h1{font-size:18px}.brand p{display:none}.top-actions{gap:6px}.icon-button{width:40px;height:40px;min-height:40px;padding:0;justify-content:center}.sync-button{width:44px}.summary-grid{grid-template-columns:repeat(3,1fr);gap:8px}.summary-card{padding:12px;gap:9px;border-radius:15px}.summary-icon{width:38px;height:38px;font-size:18px}.summary-card strong{font-size:21px}.summary-card span:not(.summary-icon){font-size:10px;margin-top:4px}.toolbar{grid-template-columns:1fr 1fr;padding:12px}.search-box{grid-column:1/-1}.toolbar .secondary-button{display:none}.content{padding:12px}.cards-grid{grid-template-columns:1fr}.history-row{grid-template-columns:95px 1fr auto}.history-observation{display:none}.history-side{grid-column:2;flex-direction:row}.bottom-nav{display:grid;position:fixed;bottom:0;left:0;right:0;z-index:28;grid-template-columns:repeat(3,1fr);height:calc(var(--bottom-nav) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -8px 24px rgba(16,24,40,.08)}.bottom-nav button{border:0;background:transparent;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:10px;font-weight:750}.bottom-nav button span{font-size:20px}.bottom-nav button.active{color:var(--accent)}.floating-add{display:grid;place-items:center;position:fixed;right:18px;bottom:calc(var(--bottom-nav) + 18px + env(safe-area-inset-bottom));z-index:27;width:56px;height:56px;border:0;border-radius:18px;background:var(--accent);color:#fff;font-size:30px;box-shadow:0 12px 28px rgba(var(--accent-rgb),.35)}main{padding:14px 10px calc(var(--bottom-nav) + 28px)}.workspace{border-radius:18px}.tabs-row{display:none}.date-heading{top:calc(var(--topbar) + env(safe-area-inset-top))}.toast{bottom:calc(var(--bottom-nav) + 16px + env(safe-area-inset-bottom))}}
@media(max-width:580px){.summary-card{flex-direction:column;align-items:flex-start}.summary-card span:not(.summary-icon){line-height:1.2}.toolbar{grid-template-columns:1fr}.toolbar select{min-width:0}.form-grid,.detail-grid{grid-template-columns:1fr}.form-grid .full,.detail-field.full{grid-column:auto}.dialog{width:calc(100% - 12px);border-radius:20px}.dialog-header{padding:17px 15px 12px}.form-grid,.detail-content,.settings-sections{padding:15px}.dialog-actions{padding:12px 15px 15px}.button-row{flex-direction:column}.history-row{grid-template-columns:1fr auto;gap:7px}.history-activity{grid-column:1}.history-service{grid-column:1}.history-side{grid-column:1}.history-row .open-detail{grid-column:2;grid-row:1/4}.card-actions{justify-content:stretch}.card-actions button{flex:1}.about-box{align-items:flex-start!important;gap:6px;flex-direction:column}}

/* Importación local de actividades desde Excel */
.toolbar{grid-template-columns:minmax(280px,1fr) 155px 190px 170px auto}
.excel-import-dialog{width:min(980px,calc(100% - 24px))}
.excel-import-options{display:grid;grid-template-columns:minmax(220px,320px) 1fr;gap:16px;align-items:end;padding:15px 20px;border-bottom:1px solid var(--border);background:var(--surface-2)}
.excel-import-options label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:750;color:var(--muted)}
.excel-import-options select,.battery-type input{min-height:44px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:9px 11px;outline:0}
.excel-import-options p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.excel-import-summary{padding:12px 20px;background:var(--accent-soft);color:var(--text);font-size:13px;border-bottom:1px solid var(--border)}
.excel-import-rows{padding:14px 20px;overflow:auto;display:grid;gap:11px}
.excel-import-row{border:1px solid var(--border);border-radius:16px;padding:14px;background:var(--surface)}
.excel-import-row-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.excel-import-row-head h3{font-size:14px;line-height:1.35;margin:8px 0 0}
.import-state{font-size:11px;font-weight:750;border-radius:999px;padding:5px 9px;white-space:nowrap}
.import-state.new{background:var(--success-soft);color:var(--success)}
.import-state.duplicate{background:var(--warning-soft);color:var(--warning)}
.excel-import-details{display:grid;gap:5px;margin-top:10px;color:var(--muted);font-size:12px;line-height:1.4}
.excel-import-choices{display:grid;grid-template-columns:auto auto minmax(180px,1fr);gap:12px;align-items:end;margin-top:13px;padding-top:12px;border-top:1px solid var(--border)}
.check-option{display:flex;align-items:center;gap:8px;min-height:44px;font-size:12px;font-weight:750;color:var(--text)}
.check-option input{width:20px;height:20px;accent-color:var(--accent)}
.check-option.disabled{opacity:.55}
.battery-type{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:750;color:var(--muted);opacity:.55}
.battery-type.enabled{opacity:1}
.battery-type input:focus,.excel-import-options select:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.12)}

@media(max-width:920px){
  .toolbar{grid-template-columns:1fr 1fr}
  .toolbar .excel-import-button{display:block;grid-column:1/-1}
}
@media(max-width:680px){
  .excel-import-options{grid-template-columns:1fr;padding:13px 15px}
  .excel-import-summary{padding:11px 15px}
  .excel-import-rows{padding:12px 10px}
  .excel-import-row-head{display:grid}
  .import-state{justify-self:start;white-space:normal}
  .excel-import-choices{grid-template-columns:1fr}
  .check-option{min-height:36px}
}

/* V1.2: estados de baterías, cierre de pasados y separación visual */
.section-block{margin:0 0 34px;padding:0 0 28px;border-bottom:3px solid var(--border)}
.section-block:last-child{border-bottom:0;margin-bottom:0;padding-bottom:0}
.section-heading{margin:0 0 16px;padding:14px 16px;border:1px solid var(--border);border-radius:15px;background:linear-gradient(135deg,var(--accent-soft),var(--surface));box-shadow:0 5px 16px rgba(16,24,40,.06)}
.section-heading h2{font-size:18px;font-weight:900;letter-spacing:.035em;text-transform:uppercase;line-height:1.25}
.section-heading h2::before{width:7px;height:27px}
.section-heading span{font-size:13px;font-weight:850;background:var(--surface);color:var(--accent);padding:5px 11px}
.cards-grid{gap:18px}
.item-card{border-width:2px;border-left-width:7px;box-shadow:0 4px 13px rgba(16,24,40,.055)}
.battery-card{overflow:hidden;border-left-width:7px}
.battery-card.battery-not-replaced{border-color:#ef4444;background:linear-gradient(145deg,#fff1f2,var(--surface) 65%);box-shadow:0 7px 20px rgba(220,38,38,.13)}
.battery-card.battery-replaced{border-color:#22c55e;background:linear-gradient(145deg,#ecfdf3,var(--surface) 65%);box-shadow:0 7px 20px rgba(21,128,61,.13)}
.battery-card.battery-not-replaced .card-id{color:#b42318;background:#fee4e2}
.battery-card.battery-replaced .card-id{color:#067647;background:#dcfce7}
.battery-card.battery-not-replaced .card-title,.battery-card.battery-not-replaced .meta-chip{color:#991b1b}
.battery-card.battery-replaced .card-title,.battery-card.battery-replaced .meta-chip{color:#166534}
.battery-state-line{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:-15px -15px 14px;padding:11px 14px;border-bottom:1px solid currentColor}
.battery-state-line strong{font-size:14px;letter-spacing:.04em}
.battery-state-line span{font-size:10px;font-weight:700;opacity:.8;text-align:right}
.battery-not-replaced .battery-state-line{color:#b42318;background:#fee4e2}
.battery-replaced .battery-state-line{color:#067647;background:#dcfce7}
.card-actions .battery-state-button{font-weight:900;letter-spacing:.025em}
.battery-not-replaced .card-actions .battery-state-button{background:#dc2626;color:#fff;border-color:#dc2626}
.battery-replaced .card-actions .battery-state-button{background:#15803d;color:#fff;border-color:#15803d}
.battery-not-replaced .card-actions .battery-state-button:hover{background:#b91c1c;color:#fff;border-color:#b91c1c}
.battery-replaced .card-actions .battery-state-button:hover{background:#166534;color:#fff;border-color:#166534}
.history-list{gap:14px}
.history-row{position:relative;grid-template-columns:120px minmax(220px,1.15fr) minmax(260px,1.7fr) 130px minmax(150px,auto);border-width:2px;padding:15px;overflow:hidden;box-shadow:0 4px 13px rgba(16,24,40,.055)}
.history-row.is-open{border-color:#f59e0b;background:linear-gradient(90deg,#fffbeb,var(--surface) 18%)}
.history-row.is-closed{border-color:#22c55e;background:linear-gradient(90deg,#ecfdf3,var(--surface) 22%);opacity:.92}
.history-row.is-closed .history-service{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:#16a34a}
.history-closure{font-size:10px;font-weight:900;border-radius:999px;padding:4px 8px;white-space:nowrap}
.history-closure.open{color:#b45309;background:#fef3c7}
.history-closure.closed{color:#067647;background:#dcfce7}
.history-actions{display:flex;justify-content:flex-end;align-items:center;gap:7px}
.history-close-button{min-height:38px;border-radius:11px;border:1px solid #16a34a;background:#15803d;color:#fff;font-size:11px;font-weight:850;padding:0 12px}
.history-close-button.reopen{background:#ecfdf3;color:#067647;border-color:#22c55e}
.history-row .open-detail{flex:0 0 38px}
.closed-ribbon{position:absolute;right:-40px;top:15px;transform:rotate(35deg);width:150px;padding:4px 0;text-align:center;background:#15803d;color:#fff;font-size:10px;font-weight:900;letter-spacing:.08em;pointer-events:none}
.history-detail-close{min-height:42px;border-radius:12px;padding:0 15px;font-weight:800;border:1px solid #16a34a;background:#15803d;color:#fff}
.history-detail-close.reopen{background:#ecfdf3;color:#067647;border-color:#22c55e}
@media(max-width:920px){
  .section-block{margin-bottom:28px;padding-bottom:22px}
  .section-heading{padding:13px 14px}
  .section-heading h2{font-size:16px}
  .history-row{grid-template-columns:95px minmax(0,1fr) auto}
  .history-actions{grid-column:3;grid-row:1/4;flex-direction:column;align-self:stretch}
  .history-close-button{flex:1;min-width:88px}
}
@media(max-width:580px){
  .section-heading h2{font-size:15px;max-width:82%}
  .cards-grid{gap:16px}
  .battery-state-line{align-items:flex-start;flex-direction:column;gap:4px}
  .battery-state-line span{text-align:left}
  .history-row{grid-template-columns:minmax(0,1fr) auto;padding:14px}
  .history-activity,.history-service,.history-observation,.history-side{grid-column:1}
  .history-observation{display:block;white-space:normal;max-height:3.2em}
  .history-actions{grid-column:2;grid-row:1/5;min-width:88px}
  .history-row .open-detail{width:100%}
  .closed-ribbon{right:-48px;top:13px}
}


/* V1.4: selector móvil corregido y botón para subir actividades */
.section-switch{display:block;min-width:0;margin-top:13px;padding:11px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);overflow:hidden}
.section-switch-label{display:block;margin-bottom:7px;font-size:11px;font-weight:850;color:var(--muted);text-transform:uppercase;letter-spacing:.035em}
.section-switch-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:8px;min-width:0;max-width:100%}
.section-switch select{display:block;width:100%;max-width:100%;min-width:0;min-height:38px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);padding:7px 32px 7px 10px;outline:0;font-weight:750;text-overflow:ellipsis}
.section-switch select:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.12)}
.move-top-action{min-height:38px;max-width:100%;border:1px solid rgba(var(--accent-rgb),.28);border-radius:10px;background:var(--accent-soft);color:var(--accent);padding:7px 11px;font-size:12px;font-weight:850;white-space:nowrap}
.move-top-action:hover{border-color:var(--accent);background:rgba(var(--accent-rgb),.16)}
.item-card.just-moved{animation:justMoved 1.25s ease}
@keyframes justMoved{0%,35%{box-shadow:0 0 0 4px rgba(var(--accent-rgb),.28),0 12px 30px rgba(16,24,40,.12);transform:translateY(-2px)}100%{box-shadow:none;transform:none}}
.card-actions .battery-copy-action{background:#fff7d6;color:#8a5a00;border-color:#f4c95d}
.card-actions .battery-copy-action:hover{background:#ffefad;color:#694300;border-color:#e0a900}
.form-grid input[readonly]{background:var(--surface-2);color:var(--muted);cursor:not-allowed}
@media(max-width:580px){
  .section-switch-controls{grid-template-columns:1fr}
  .section-switch select,.move-top-action{width:100%;min-width:0}
  .card-actions{flex-wrap:wrap}
  .card-actions button{min-width:calc(50% - 4px)}
  .card-actions .done-action{min-width:100%}
}



/* V1.5: secciones plegables y orden manual dentro de cada sección */
.section-heading-controls{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}
.section-heading .section-count{font-size:13px;font-weight:850;background:var(--surface);color:var(--accent);border:1px solid var(--border);border-radius:999px;padding:5px 11px;white-space:nowrap}
.section-collapse-button{min-height:34px;border:1px solid rgba(var(--accent-rgb),.28);border-radius:10px;background:var(--surface);color:var(--accent);font-size:12px;font-weight:850;padding:0 11px;white-space:nowrap}
.section-collapse-button:hover{border-color:var(--accent);background:var(--accent-soft)}
.section-block.is-collapsed{padding-bottom:13px;margin-bottom:18px;border-bottom-width:2px}
.section-block.is-collapsed .section-heading{margin-bottom:0;box-shadow:none}
.section-switch-controls{grid-template-columns:minmax(0,1fr) auto auto}
.move-one-action{min-height:38px;max-width:100%;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);padding:7px 11px;font-size:12px;font-weight:850;white-space:nowrap}
.move-one-action:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
@media(max-width:760px){
  .section-switch-controls{grid-template-columns:minmax(0,1fr) 1fr 1fr}
  .move-one-action,.move-top-action{white-space:normal;line-height:1.15}
}
@media(max-width:580px){
  .section-heading{align-items:center;gap:10px}
  .section-heading h2{max-width:none;min-width:0;overflow-wrap:anywhere}
  .section-heading-controls{flex:0 0 auto;gap:6px}
  .section-heading .section-count{padding:5px 8px}
  .section-collapse-button{padding:0 9px;font-size:11px}
  .section-switch-controls{grid-template-columns:1fr 1fr}
  .section-switch select{grid-column:1/-1}
  .move-one-action,.move-top-action{width:100%;min-width:0}
}


/* V2.2: total configurable por sección y tarjetas de pendientes alargadas */
.pending-cards-list{grid-template-columns:1fr}
.pending-wide-card{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(390px,.8fr);gap:18px;align-items:start;padding:17px 18px}
.pending-card-main,.pending-card-controls{min-width:0}
.pending-card-controls{border-left:1px solid var(--border);padding-left:18px}
.pending-wide-card .card-observation{display:block;-webkit-line-clamp:unset;overflow:visible;max-height:none;white-space:pre-line}
.pending-wide-card .card-address{white-space:normal;overflow:visible;text-overflow:clip}
.pending-wide-card .section-switch{margin-top:0}
.pending-wide-card .card-actions{margin-top:12px}
.section-heading{flex-wrap:wrap;gap:10px}
.section-heading-controls{flex-wrap:wrap}
.section-total-toggle{min-height:34px;border-radius:999px;padding:0 11px;border:1px solid var(--border);font-size:11px;font-weight:900;white-space:nowrap}
.section-total-toggle.counts-in{background:var(--success-soft);color:var(--success);border-color:rgba(21,128,61,.28)}
.section-total-toggle.counts-out{background:var(--surface-2);color:var(--muted);border-color:var(--border)}
.section-total-toggle:hover{filter:brightness(.98);transform:translateY(-1px)}
@media(max-width:1100px){
  .pending-wide-card{grid-template-columns:minmax(0,1fr) minmax(330px,.78fr)}
}
@media(max-width:920px){
  .pending-wide-card{grid-template-columns:1fr;gap:14px}
  .pending-card-controls{border-left:0;border-top:1px solid var(--border);padding-left:0;padding-top:14px}
}
@media(max-width:580px){
  .section-heading{align-items:flex-start}
  .section-heading-controls{width:100%;justify-content:flex-start}
  .section-heading .section-collapse-button{margin-left:auto}
  .section-total-toggle{order:1}
  .section-heading .section-count{order:2}
  .section-heading .section-collapse-button{order:3}
  .pending-wide-card{padding:15px}
}

/* V2.4: exportación diaria de actividades hechas */
.day-export-panel{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px;padding:16px 18px;border:1px solid rgba(var(--accent-rgb),.24);border-radius:16px;background:linear-gradient(135deg,var(--accent-soft),var(--surface) 58%);box-shadow:0 4px 14px rgba(16,24,40,.045)}
.day-export-copy{display:flex;align-items:center;gap:13px;min-width:0}
.day-export-icon{flex:0 0 42px;width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--accent);color:#fff;font-size:22px;font-weight:900;box-shadow:0 7px 16px rgba(var(--accent-rgb),.24)}
.day-export-copy strong{display:block;font-size:14px;color:var(--text)}
.day-export-copy p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.4}
.day-export-controls{display:flex;align-items:flex-end;gap:9px;flex:0 0 auto}
.day-export-controls label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
.day-export-controls input{min-height:42px;border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text);padding:8px 10px;outline:0;font:inherit;text-transform:none;letter-spacing:normal}
.day-export-controls input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.12)}
.day-export-dialog{width:min(760px,calc(100% - 24px))}
.day-export-body{padding:18px 20px 4px;overflow:auto}
.day-export-body textarea{display:block;width:100%;min-height:300px;resize:vertical;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);color:var(--text);padding:15px;font:500 14px/1.7 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;outline:0;white-space:pre-wrap}
.day-export-body textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.12)}
.day-export-body .small-text{margin:9px 2px 11px;color:var(--muted)}
.day-export-actions{flex-wrap:wrap}
@media(max-width:760px){
  .day-export-panel{align-items:stretch;flex-direction:column;padding:15px}
  .day-export-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end}
  .day-export-controls input{width:100%;min-width:0}
}
@media(max-width:480px){
  .day-export-controls{grid-template-columns:1fr}
  .day-export-controls .primary-button{width:100%}
  .day-export-actions{display:grid;grid-template-columns:1fr;gap:8px}
  .day-export-actions button{width:100%}
  .day-export-body{padding:15px 15px 3px}
  .day-export-body textarea{min-height:350px;font-size:13px}
}
