:root {
  color-scheme: light;
  --brand: #a2d4db;
  --brand-dark: #376b75;
  --bg: #f4f6f7;
  --surface: #fff;
  --surface-soft: #edf4f5;
  --text: #15191b;
  --muted: #67747a;
  --line: #d9e1e4;
  --green: #d5eedf;
  --green-text: #246846;
  --yellow: #f6e59d;
  --yellow-text: #806000;
  --danger: #a53e49;
  --shadow: 0 12px 34px rgba(28, 44, 50, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }
.mobile-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; background: var(--bg); }
.topbar { min-height: 78px; padding: 16px 18px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 10; }
.topbar-copy { min-width: 0; flex: 1; }
.topbar-copy strong { display: block; font-size: .95rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-copy span { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.logo { width: 132px; height: auto; display: block; margin-left: auto; }
.main { padding: 24px 18px 36px; }
.eyebrow { margin: 0 0 5px; color: var(--brand-dark); font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.65rem, 5vw, 2.05rem); line-height: 1.15; }
h2 { margin-bottom: 5px; font-size: 1.35rem; }
h3 { margin-bottom: 4px; font-size: 1rem; }
.lead { color: var(--muted); margin-bottom: 24px; line-height: 1.45; }
.home-grid { display: grid; gap: 14px; }
.action-card { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 18px; padding: 18px; min-height: 116px; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 14px; text-align: left; box-shadow: 0 5px 18px rgba(31, 47, 53, .04); }
.action-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; font-size: 1.35rem; font-weight: 750; }
.action-card.material .action-icon { background: var(--brand); color: #173139; }
.action-card.installation .action-icon { background: var(--green); color: var(--green-text); }
.action-card.incident .action-icon { background: var(--yellow); color: var(--yellow-text); }
.action-card strong { display: block; font-size: 1.03rem; margin-bottom: 5px; }
.action-card span { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label, .field-label { color: var(--muted); font-size: .84rem; font-weight: 700; }
.field small { color: var(--muted); line-height: 1.35; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 11px; padding: 11px 12px; min-height: 45px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(162, 212, 219, .42); border-color: var(--brand-dark); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px; color: var(--text); }
.choice.selected { background: var(--brand); border-color: var(--brand); font-weight: 750; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 11px; padding: 11px 15px; min-height: 44px; font-weight: 700; }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #173139; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.back { border: 0; background: transparent; color: var(--brand-dark); font-weight: 700; padding: 0 0 16px; }
.helper { padding: 11px 12px; border-left: 4px solid var(--brand); background: var(--surface-soft); border-radius: 0 10px 10px 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.danger-note { border-left-color: var(--danger); color: var(--danger); }
.line-list { display: grid; gap: 9px; }
.line-item { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(90px, .6fr) 38px; gap: 7px; align-items: center; }
.line-item button { border: 0; background: transparent; color: var(--danger); font-size: 1.15rem; }
.crew-list { display: grid; gap: 10px; margin-bottom: 18px; }
.crew-option { width: 100%; text-align: left; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.crew-option.selected { border-color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(162, 212, 219, .35); }
.crew-option strong, .crew-option span { display: block; }
.crew-option span { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 440px); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.login-logo { width: 174px; margin: 0 0 28px auto; display: block; }
.login-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.text-button { border: 0; background: transparent; color: var(--brand-dark); padding: 6px 0; font-weight: 700; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 22px 14px; }
.sidebar .logo { width: 145px; margin: 0 8px 30px; }
.nav { display: grid; gap: 6px; }
.nav button { border: 0; background: transparent; color: var(--text); border-radius: 10px; padding: 11px 12px; text-align: left; font-weight: 650; }
.nav button.active { background: var(--surface-soft); }
.admin-content { padding: 28px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.user-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: .82rem; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 160px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .88rem; }
th { color: var(--muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); font-size: .75rem; font-weight: 750; }
.status.ok { color: var(--green-text); }
.status.alert { color: var(--danger); }
.crew-grid { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)); gap: 14px; }
.crew-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.crew-card p { color: var(--muted); margin: 4px 0 14px; font-size: .88rem; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none; background: var(--text); color: #fff; padding: 11px 15px; border-radius: 999px; box-shadow: var(--shadow); transition: .2s ease; z-index: 50; }
.toast.show { opacity: 1; translate: -50% 0; }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; position: sticky; top: 0; z-index: 20; }
  .sidebar .logo { width: 118px; margin: 0 0 10px; }
  .nav { display: flex; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .admin-content { padding: 18px; }
  .crew-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .two-col { grid-template-columns: 1fr; }
  .main { padding-inline: 15px; }
  .topbar { padding-inline: 15px; }
  .logo { width: 118px; }
  .line-item { grid-template-columns: 1fr 80px 34px; }
  .admin-head { display: block; }
  .user-chip { display: inline-block; margin-top: 10px; }
}

/* Inventarios, tarifarios, instaladores y partes firmados */
.top-space { margin-top: 22px; }
.top-mini { margin-top: 7px; }
.action-card.inventory .action-icon { background: #e4e9eb; color: #334349; }
.inventory-alert { width: 100%; margin: 0 0 16px; border: 1px solid #d8b94e; background: #fff7d7; color: #5e4b00; border-radius: 14px; padding: 13px 15px; display: flex; justify-content: space-between; gap: 12px; text-align: left; }
.inventory-alert span { font-weight: 650; }
.inventory-head { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.inventory-head div { display: grid; gap: 4px; }
.inventory-head span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.inventory-head strong { font-size: .92rem; }
.section-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.section-heading h2 { margin: 0 0 3px; }
.section-heading p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.inventory-section { padding-block: 15px; }
.inventory-row { display: grid; grid-template-columns: minmax(180px,1fr) 160px minmax(160px,.8fr); align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.inventory-copy { display: grid; gap: 2px; }
.inventory-copy strong { font-size: .9rem; }
.inventory-copy span { color: var(--muted); font-size: .78rem; }
.inventory-row select,.inventory-row input { min-height: 40px; padding-block: 8px; }
.form-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; display: grid; gap: 13px; }
.required-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #fff0ee; color: var(--danger); font-size: .74rem; font-weight: 750; white-space: nowrap; }
.photo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.photo-upload { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.photo-upload input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.photo-placeholder { min-height: 116px; border: 1.5px dashed #aab7bc; background: #f7f9f9; border-radius: 12px; display: grid; place-items: center; color: var(--brand-dark); text-align: center; overflow: hidden; }
.photo-placeholder img { width: 100%; height: 88px; object-fit: cover; }
.photo-placeholder em { font-style: normal; font-size: .72rem; padding: 4px; }
.signature-wrap { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.signature-pad { width: 100%; height: 150px; display: block; touch-action: none; }
.signature-wrap > span { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; color: #a1aaae; font-size: .74rem; pointer-events: none; }
.legal-copy { color: var(--muted); font-size: .78rem; line-height: 1.45; margin: 0; }
.segmented { display: flex; gap: 8px; padding: 5px; border: 1px solid var(--line); background: #fff; border-radius: 14px; width: fit-content; max-width: 100%; margin-bottom: 18px; }
.segmented button { border: 0; background: transparent; border-radius: 10px; padding: 10px 13px; font-weight: 700; white-space: nowrap; }
.segmented button.active { background: var(--brand); color: #173139; }
.tariff-layout { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(3,minmax(150px,1fr)); gap: 12px; }
.price-result { margin-top: 18px; border-radius: 16px; padding: 20px; background: var(--text); color: #fff; display: grid; gap: 4px; }
.price-result span,.price-result small { color: #cbd3d6; }
.price-result strong { font-size: 2.1rem; line-height: 1.1; }
.price-list { max-height: 410px; overflow: auto; display: grid; }
.price-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 11px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.price-list > div.selected { background: var(--surface-soft); color: var(--brand-dark); }
.compact-table { display: grid; }
.compact-table > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.compact-table > div:last-child { border-bottom: 0; }
.compact-table small { grid-column: 1 / -1; color: var(--muted); }
.installer-summary,.summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.installer-summary article,.summary-grid article { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 4px; }
.installer-summary span,.summary-grid span { color: var(--muted); font-size: .82rem; }
.installer-summary strong,.summary-grid strong { font-size: 1.7rem; }
.province-grid { display: grid; grid-template-columns: repeat(3,minmax(230px,1fr)); gap: 14px; }
.province-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 15px; }
.province-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.province-card header h2 { margin: 0; }
.province-card header span { color: var(--muted); font-size: .76rem; }
.installer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.installer-row:last-child { border-bottom: 0; }
.status-select { width: auto; min-width: 118px; min-height: 38px; padding-block: 7px; font-size: .8rem; }
.admin-split { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 20px; align-items: start; }
.vehicle-list { display: grid; gap: 10px; }
.vehicle-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; align-items: end; }
.table-action { border: 0; background: var(--surface-soft); color: var(--brand-dark); border-radius: 8px; padding: 7px 9px; font-weight: 700; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(13,20,23,.65); display: grid; place-items: center; padding: 24px; overflow: auto; }
.modal { position: relative; width: min(900px,100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 18px; padding: 28px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.modal-close { position: absolute; right: 18px; top: 14px; border: 0; background: transparent; font-size: 1.7rem; }
.report-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--text); }
.report-header .logo { margin: 0; }
.report-header > div { text-align: right; display: grid; gap: 3px; }
.report-header span { font-size: .76rem; font-weight: 800; letter-spacing: .06em; }
.report-document > h1 { margin-top: 25px; }
.report-document section { margin-top: 24px; }
.report-meta { display: flex; gap: 14px; color: var(--muted); font-size: .84rem; flex-wrap: wrap; }
.report-fields { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.report-fields div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.report-fields dt { color: var(--muted); font-size: .75rem; font-weight: 700; }
.report-fields dd { margin: 3px 0 0; }
.report-photos { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.report-photos figure { margin: 0; }
.report-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.report-photos figcaption { margin-top: 5px; color: var(--muted); font-size: .76rem; }
.signature-image { width: min(320px,100%); max-height: 130px; object-fit: contain; object-position: left center; border-bottom: 1px solid var(--line); }

@media (max-width: 1000px) {
  .province-grid { grid-template-columns: repeat(2,minmax(230px,1fr)); }
  .tariff-layout,.admin-split { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .inventory-head,.photo-grid,.filter-grid,.installer-summary,.summary-grid,.province-grid,.report-fields,.report-photos { grid-template-columns: 1fr; }
  .inventory-row { grid-template-columns: 1fr; }
  .inventory-note.hidden { display: none; }
  .segmented { width: 100%; overflow-x: auto; }
  .vehicle-card { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; }
  .modal { min-height: 100vh; max-height: none; border-radius: 0; padding: 22px 16px; }
}
@media print {
  body { background: #fff; }
  .admin-shell,.no-print,.modal-close { display: none !important; }
  .modal-backdrop { position: static; display: block; padding: 0; background: #fff; }
  .modal { width: 100%; max-height: none; overflow: visible; box-shadow: none; padding: 0; }
  .report-document { display: block; }
}

.cloud-state{align-self:center;border-radius:999px;background:#fff7dc;color:#745600;font-size:.78rem;font-weight:800;padding:.38rem .65rem;white-space:nowrap}
.cloud-state.online{background:#e7f7ee;color:#15633c}
.cloud-state.offline{background:#fff0ee;color:#8a3027}
@media(max-width:560px){.cloud-state{order:3;margin-left:auto}.topbar{flex-wrap:wrap}}
