* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #eef1f5;
    color: #172033;
}

body {
    margin: 0;
    min-height: 100vh;
}

button,
a {
    font: inherit;
}

.app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    padding:
        max(24px, env(safe-area-inset-top))
        18px
        max(24px, env(safe-area-inset-bottom));
    background: #ffffff;
}

.header {
    padding: 12px 2px 24px;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #667085;
}

h1 {
    margin: 0;
    font-size: 29px;
    line-height: 1.1;
}

.actions {
    margin-bottom: 32px;
}

.scan-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #172033;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.18);
}

.scan-button:active {
    transform: scale(0.98);
}

.scan-icon {
    font-size: 22px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 18px;
}

.section-title span {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #eef1f5;
    font-size: 13px;
    font-weight: 800;
}

.empty-state {
    padding: 34px 20px;
    border: 1px dashed #c8ced8;
    border-radius: 18px;
    text-align: center;
    background: #fafbfc;
}

.empty-state p {
    margin: 0 0 6px;
    font-weight: 800;
}

.empty-state span {
    color: #667085;
    font-size: 14px;
}

.mission-card {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
    padding: 18px;
    border: 1px solid #e3e7ed;
    border-radius: 16px;
}

.mission-card strong {
    font-size: 22px;
}

.mission-card span {
    font-weight: 800;
}

.mission-card small {
    color: #667085;
}

@media (min-width: 481px) {
    body {
        padding: 24px;
    }

    .app {
        min-height: calc(100vh - 48px);
        border-radius: 24px;
        box-shadow: 0 16px 45px rgba(23, 32, 51, 0.12);
    }
}
.scan-header {
    margin-bottom: 24px;
}

.back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: #172033;
    font-weight: 800;
    text-decoration: none;
}

.scan-description {
    margin: 12px 0 0;
    color: #667085;
    line-height: 1.5;
}

.scan-form {
    display: grid;
    gap: 18px;
}

.schedule-import-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
}

.schedule-import-scope legend {
    padding: 0 6px;
    font-weight: 700;
}

.schedule-import-scope small {
    flex-basis: 100%;
    color: #667085;
}

.camera-area {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 210px;
    padding: 26px;
    border: 2px dashed #b8c0cc;
    border-radius: 20px;
    background: #fafbfc;
    text-align: center;
    cursor: pointer;
}

.camera-area:active {
    background: #f1f3f6;
}

.camera-symbol {
    font-size: 42px;
}

.camera-area strong {
    font-size: 18px;
}

.camera-area small {
    color: #667085;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.preview-container {
    overflow: hidden;
    border: 1px solid #e3e7ed;
    border-radius: 18px;
    background: #eef1f5;
}

.schedule-import-options{display:grid;gap:16px}.schedule-import-card{gap:12px}.schedule-action{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:72px;box-sizing:border-box;padding:14px 18px;border-radius:14px;text-align:left;cursor:pointer}.schedule-action>span:last-child{display:grid;gap:2px}.schedule-action strong{font-size:18px}.schedule-action small{font-size:13px;font-weight:600}.schedule-action-icon{font-size:26px;line-height:1}.schedule-action-primary{border:1px solid #2563eb;background:#2563eb;color:#fff;box-shadow:0 8px 20px rgba(37,99,235,.2)}.schedule-action-primary small{color:#dbeafe}.schedule-action-secondary{min-height:60px;border:1px solid #b8c8df;background:#fff;color:#172033}.schedule-action-secondary small{color:#667085}.schedule-gallery-action{min-height:44px;border:0;background:transparent;color:#2563eb;font:inherit;font-weight:800;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.visually-hidden-file,.visually-hidden-submit{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.visually-hidden-file:focus+.schedule-action{outline:3px solid rgba(37,99,235,.35);outline-offset:3px}.selected-file-name{margin:0;padding:10px 12px;border-radius:11px;background:#eff6ff;color:#1d4ed8;font-size:13px;font-weight:750;overflow-wrap:anywhere}.schedule-format-help{margin:0;color:#667085;font-size:12px;text-align:center}.schedule-import-scope{display:grid;gap:10px;padding:14px;border:1px solid #d0d5dd;border-radius:14px;background:#fff}.schedule-import-scope legend{padding:0 6px;font-weight:800}.schedule-scope-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}.schedule-scope-options label{position:relative;min-height:48px}.schedule-scope-options input{position:absolute;inset:0;opacity:0}.schedule-scope-options span{display:grid;min-height:48px;place-items:center;box-sizing:border-box;border:1px solid #b8c8df;border-radius:10px;background:#fff;color:#344054;font-weight:800;cursor:pointer}.schedule-scope-options input:checked+span{border-color:#2563eb;background:#eff6ff;color:#1d4ed8}.schedule-scope-options input:focus-visible+span,.schedule-action:focus-visible,.schedule-gallery-action:focus-visible{outline:3px solid rgba(37,99,235,.35);outline-offset:3px}.schedule-import-scope small{color:#667085}.schedule-import-disabled{opacity:.65}.schedule-import-disabled .schedule-action{cursor:not-allowed;box-shadow:none}.schedule-import-disabled .schedule-action-primary{border-color:#b8c0cc;background:#e5e7eb;color:#667085}.schedule-import-disabled .schedule-action-primary small{color:#667085}
.schedule-import-submitting{pointer-events:none;opacity:.72}.schedule-import-submitting .schedule-action{box-shadow:none}

.image-preview {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
}

.schedule-image-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: #fff;
}

.schedule-image-controls .primary-button {
    grid-column: 1 / -1;
    min-height: 48px;
}

.schedule-image-controls .secondary-button {
    min-height: 44px;
    margin: 0;
}

.primary-button {
    min-height: 58px;
    padding: 14px 18px;
    border: 0;
    border-radius: 16px;
    background: #172033;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:disabled {
    background: #b8c0cc;
    cursor: not-allowed;
}

.message {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 700;
}

.error-message {
    background: #fff1f1;
    color: #a82424;
}

.success-message {
    background: #ecf8ef;
    color: #23723a;
}

.warning-message {
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.schedule-import-disabled .excel-import-action {
    border-color: #b8c0cc;
    background: #e5e7eb;
    color: #667085;
    box-shadow: none;
    cursor: not-allowed;
}

.schedule-import-disabled .excel-import-action small {
    color: #667085;
}

.schedule-import-disabled input:disabled,
.schedule-import-disabled button:disabled {
    cursor: not-allowed;
}
.review-image-container {
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e3e7ed;
    border-radius: 18px;
    background: #eef1f5;
}

.review-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.full-width {
    width: 100%;
}

.secondary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-top: 12px;
    padding: 14px 18px;
    border: 1px solid #d7dce3;
    border-radius: 16px;
    color: #172033;
    font-weight: 800;
    text-decoration: none;
}
.review-image-container {
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e3e7ed;
    border-radius: 18px;
    background: #eef1f5;
}

.review-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.processed-result {
    margin-top: 24px;
}

.full-width {
    width: 100%;
}

.secondary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-top: 12px;
    padding: 14px 18px;
    border: 1px solid #d7dce3;
    border-radius: 16px;
    color: #172033;
    font-weight: 800;
    text-decoration: none;
}

/* Phase 2: operational mission list and detail */
.home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.compact-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: #1f5eff;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.mission-section { margin-bottom: 28px; }
.mission-list, .operation-list { display: grid; gap: 9px; }

.mission-row {
    display: grid;
    grid-template-columns: 1.25fr 1fr .9fr .9fr .55fr;
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid #e3e7ed;
    border-radius: 14px;
    color: #172033;
    text-decoration: none;
    background: #fff;
}

.mission-row strong { font-size: 15px; }
.mission-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #566176; }
.mission-row-closed { background: #f5f7fa; }
.mission-row .closed-label { color: #23723a; font-weight: 900; }
.compact-empty { padding: 22px 16px; }

.detail-header { padding: 8px 2px 22px; }
.detail-header .back-link { margin-bottom: 20px; }
.mission-title-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mission-title-line h1 { font-size: 30px; }
.mission-summary { margin: 8px 0 16px; color: #667085; font-weight: 700; }
.mission-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mission-facts span { padding: 10px; border-radius: 12px; background: #f2f4f7; font-size: 12px; color: #667085; }
.mission-facts strong { display: block; margin-top: 3px; color: #172033; font-size: 15px; }
.status-badge { padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.status-closed { background: #e8f7ec; color: #23723a; }
.status-cancelled { background: #fff0f0; color: #a82424; }

.operation-row {
    display: grid;
    grid-template-columns: 28px 1fr auto 18px;
    gap: 8px;
    align-items: center;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid #e3e7ed;
    border-radius: 13px;
    color: #172033;
    text-decoration: none;
}
.operation-state { font-size: 21px; color: #98a2b3; }
.operation-state.complete { color: #23723a; }
.operation-state.started { color: #1f5eff; }
.operation-name { font-weight: 800; }
.operation-status { font-size: 11px; color: #667085; text-transform: uppercase; }
.chevron { color: #98a2b3; font-size: 24px; }

.add-operation-panel{margin-top:14px}
.add-operation-panel summary{min-height:48px;padding:13px 15px;border:1px solid #2563eb;border-radius:13px;cursor:pointer;font-weight:900;list-style:none;background:#2563eb;color:#fff}
.add-operation-panel summary::-webkit-details-marker{display:none}
.add-operation-list{display:grid;gap:7px;margin-top:8px;padding:8px;border-radius:13px;background:#eff6ff}
.add-operation-list button{width:100%;min-height:44px;padding:10px 12px;border:1px solid #bfdbfe;border-radius:10px;background:#fff;color:#2563eb;font-weight:800;text-align:left;cursor:pointer}
.add-operation-list button:hover{background:#eff6ff}

.timeline-preview { display: grid; gap: 12px; }
.timeline-item { padding-left: 13px; border-left: 3px solid #dce2ea; }
.timeline-item time { display: block; margin-bottom: 3px; color: #667085; font-size: 11px; }
.timeline-item strong { font-size: 14px; }
.muted-text { color: #667085; }

@media (max-width: 430px) {
    .home-header { align-items: center; }
    .home-header h1 { font-size: 25px; }
    .compact-action { padding: 9px 11px; font-size: 12px; }
    .mission-row { grid-template-columns: 1.2fr .85fr .8fr .55fr; }
    .mission-row span:nth-of-type(3) { display: none; }
}

.worker-list,.worker-picker{display:grid;gap:10px}.worker-row,.worker-pick-form{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border:1px solid #e3e7ed;border-radius:14px;background:#fff}.worker-row>div{display:grid;gap:4px}.worker-row small{color:#667085}.icon-button{width:44px;height:44px;border:0;border-radius:12px;background:#f4f5f7;cursor:pointer}.search-form{display:flex;gap:8px;margin-bottom:14px}.search-form input,.worker-create-form input,.reopen-form input,.worker-pick-form select{width:100%;min-height:48px;padding:11px 12px;border:1px solid #cfd5de;border-radius:12px;background:#fff}.search-form button,.worker-pick-form button{min-width:48px;min-height:48px;border:0;border-radius:12px;background:#172033;color:#fff;font-weight:800}.worker-pick-form{display:grid;grid-template-columns:1fr auto}.worker-pick-form select{grid-column:1/2}.worker-pick-form button{grid-column:2;grid-row:1/3}.worker-create-form{display:grid;gap:12px}.operation-actions{padding-top:8px}.reopen-form{display:grid;gap:12px;margin:18px 0;padding:16px;border:1px solid #e3e7ed;border-radius:16px}.reopen-form label{display:grid;gap:8px;font-weight:800}.muted-text{color:#667085}

/* Phase 4: history, full timeline, printable report and language selector */
.header-actions,.mission-tools,.top-line,.report-toolbar{display:flex;align-items:center;gap:10px}.header-actions{flex-wrap:wrap;justify-content:flex-end}.secondary-compact{background:#eef2f7;color:#172033}.language-switch{display:flex;width:max-content;margin:-8px 0 22px auto;padding:3px;border-radius:10px;background:#eef1f5}.language-switch.small{margin:0}.language-switch a{min-width:38px;padding:7px 9px;border-radius:8px;color:#667085;font-size:12px;font-weight:900;text-align:center;text-decoration:none}.language-switch a.selected{background:#fff;color:#172033;box-shadow:0 1px 4px rgba(23,32,51,.12)}.top-line{justify-content:space-between;margin-bottom:20px}.top-line .back-link{margin:0}.mission-tools{display:grid;grid-template-columns:1fr 1fr;margin-bottom:18px}.tool-button{margin:0;min-height:48px}.text-link{color:#1f5eff;font-size:13px;font-weight:800;text-decoration:none}.timeline-item small{display:block;margin-top:4px;color:#667085;white-space:pre-line}.history-filters{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:26px;padding:16px;border:1px solid #e3e7ed;border-radius:16px}.history-filters label{display:grid;gap:7px;color:#344054;font-size:13px;font-weight:800}.history-filters input{width:100%;min-height:46px;padding:10px 11px;border:1px solid #cfd5de;border-radius:11px;background:#fff}.history-filters button{grid-column:1/-1}.history-list{display:grid;gap:10px}.history-row{display:grid;grid-template-columns:1fr auto 18px;gap:12px;align-items:center;padding:14px;border:1px solid #e3e7ed;border-radius:14px;color:#172033;text-decoration:none}.history-row>div:first-child{display:grid;gap:5px}.history-row span{color:#667085;font-size:12px}.history-meta{display:grid;gap:4px;text-align:right}.print-link{display:flex;align-items:center;justify-content:center;margin-bottom:22px;text-decoration:none}.full-timeline{position:relative;display:grid;gap:0;margin-top:22px}.event-card{position:relative;display:grid;grid-template-columns:20px 1fr;gap:12px;padding-bottom:22px}.event-card:before{content:"";position:absolute;left:6px;top:15px;bottom:-4px;width:2px;background:#dce2ea}.event-card:last-child:before{display:none}.event-marker{position:relative;z-index:1;width:14px;height:14px;margin-top:4px;border:3px solid #1f5eff;border-radius:50%;background:#fff}.event-content{padding:15px;border:1px solid #e3e7ed;border-radius:15px;background:#fff}.event-content time{color:#667085;font-size:11px}.event-content h2{margin:5px 0 12px;font-size:17px}.event-content dl{display:grid;gap:9px;margin:0}.event-content dl div{display:grid;grid-template-columns:100px 1fr;gap:10px}.event-content dt{color:#667085;font-size:12px;font-weight:800}.event-content dd{margin:0;font-size:13px}.preserve-lines{white-space:pre-line}.event-uid{display:block;margin-top:13px;color:#98a2b3;font-family:monospace;font-size:9px}.report-body{background:#e9edf2}.report-toolbar{position:sticky;top:0;z-index:3;justify-content:center;padding:12px;background:rgba(233,237,242,.94);backdrop-filter:blur(8px)}.report-page{width:min(900px,calc(100% - 28px));margin:18px auto 40px;padding:42px;background:#fff;box-shadow:0 8px 30px rgba(23,32,51,.12)}.report-header{padding-bottom:24px;border-bottom:2px solid #172033}.report-header h1{margin:6px 0 8px;font-size:30px}.report-header p:last-child{color:#667085;font-size:12px}.report-mission-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;margin:24px 0;background:#dce2ea;border:1px solid #dce2ea}.report-mission-grid div{display:grid;gap:5px;padding:12px;background:#fff}.report-mission-grid span{color:#667085;font-size:10px;font-weight:800;text-transform:uppercase}.report-mission-grid strong{font-size:14px}.report-remarks{margin-bottom:24px;padding:16px;border:1px solid #dce2ea}.report-remarks h2,.report-events>h2{margin:0 0 12px;font-size:18px}.report-remarks p{margin:0;white-space:pre-line}.report-event{display:grid;grid-template-columns:145px 1fr;gap:18px;padding:16px 0;border-top:1px solid #dce2ea;break-inside:avoid}.report-event-time{font-size:11px;font-weight:800}.report-event h3{margin:0 0 8px;font-size:15px}.report-event p{margin:4px 0;font-size:12px}.report-event small{color:#98a2b3;font-family:monospace;font-size:8px}
@media(max-width:560px){.header-actions{display:grid}.mission-tools{grid-template-columns:1fr}.history-filters{grid-template-columns:1fr}.history-filters button{grid-column:auto}.history-row{grid-template-columns:1fr 18px}.history-meta{grid-column:1;text-align:left}.history-row>.chevron{grid-column:2;grid-row:1/3}.event-content dl div{grid-template-columns:1fr;gap:2px}.report-page{width:100%;margin:0;padding:22px}.report-mission-grid{grid-template-columns:1fr 1fr}.report-event{grid-template-columns:1fr;gap:5px}}
@media print{.no-print{display:none!important}.report-body{background:#fff}.report-page{width:100%;margin:0;padding:0;box-shadow:none}.report-header{margin-top:0}@page{size:A4;margin:14mm}}


/* Phase 5 administration */
.admin-shell{padding-bottom:40px}.admin-grid{display:grid;gap:12px}.admin-card,.admin-link{display:flex;text-decoration:none;color:inherit}.admin-card{min-height:72px;align-items:center;padding:18px;border-radius:18px;background:#fff;font-weight:800;box-shadow:0 8px 24px rgba(23,32,51,.08)}.admin-form{display:grid;gap:12px;margin:18px 0 24px}.admin-form input,.admin-form select,.inline-edit input{width:100%;min-height:46px;padding:10px 12px;border:1px solid #d0d5dd;border-radius:12px;background:#fff;font:inherit}.admin-form label{display:grid;gap:7px;font-weight:700}.row-form{grid-template-columns:1fr auto;align-items:end}.admin-list{display:grid;gap:10px}.admin-item{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px;border-radius:16px;background:#fff;box-shadow:0 5px 18px rgba(23,32,51,.07)}.admin-item small{display:block;margin-top:4px;color:#667085}.inline-edit{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;flex:1}.secondary-button,.inline-edit button{min-height:44px;padding:9px 13px;border:0;border-radius:12px;background:#e9eef7;font-weight:800}.item-inactive{opacity:.58}.status-pill{padding:6px 9px;border-radius:999px;background:#eef4ff;font-size:12px}.check-list{display:grid;gap:8px}.check-row{display:flex!important;grid-template-columns:none!important;align-items:center;gap:10px;padding:12px;border-radius:12px;background:#fff}.check-row input{width:22px!important;min-height:22px!important}.admin-shell hr{border:0;border-top:1px solid #e4e7ec;margin:28px 0}@media(max-width:560px){.row-form,.inline-edit{grid-template-columns:1fr}.admin-item{align-items:stretch;flex-direction:column}}
.auth-shell{min-height:100vh;display:grid;place-items:center;padding:24px}.auth-card{width:min(420px,100%);background:#fff;border:1px solid #e5e7eb;border-radius:22px;padding:28px;box-shadow:0 18px 45px rgba(15,23,42,.08)}.form-error{padding:12px;border-radius:12px;background:#fff1f2;color:#be123c}.form-success{padding:12px;border-radius:12px;background:#ecfdf5;color:#047857}.profile-card{display:flex;flex-direction:column;gap:4px;padding:18px;border:1px solid #e5e7eb;border-radius:16px;background:#fff;margin-bottom:18px}.danger-button{min-height:44px;border:0;border-radius:12px;padding:0 18px;background:#b42318;color:#fff;font-weight:700}


.admin-action-panel { margin-top: 12px; border: 1px solid #d9dee8; border-radius: 14px; padding: 12px; background: #fff; }
.admin-action-panel summary { cursor: pointer; font-weight: 700; }
.stack-form { display: grid; gap: 12px; margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stack-form label { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; }
.stack-form input, .stack-form textarea { width: 100%; box-sizing: border-box; border: 1px solid #cdd3df; border-radius: 10px; padding: 11px; font: inherit; }
.stack-form textarea { min-height: 88px; resize: vertical; }
.danger-panel { border-color: #e7b8b8; }
.danger-button { border: 0; border-radius: 12px; padding: 12px 16px; background: #b42318; color: #fff; font-weight: 700; cursor: pointer; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }


/* Fase 8: cambio operativo de Spot */
.spot-change-panel {
    margin-top: 12px;
}
.spot-change-panel summary {
    cursor: pointer;
    color: var(--primary, #0a66c2);
    font-weight: 700;
}
.spot-change-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: stretch;
}
.spot-change-form input {
    min-width: 0;
    flex: 1;
    text-transform: uppercase;
}
.spot-change-form button {
    width: auto;
    white-space: nowrap;
}
@media (max-width: 520px) {
    .spot-change-form {
        flex-direction: column;
    }
    .spot-change-form button {
        width: 100%;
    }
}

/* Phase 9: enhanced history and printable filtered report */
.history-actions {
    display: flex;
    gap: 10px;
    margin: 12px 0 20px;
}
.history-actions > * { flex: 1; text-align: center; }
.history-row small { display: block; margin-top: 4px; color: var(--secondary-text, #6b7280); }
.history-report-page { max-width: 1180px; }
.history-report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-report-table th,
.history-report-table td { border: 1px solid #d1d5db; padding: 7px; text-align: left; vertical-align: top; }
.history-report-table th { background: #f3f4f6; font-weight: 700; }
@media (max-width: 700px) {
    .history-actions { flex-direction: column; }
}
@media print {
    .history-report-table { font-size: 9px; }
    .history-report-table th,
    .history-report-table td { padding: 4px; }
    .history-report-page { max-width: none; margin: 0; padding: 0; box-shadow: none; }
}


/* Sprint: progreso y tiempos operativos */
.mission-progress-inline{display:flex;align-items:center;gap:8px;min-width:120px}.mission-progress-inline b{font-size:.78rem}.mission-progress-track{display:block;overflow:hidden;height:7px;flex:1;border-radius:999px;background:#e4e9f0}.mission-progress-track>span{display:block;height:100%;border-radius:inherit;background:#0a66c2}.mission-progress-card{display:grid;gap:8px;margin-top:14px;padding:12px;border:1px solid #dce2ea;border-radius:14px;background:#fff}.mission-progress-card>div:first-child{display:flex;justify-content:space-between}.mission-progress-card small{color:#667085}.mission-progress-track.large{height:10px}.operation-time-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}.operation-time-summary>div{display:grid;gap:4px;padding:11px;border:1px solid #dce2ea;border-radius:12px;background:#fff}.operation-time-summary span{font-size:.75rem;color:#667085}.operation-time-summary strong{font-size:1rem}@media(max-width:640px){.mission-row{grid-template-columns:1fr 1fr}.mission-progress-inline{grid-column:1/-1;width:100%}.operation-time-summary{grid-template-columns:1fr}.mission-progress-card{margin-bottom:4px}}

.schedule-success-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.10);
}
.schedule-success-banner span {
    font-size: 0.9rem;
    opacity: 0.82;
}


/* Sprint de consolidación operativa */
.mission-progress-values{display:grid;min-width:42px;text-align:right;line-height:1.05}
.mission-progress-values small{margin-top:3px;color:#667085;font-size:.68rem;font-weight:700}
.operation-time-summary .duration-cell{background:#f5f8ff;border-color:#cbd8f5}
.operation-time-summary .duration-cell strong{font-size:1.1rem}
@media(max-width:640px){
  .mission-progress-inline{align-items:center}
  .mission-progress-values{min-width:48px}
  .operation-time-summary>div{grid-template-columns:1fr auto;align-items:center}
  .operation-time-summary>div span{font-size:.8rem}
  .operation-time-summary>div strong{font-size:1.05rem}
}

/* Sprint: operativa móvil */
.mission-compact-header,.operation-compact-header{padding-bottom:14px}
.mission-title-progress-line{align-items:flex-start;gap:14px}
.mission-title-progress-line>div:first-child{min-width:0}
.mission-progress-badge{display:grid;flex:0 0 auto;min-width:62px;padding:8px 10px;border:1px solid #d7e1f5;border-radius:14px;background:#f5f8ff;text-align:center}
.mission-progress-badge strong{color:#0a66c2;font-size:1rem;line-height:1.1}
.mission-progress-badge small{margin-top:3px;color:#667085;font-size:.7rem;font-weight:800}
.mission-facts-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.mission-facts-grid span{display:grid;gap:3px;padding:10px;border:1px solid #e1e6ed;border-radius:12px;background:#fff}
.mission-facts-grid small{color:#667085;font-size:.68rem;font-weight:800;letter-spacing:.03em}
.mission-facts-grid strong{overflow:hidden;font-size:.95rem;text-overflow:ellipsis;white-space:nowrap}
.inline-spot-panel{margin-top:10px}
.compact-tools{margin-top:10px}
.operation-card-list{display:grid;gap:9px}
.operation-card{display:grid;grid-template-columns:34px minmax(0,1fr) 18px;gap:10px;align-items:center;min-height:64px;padding:10px 12px;border:1px solid #e1e6ed;border-radius:16px;background:#fff;color:inherit;text-decoration:none;box-shadow:0 4px 14px rgba(23,32,51,.045)}
.operation-card-content{display:grid;gap:3px;min-width:0}
.operation-card-content strong{overflow:hidden;font-size:.96rem;text-overflow:ellipsis;white-space:nowrap}
.operation-card-content small{color:#667085;font-size:.76rem;font-weight:700}
.operation-card-complete{border-color:#cbe8d7;background:#f7fcf9}
.operation-card-started{border-color:#cbd8f5;background:#f5f8ff}
.operation-card-pending{background:#fff}
.operation-card .operation-state{display:grid;width:30px;height:30px;place-items:center;border-radius:50%;background:#f0f2f5;color:#667085;font-weight:900}
.operation-card .operation-state.complete{background:#dcf5e6;color:#147a43}
.operation-card .operation-state.started{background:#e2ebff;color:#0a66c2}
.status-started{background:#e2ebff;color:#0a66c2}
.operation-time-hero{margin-top:16px}
.worker-section-card,.add-worker-mobile-section{border:1px solid #e1e6ed;border-radius:18px;background:#fff}
.worker-list-mobile{display:grid;gap:8px}
.worker-list-mobile .worker-row{border:1px solid #e8ebf0;border-radius:13px;background:#fafbfc}
.worker-picker-mobile{display:grid;gap:8px}
.worker-picker-mobile .worker-pick-form{border:1px solid #e1e6ed;border-radius:14px;background:#fff}
.worker-picker-mobile .worker-pick-form>strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.worker-picker-mobile select{min-height:44px}
.operation-actions-sticky{position:sticky;bottom:0;z-index:4;margin:0 -14px;padding:12px 14px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #dfe4eb;background:rgba(246,248,251,.94);backdrop-filter:blur(12px)}
.operation-mobile-shell{padding-bottom:0}

@media(max-width:640px){
  .mission-mobile-shell,.operation-mobile-shell{padding-left:12px;padding-right:12px}
  .mission-title-progress-line h1,.operation-compact-header h1{font-size:1.65rem;line-height:1.08}
  .mission-summary{margin-top:4px}
  .mission-facts-grid{gap:6px}
  .mission-facts-grid span{padding:9px 8px}
  .compact-tools{grid-template-columns:1fr 1fr;gap:8px}
  .compact-tools .secondary-button{min-height:46px;margin-top:0;padding:10px 8px;font-size:.82rem}
  .operations-mobile-section{padding-top:14px}
  .operation-time-hero{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .operation-time-hero>div{display:grid;grid-template-columns:1fr;gap:4px;padding:10px 8px;text-align:center}
  .operation-time-hero>div span{font-size:.68rem}
  .operation-time-hero>div strong{font-size:1.05rem}
  .worker-search-mobile{grid-template-columns:minmax(0,1fr) auto}
  .worker-search-mobile input{min-width:0}
  .worker-picker-mobile .worker-pick-form{grid-template-columns:minmax(0,1fr) auto}
  .worker-picker-mobile .worker-pick-form select{grid-column:1/-1;grid-row:2}
  .worker-picker-mobile .worker-pick-form button{grid-column:2;grid-row:1}
}

/* Carga y descarga: horas visibles directamente en la tarjeta */
.operation-card:has(.operation-card-times){align-items:start;min-height:92px}
.operation-card-times{display:grid;gap:2px;margin-top:5px;color:#475467;font-size:.74rem;font-weight:500}
.operation-card-times span{display:block;white-space:normal}
.operation-card-times b{color:#344054;font-weight:700}
@media(max-width:640px){.operation-card:has(.operation-card-times){min-height:108px}.operation-card-times{font-size:.78rem;line-height:1.35}}

/* ================================================================
   COVERING MY ASS — DESIGN SYSTEM / HOME V2
   Scoped styles: the rest of the application keeps its current UI.
   ================================================================ */
:root {
    --cma-bg: #eef2f7;
    --cma-surface: #ffffff;
    --cma-surface-soft: #f8fafc;
    --cma-text: #111827;
    --cma-text-secondary: #667085;
    --cma-border: #e4e9f0;
    --cma-primary: #2563eb;
    --cma-primary-dark: #1d4ed8;
    --cma-success: #16a34a;
    --cma-warning: #f59e0b;
    --cma-danger: #dc2626;
    --cma-radius-sm: 10px;
    --cma-radius-md: 14px;
    --cma-radius-lg: 20px;
    --cma-shadow-card: 0 8px 28px rgba(15, 23, 42, 0.07);
    --cma-shadow-action: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.home-screen {
    background: var(--cma-bg);
    color: var(--cma-text);
}

.home-app {
    max-width: 760px;
    padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
    background: transparent;
}

.home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0 22px;
}

.brand-block,
.profile-chip,
.quick-action,
.mission-card-head,
.progress-meta,
.section-heading-row,
.recent-mission-card {
    display: flex;
    align-items: center;
}

.brand-block {
    min-width: 0;
    gap: 10px;
}

.brand-mark {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: var(--cma-text);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
}

.brand-name,
.brand-context,
.home-kicker,
.home-summary,
.section-overline {
    margin: 0;
}

.brand-name {
    overflow: hidden;
    color: var(--cma-text);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-context {
    margin-top: 2px;
    color: var(--cma-text-secondary);
    font-size: 12px;
}

.profile-chip {
    min-width: 0;
    gap: 8px;
    padding: 6px 8px 6px 6px;
    border: 1px solid var(--cma-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: var(--cma-text);
    text-decoration: none;
    backdrop-filter: blur(12px);
}

.profile-avatar {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: #e8efff;
    color: var(--cma-primary);
    font-size: 13px;
    font-weight: 900;
}

.profile-copy {
    display: none;
    min-width: 0;
}

.profile-copy strong,
.profile-copy small {
    display: block;
    overflow: hidden;
    max-width: 150px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy strong { font-size: 12px; }
.profile-copy small { margin-top: 1px; color: var(--cma-text-secondary); font-size: 10px; }

.home-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0 22px;
}

.home-kicker,
.section-overline {
    color: var(--cma-primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
}

.home-hero h1 {
    margin-top: 5px;
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.02;
    letter-spacing: -.035em;
}

.home-summary {
    margin-top: 8px;
    color: var(--cma-text-secondary);
    font-size: 14px;
}

.home-language {
    position: static;
    flex: 0 0 auto;
    margin: 0;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 28px;
}

.quick-action {
    min-height: 68px;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--cma-border);
    border-radius: var(--cma-radius-md);
    background: rgba(255, 255, 255, .9);
    color: var(--cma-text);
    text-decoration: none;
    box-shadow: 0 3px 14px rgba(15, 23, 42, .035);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.quick-action:active { transform: scale(.975); }
.quick-action:hover { border-color: #cdd7e6; box-shadow: var(--cma-shadow-card); }

.quick-action-primary {
    border-color: transparent;
    background: var(--cma-primary);
    color: #fff;
    box-shadow: var(--cma-shadow-action);
}

.quick-action-primary:hover { border-color: transparent; background: var(--cma-primary-dark); }

.quick-action-icon {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: var(--cma-surface-soft);
    color: var(--cma-primary);
    font-size: 21px;
}

.quick-action-primary .quick-action-icon {
    background: rgba(255,255,255,.16);
    color: #fff;
}

.quick-action strong,
.quick-action small { display: block; }
.quick-action strong { font-size: 13px; line-height: 1.25; }
.quick-action small { margin-top: 3px; color: var(--cma-text-secondary); font-size: 11px; }
.quick-action-primary small { color: rgba(255,255,255,.72); }

.modern-success {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    padding: 13px 14px;
    border: 1px solid #ccebd5;
    border-radius: var(--cma-radius-md);
    background: #f0fbf3;
    color: #166534;
}

.modern-success .success-symbol {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #dcfce7;
    font-weight: 900;
}

.modern-success strong,
.modern-success small { display: block; }
.modern-success strong { font-size: 13px; }
.modern-success small { margin-top: 3px; color: #3f6f4c; font-size: 11px; line-height: 1.45; }

.home-mission-section,
.home-recent-section { margin-top: 0; }

.section-heading-row {
    justify-content: space-between;
    margin-bottom: 13px;
}

.section-heading-row h2 {
    margin: 3px 0 0;
    font-size: 19px;
    letter-spacing: -.02em;
}

.count-badge {
    display: grid;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    place-items: center;
    border-radius: 999px;
    background: #e8efff;
    color: var(--cma-primary);
    font-size: 13px;
    font-weight: 900;
}

.count-badge.neutral { background: #e9edf3; color: #475467; }

.mission-card-list {
    display: grid;
    gap: 12px;
}

.mission-overview-card {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 17px;
    border: 1px solid var(--cma-border);
    border-radius: var(--cma-radius-lg);
    background: var(--cma-surface);
    color: var(--cma-text);
    text-decoration: none;
    box-shadow: var(--cma-shadow-card);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.mission-overview-card:active { transform: scale(.985); }
.mission-overview-card:hover { border-color: #cfd8e6; box-shadow: 0 12px 34px rgba(15, 23, 42, .1); }

.mission-card-head {
    justify-content: space-between;
    gap: 12px;
    padding-right: 19px;
}

.mission-code {
    color: var(--cma-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
}

.mission-card-head h3 {
    margin: 4px 0 0;
    font-size: 23px;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.spot-pill {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f4f8;
    color: #344054;
    font-size: 11px;
    font-weight: 900;
}

.mission-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 17px 0 15px;
}

.mission-data-grid > span {
    min-width: 0;
    padding: 10px;
    border-radius: var(--cma-radius-sm);
    background: var(--cma-surface-soft);
}

.mission-data-grid small,
.mission-data-grid strong { display: block; }
.mission-data-grid small { color: var(--cma-text-secondary); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.mission-data-grid strong { overflow: hidden; margin-top: 4px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.progress-meta {
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--cma-text-secondary);
    font-size: 11px;
}

.progress-meta strong { color: #344054; font-size: 11px; }

.progress-track {
    display: block;
    overflow: hidden;
    height: 7px;
    border-radius: 999px;
    background: #e9edf3;
}

.progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cma-primary), #4f7df3);
    transition: width .25s ease;
}

.card-open-hint {
    position: absolute;
    top: 18px;
    right: 14px;
    color: #98a2b3;
    font-size: 25px;
    line-height: 1;
}

.home-empty-state {
    display: grid;
    min-height: 160px;
    place-items: center;
    gap: 8px;
    border: 1px dashed #cbd5e1;
    background: rgba(255,255,255,.62);
}

.home-empty-state p { margin: 0; color: var(--cma-text-secondary); font-size: 14px; }
.empty-symbol { color: #98a2b3; font-size: 30px; }

.home-recent-section { margin-top: 30px; }
.recent-mission-list { display: grid; gap: 8px; }

.recent-mission-card {
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid var(--cma-border);
    border-radius: var(--cma-radius-md);
    background: rgba(255,255,255,.72);
    color: var(--cma-text);
    text-decoration: none;
}

.recent-status-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cma-success);
}

.recent-mission-copy { flex: 1; min-width: 0; }
.recent-mission-copy strong,
.recent-mission-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-mission-copy strong { font-size: 13px; }
.recent-mission-copy small { margin-top: 4px; color: var(--cma-text-secondary); font-size: 11px; }

@media (min-width: 560px) {
    .home-app { padding-right: 24px; padding-left: 24px; }
    .profile-copy { display: block; }
    .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mission-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 761px) {
    .home-screen { padding: 28px; }
    .home-app {
        min-height: calc(100vh - 56px);
        border: 1px solid rgba(228, 233, 240, .9);
        border-radius: 28px;
        background: rgba(248, 250, 252, .72);
        box-shadow: 0 18px 60px rgba(15, 23, 42, .08);
    }
}

/* =========================================================
   UI 3 · Administración
   ========================================================= */
.admin-screen { background: var(--cma-background, #eef2f7); }
.admin-modern-shell {
    width: min(100%, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding: max(22px, env(safe-area-inset-top)) 18px max(30px, env(safe-area-inset-bottom));
}
.admin-back { margin-bottom: 20px; color: var(--cma-text, #111827); }
.admin-page-header { margin-bottom: 25px; }
.admin-page-header.compact { margin-bottom: 20px; }
.admin-eyebrow { margin: 0 0 7px; color: var(--cma-primary, #2563eb); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.admin-page-header h1 { margin: 0; font-size: clamp(28px, 8vw, 38px); letter-spacing: -.035em; }
.admin-page-header p:last-child { margin: 9px 0 0; color: var(--cma-text-secondary, #667085); font-size: 14px; line-height: 1.5; }
.admin-dashboard-grid { display: grid; gap: 12px; }
.admin-dashboard-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 86px;
    padding: 15px;
    border: 1px solid var(--cma-border, #e4e9f0);
    border-radius: 18px;
    background: #fff;
    color: var(--cma-text, #111827);
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(15,23,42,.045);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.admin-dashboard-card:active { transform: scale(.985); }
.admin-dashboard-card:hover { border-color: #cad5e5; box-shadow: 0 10px 28px rgba(15,23,42,.08); }
.admin-card-icon {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: #eaf0ff;
    color: var(--cma-primary, #2563eb);
}
.admin-card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.admin-card-copy { flex: 1; min-width: 0; }
.admin-card-copy strong, .admin-card-copy small { display: block; }
.admin-card-copy strong { font-size: 15px; }
.admin-card-copy small { margin-top: 4px; color: var(--cma-text-secondary, #667085); font-size: 12px; line-height: 1.35; }
.admin-card-arrow { color: #98a2b3; font-size: 27px; line-height: 1; }
.admin-create-panel, .settings-card, .admin-create-inline {
    margin-bottom: 22px;
    border: 1px solid var(--cma-border, #e4e9f0);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(15,23,42,.04);
}
.admin-create-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 16px;
    color: var(--cma-primary, #2563eb);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}
.admin-create-panel summary::-webkit-details-marker { display: none; }
.admin-create-panel[open] summary { border-bottom: 1px solid var(--cma-border, #e4e9f0); }
.modern-admin-form { display: grid; gap: 15px; padding: 16px; }
.modern-admin-form label, .admin-create-inline label { display: grid; gap: 7px; color: #475467; font-size: 11px; font-weight: 850; }
.modern-admin-form input, .modern-admin-form select, .admin-create-inline input {
    width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #d8dee8; border-radius: 13px; background: #fbfcfe; color: var(--cma-text, #111827); font: inherit; outline: none;
}
.modern-admin-form input:focus, .modern-admin-form select:focus, .admin-create-inline input:focus { border-color: var(--cma-primary, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-record-list { display: grid; gap: 10px; }
.admin-record-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--cma-border, #e4e9f0);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15,23,42,.035);
}
.admin-record-card.is-inactive { opacity: .62; }
.admin-record-summary { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-avatar { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #edf2ff; color: var(--cma-primary, #2563eb); font-size: 13px; font-weight: 900; text-transform: uppercase; }
.admin-record-copy { min-width: 0; }
.admin-record-copy strong, .admin-record-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-record-copy strong { font-size: 14px; }
.admin-record-copy small { margin-top: 4px; color: var(--cma-text-secondary, #667085); font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #98a2b3; }
.status-dot.active { background: #22c55e; }
.admin-inline-editor { grid-column: 1 / -1; }
.admin-inline-editor summary { color: var(--cma-primary, #2563eb); font-size: 12px; font-weight: 850; cursor: pointer; }
.compact-form { padding: 14px 0 0; }
.admin-status-button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 11px; background: #edf2ff; color: var(--cma-primary, #2563eb); font-size: 11px; font-weight: 900; cursor: pointer; }
.admin-status-button.danger-soft { background: #fff0f1; color: #c62828; }
.admin-role-pill { padding: 7px 10px; border-radius: 999px; background: #f1f4f8; color: #475467; font-size: 10px; font-weight: 900; }
.admin-create-inline { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; padding: 15px; }
.admin-create-inline .primary-button { min-height: 50px; white-space: nowrap; }
.template-card-grid { display: grid; gap: 10px; }
.template-modern-card {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--cma-border, #e4e9f0);
    border-radius: 17px;
    background: #fff;
    color: var(--cma-text, #111827);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(15,23,42,.035);
}
.template-modern-card.is-inactive { opacity: .62; }
.template-aircraft-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: #edf2ff; color: var(--cma-primary, #2563eb); font-size: 20px; }
.template-card-copy strong, .template-card-copy small { display: block; }
.template-card-copy strong { font-size: 15px; }
.template-card-copy small { margin-top: 4px; color: var(--cma-text-secondary, #667085); font-size: 11px; }
.settings-card { overflow: hidden; padding: 0; }
.settings-section { display: grid; gap: 13px; padding: 17px; border-bottom: 1px solid var(--cma-border, #e4e9f0); }
.settings-section-heading { display: flex; align-items: center; gap: 12px; }
.settings-section-heading > span:last-child { min-width: 0; }
.settings-section-heading strong, .settings-section-heading small { display: block; }
.settings-section-heading strong { font-size: 13px; }
.settings-section-heading small { margin-top: 3px; color: var(--cma-text-secondary, #667085); font-size: 11px; line-height: 1.4; }
.settings-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: #edf2ff; color: var(--cma-primary, #2563eb); font-size: 13px; font-weight: 900; }
.number-input-row { display: flex; align-items: center; gap: 9px; }
.number-input-row input { flex: 1; }
.number-input-row span { color: #667085; font-weight: 900; }
.settings-card > .primary-button { margin: 16px; width: calc(100% - 32px); }

@media (min-width: 640px) {
    .admin-dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .template-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 480px) {
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-create-inline { grid-template-columns: 1fr; }
    .admin-record-card { grid-template-columns: minmax(0,1fr); }
    .admin-role-pill { justify-self: start; }
    .admin-status-button { width: 100%; min-height: 46px; }
}

.admin-maintenance-card {
    display: grid;
    gap: 18px;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #f1d2d2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(15,23,42,.045);
}
.admin-maintenance-heading,
.admin-purge-header { display: flex; align-items: flex-start; gap: 13px; }
.admin-maintenance-heading > div,
.admin-purge-header > div { min-width: 0; }
.admin-maintenance-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 13px;
    background: #fff1f2;
    color: #b42318;
    font-size: 18px;
    font-weight: 950;
}
.admin-maintenance-card h2,
.admin-purge-dialog h2 { margin: 0; font-size: 20px; }
.admin-maintenance-card p,
.admin-purge-dialog p { margin: 7px 0 0; color: #667085; line-height: 1.5; }
.admin-maintenance-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 9px;
    margin: 0;
}
.admin-maintenance-counts div {
    padding: 12px 13px;
    border: 1px solid #eef1f5;
    border-radius: 13px;
    background: #f8fafc;
}
.admin-maintenance-counts dt { color: #667085; font-size: 11px; font-weight: 800; }
.admin-maintenance-counts dd { margin: 4px 0 0; color: #101828; font-size: 22px; font-weight: 900; }
.admin-maintenance-empty { padding: 12px; border-radius: 12px; background: #f2f4f7; }
.admin-maintenance-footer { display: grid; gap: 12px; padding-top: 2px; }
.admin-maintenance-footer > span { color: #667085; font-size: 12px; line-height: 1.45; }
.admin-maintenance-footer > .danger-button { width: 100%; min-height: 48px; }
.admin-maintenance-card > .danger-button:disabled { cursor: not-allowed; opacity: .45; }
.admin-maintenance-footer > .danger-button:disabled { cursor: not-allowed; opacity: .45; }
.admin-maintenance-card .form-success { display: grid; gap: 4px; }
.admin-purge-dialog {
    width: min(calc(100% - 28px), 520px);
    max-height: min(86vh, 680px);
    padding: 0;
    border: 0;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(15,23,42,.28);
}
.admin-purge-dialog::backdrop { background: rgba(15,23,42,.62); backdrop-filter: blur(2px); }
.admin-purge-form {
    display: grid;
    gap: 18px;
    max-height: min(86vh, 680px);
    padding: 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.admin-purge-form label { display: grid; gap: 9px; color: #475467; font-size: 13px; font-weight: 800; }
.admin-confirmation-field { padding: 14px; border: 1px solid #fecaca; border-radius: 14px; background: #fff8f8; }
.admin-confirmation-field span { line-height: 1.45; }
.admin-purge-form input {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    font: inherit;
}
.admin-purge-form input:focus { border-color: #dc2626; outline: 3px solid rgba(220,38,38,.12); }
.admin-purge-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-purge-actions button { min-height: 48px; }
.admin-purge-submit:disabled { cursor: not-allowed; opacity: .45; }
@media (max-width: 420px) {
    .admin-purge-dialog { max-height: 92vh; }
    .admin-purge-form { max-height: 92vh; padding: 16px; }
    .admin-purge-actions { grid-template-columns: 1fr; }
    .admin-maintenance-card { padding: 16px; }
    .admin-maintenance-counts { gap: 8px; }
    .admin-maintenance-counts div { padding: 10px; }
}

/* =========================================================
   Sprint UI 5 · Detalle de misión limpio y móvil
   ========================================================= */
.mission-redesign-body {
    margin: 0;
    background: #f7f8fb;
    color: #101828;
}
.mission-redesign-shell {
    width: min(100%, 760px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 14px calc(92px + env(safe-area-inset-bottom));
}
.mission-redesign-topbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    min-height: 68px;
    padding-top: env(safe-area-inset-top);
}
.mission-redesign-topbar > strong {
    text-align: center;
    font-size: 20px;
    letter-spacing: -.02em;
}
.mission-redesign-back {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #101828;
    text-decoration: none;
    font-size: 32px;
    line-height: 1;
}
.mission-overview-card,
.mission-clean-card {
    border: 1px solid #e2e7ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .045);
}
.mission-overview-card { padding: 20px; }
.mission-overview-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 18px;
    align-items: start;
}
.mission-overview-eyebrow {
    display: block;
    margin-bottom: 9px;
    color: #155eef;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.mission-overview-copy h1 {
    overflow-wrap: anywhere;
    margin: 0;
    color: #071838;
    font-size: clamp(29px, 8vw, 44px);
    line-height: 1.02;
    letter-spacing: -.045em;
}
.mission-overview-copy p {
    margin: 13px 0 17px;
    color: #526077;
    font-size: 16px;
}
.mission-state-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    background: #eef3ff;
    color: #155eef;
    font-size: 12px;
    font-weight: 900;
}
.mission-state-pill i { width: 9px; height: 9px; border-radius: 50%; background: #12b76a; }
.mission-state-pill.state-closed { background: #ecfdf3; color: #027a48; }
.mission-state-pill.state-closed i { background: #12b76a; }
.mission-state-pill.state-cancelled { background: #fff1f3; color: #c01048; }
.mission-state-pill.state-cancelled i { background: #f04438; }
.mission-progress-ring {
    --ring-angle: calc(var(--mission-progress) * 3.6deg);
    display: grid;
    width: 108px;
    height: 108px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#155eef 0 var(--ring-angle), #e8ebf0 var(--ring-angle) 360deg);
}
.mission-progress-ring::before {
    content: "";
    grid-area: 1 / 1;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #fff;
}
.mission-progress-ring > div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.mission-progress-ring strong,
.mission-progress-ring small { display: block; }
.mission-progress-ring strong { color: #071838; font-size: 27px; line-height: 1; }
.mission-progress-ring small { margin-top: 8px; color: #667085; font-size: 12px; }
.mission-overview-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e8ecf2;
}
.mission-overview-facts > div {
    min-width: 0;
    padding: 0 14px;
    border-right: 1px solid #e8ecf2;
}
.mission-overview-facts > div:first-child { padding-left: 0; }
.mission-overview-facts > div:last-child { padding-right: 0; border-right: 0; }
.mission-overview-facts span,
.mission-overview-facts strong { display: block; }
.mission-overview-facts span { color: #667085; font-size: 11px; white-space: nowrap; }
.mission-overview-facts strong { overflow: hidden; margin-top: 7px; color: #101828; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.mission-spot-action { margin-top: 20px; }
.mission-spot-action summary {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    min-height: 58px;
    padding: 0 15px;
    border: 1px solid #dbe2ec;
    border-radius: 16px;
    color: #155eef;
    cursor: pointer;
    list-style: none;
}
.mission-spot-action summary::-webkit-details-marker { display: none; }
.mission-spot-action summary > span { font-size: 22px; }
.mission-spot-action summary > b { color: #344054; font-size: 28px; font-weight: 400; }
.mission-spot-action form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-top: 12px; }
.mission-spot-action input { min-width: 0; min-height: 48px; padding: 0 13px; border: 1px solid #d0d5dd; border-radius: 13px; font: inherit; }
.mission-clean-card { margin-top: 14px; padding: 19px; }
.mission-clean-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mission-clean-section-title h2 { margin: 0; color: #101828; font-size: 16px; letter-spacing: .01em; text-transform: uppercase; }
.mission-clean-section-title > span { min-width: 58px; padding: 8px 12px; border-radius: 999px; background: #155eef; color: #fff; text-align: center; font-size: 12px; font-weight: 900; }
.mission-clean-empty { display: grid; justify-items: center; padding: 34px 12px 20px; text-align: center; }
.mission-clean-empty-icon { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 50%; background: #eef3ff; color: #155eef; font-size: 31px; }
.mission-clean-empty > strong { margin-top: 18px; font-size: 18px; }
.mission-clean-empty p { max-width: 390px; margin: 9px 0 0; color: #667085; font-size: 14px; line-height: 1.55; }
.mission-add-operation { margin-top: 19px; }
.mission-add-operation > summary {
    min-height: 56px;
    padding: 0 18px;
    border-radius: 15px;
    background: #155eef;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    line-height: 56px;
    list-style: none;
    text-align: center;
}
.mission-add-operation > summary::-webkit-details-marker { display: none; }
.mission-add-operation > div { display: grid; gap: 8px; padding-top: 10px; }
.mission-add-operation form button { width: 100%; min-height: 48px; border: 1px solid #dbe2ec; border-radius: 13px; background: #fff; color: #101828; font: inherit; font-weight: 750; }
.mission-clean-operation-list { display: grid; gap: 9px; margin-top: 15px; }
.mission-clean-operation {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 68px;
    padding: 12px 13px;
    border: 1px solid #e1e6ee;
    border-radius: 15px;
    color: #101828;
    text-decoration: none;
}
.mission-clean-operation-state { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #fff7e8; color: #b54708; font-weight: 900; }
.mission-clean-operation.is-started .mission-clean-operation-state { background: #eef3ff; color: #155eef; }
.mission-clean-operation.is-complete .mission-clean-operation-state { background: #ecfdf3; color: #027a48; }
.mission-clean-operation-copy strong,
.mission-clean-operation-copy small { display: block; }
.mission-clean-operation-copy small { margin-top: 4px; color: #667085; font-size: 11px; }
.mission-clean-chevron { color: #667085; font-size: 26px; }
.mission-clean-operation-times { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 8px; color: #475467; font-size: 11px; }
.mission-timeline-link {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    color: #101828;
    text-decoration: none;
}
.mission-timeline-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #eef3ff; color: #155eef; font-size: 19px; }
.mission-timeline-link small,
.mission-timeline-link strong { display: block; }
.mission-timeline-link small { color: #667085; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.mission-timeline-link strong { overflow: hidden; margin-top: 5px; color: #475467; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.mission-timeline-link > b { color: #344054; font-size: 28px; font-weight: 400; }
.mission-admin-card { padding: 0; overflow: hidden; }
.mission-admin-card summary { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 17px; cursor: pointer; list-style: none; font-weight: 800; }
.mission-admin-card summary::-webkit-details-marker { display: none; }
.mission-admin-card details[open] > summary { border-bottom: 1px solid #e8ecf2; }
.mission-admin-card form { padding: 16px; }
.mission-cancel-action { border-top: 1px solid #e8ecf2; }
.mission-cancel-action > summary { color: #c01048; }
.mission-reopen-card form { display: grid; gap: 12px; }
.mission-mobile-nav {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid #e4e7ec;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
}
.mission-mobile-nav a {
    display: grid;
    flex: 1 1 0;
    max-width: 125px;
    justify-items: center;
    gap: 3px;
    padding: 4px 2px;
    color: #667085;
    text-decoration: none;
    font-size: 18px;
}
.mission-mobile-nav a span { font-size: 9px; }
.mission-mobile-nav a.is-current { color: #155eef; }

@media (max-width: 620px) {
    .mission-redesign-shell { padding-right: 10px; padding-left: 10px; }
    .mission-overview-card { padding: 17px; border-radius: 19px; }
    .mission-overview-heading { grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; }
    .mission-progress-ring { width: 88px; height: 88px; }
    .mission-progress-ring::before { width: 70px; height: 70px; }
    .mission-progress-ring strong { font-size: 22px; }
    .mission-progress-ring small { margin-top: 5px; font-size: 10px; }
    .mission-overview-copy h1 { font-size: clamp(28px, 9.5vw, 39px); }
    .mission-overview-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
    .mission-overview-facts > div { padding: 13px 10px; border-right: 1px solid #e8ecf2; border-bottom: 1px solid #e8ecf2; }
    .mission-overview-facts > div:nth-child(2n) { border-right: 0; }
    .mission-overview-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
    .mission-overview-facts > div:first-child { padding-left: 10px; }
    .mission-overview-facts > div:last-child { padding-right: 10px; }
    .mission-overview-facts span { font-size: 10px; }
    .mission-overview-facts strong { font-size: 14px; }
    .mission-spot-action form { grid-template-columns: 1fr; }
    .mission-clean-card { padding: 16px; border-radius: 18px; }
}

@media (min-width: 761px) {
    .mission-mobile-nav { left: 50%; width: 760px; transform: translateX(-50%); border-right: 1px solid #e4e7ec; border-left: 1px solid #e4e7ec; }
}

/* ==========================================================
   MOBILE UI FIX — operación, historial y cabecera de misión
   ========================================================== */
.mobile-ui-body {
    margin: 0;
    background: #f3f5f9;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.mobile-ui-body * { box-sizing: border-box; }

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 56px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #e5e7eb;
    backdrop-filter: blur(14px);
}
.mobile-topbar > strong { font-size: 17px; }
.mobile-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    color: #155eef;
    text-decoration: none;
    font-weight: 650;
    font-size: 15px;
}
.topbar-placeholder { justify-self: end; }

/* Mission title: compact and always one line on mobile */
.mission-overview-copy h1 {
    max-width: min(100%, 270px) !important;
    margin: 5px 0 8px !important;
    font-size: clamp(24px, 7.3vw, 34px) !important;
    line-height: 1.02 !important;
    letter-spacing: -.035em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.mission-overview-copy p { margin-top: 0 !important; }
@media (max-width: 390px) {
    .mission-overview-card { padding: 18px 16px !important; }
    .mission-progress-ring { width: 82px !important; height: 82px !important; flex: 0 0 82px !important; }
    .mission-progress-ring strong { font-size: 25px !important; }
    .mission-overview-facts { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* Operation detail */
.operation-v2-shell {
    width: min(100%, 620px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 12px calc(104px + env(safe-area-inset-bottom));
}
.operation-v2-summary,
.operation-v2-card {
    margin-top: 12px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 20px;
    box-shadow: 0 5px 22px rgba(15, 23, 42, .045);
}
.operation-v2-title-copy { min-width: 0; }
.operation-v2-title-copy small {
    display: block;
    overflow: hidden;
    color: #155eef;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.operation-v2-title-copy h1 {
    margin: 5px 0 9px;
    font-size: 31px;
    line-height: 1.05;
    letter-spacing: -.035em;
}
.operation-status-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
}
.operation-status-pill.is-pending { background: #fff0ce; color: #7a4a00; }
.operation-status-pill.is-started { background: #dbeafe; color: #164da7; }
.operation-status-pill.is-completed { background: #dcfce7; color: #126c35; }
.operation-v2-times {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 0;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e6eaf0;
}
.operation-v2-times > div { min-width: 0; padding: 0 11px; border-left: 1px solid #e6eaf0; }
.operation-v2-times > div:first-child { padding-left: 0; border-left: 0; }
.operation-v2-times span { display: block; color: #64748b; font-size: 11px; line-height: 1.25; }
.operation-v2-times strong { display: block; margin-top: 5px; font-size: 17px; white-space: nowrap; }
.operation-v2-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.operation-v2-section-heading h2 { margin: 0; font-size: 19px; }
.operation-v2-section-heading > span { min-width: 34px; padding: 5px 10px; border-radius: 999px; background: #eaf0ff; color: #155eef; text-align: center; font-size: 13px; font-weight: 800; }
.operation-v2-empty { display: grid; gap: 5px; min-height: 92px; place-content: center; padding: 18px; border: 1px dashed #ccd5e3; border-radius: 16px; text-align: center; }
.operation-v2-empty strong { font-size: 15px; }
.operation-v2-empty span { color: #64748b; font-size: 13px; }
.operation-v2-assigned-list, .operation-v2-worker-picker { display: grid; }
.operation-v2-assigned-row, .operation-v2-worker-row {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    border-top: 1px solid #edf0f5;
}
.operation-v2-assigned-row:first-child, .operation-v2-worker-row:first-child { border-top: 0; }
.worker-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #edf3ff; color: #155eef; font-size: 13px; font-weight: 800; }
.worker-copy { min-width: 0; display: grid; gap: 2px; }
.worker-copy strong, .operation-v2-worker-row > strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.worker-copy small { color: #64748b; font-size: 12px; }
.worker-remove-button, .worker-add-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #d6dde8;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: 22px;
}
.operation-v2-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-bottom: 9px; }
.operation-v2-search input, .operation-v2-worker-row select {
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #cfd7e3;
    border-radius: 11px;
    background: #fff;
    font: inherit;
    font-size: 14px;
}
.operation-v2-search button { min-height: 44px; padding: 0 15px; border: 0; border-radius: 11px; background: #eaf0ff; color: #1246a3; font-weight: 750; }
.operation-v2-worker-row { grid-template-columns: 34px minmax(0,1fr) minmax(122px, .85fr) 38px; }
.operation-v2-no-results { color: #64748b; }
.operation-v2-sticky-action {
    position: fixed;
    z-index: 25;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px max(12px, calc((100vw - 620px)/2 + 12px)) calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #f3f5f9 78%, rgba(243,245,249,0));
}
.operation-v2-sticky-action form { margin: 0; }
.operation-v2-sticky-action button { width: 100%; min-height: 54px; border: 0; border-radius: 15px; background: #155eef; color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 8px 20px rgba(21,94,239,.25); }

/* History mobile-first */
.history-v2-shell { width: min(100%, 720px); min-height: 100vh; margin: 0 auto; padding: 0 12px 34px; }
.history-v2-heading { padding: 22px 4px 13px; }
.history-v2-heading > span { color: #155eef; font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.history-v2-heading h1 { margin: 4px 0 2px; font-size: 30px; letter-spacing: -.035em; }
.history-v2-heading p { margin: 0; color: #64748b; font-size: 14px; }
.history-v2-controls, .history-v2-results { margin-top: 10px; }
.history-v2-search-row { display: grid; grid-template-columns: minmax(0,1fr) 48px; gap: 8px; }
.history-v2-search { display: grid; grid-template-columns: 25px minmax(0,1fr); align-items: center; height: 48px; padding: 0 12px; border: 1px solid #d3dae5; border-radius: 14px; background: #fff; }
.history-v2-search > span { color: #64748b; font-size: 22px; }
.history-v2-search input { min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; }
.history-v2-filter { position: relative; }
.history-v2-filter > summary { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid #d3dae5; border-radius: 14px; background: #fff; color: #155eef; font-size: 20px; cursor: pointer; list-style: none; }
.history-v2-filter > summary::-webkit-details-marker { display: none; }
.history-v2-filter[open] > form {
    position: absolute;
    z-index: 40;
    top: 55px;
    right: 0;
    width: min(340px, calc(100vw - 24px));
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    padding: 15px;
    border: 1px solid #dbe1ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15,23,42,.17);
}
.history-v2-filter label { display: grid; gap: 5px; color: #64748b; font-size: 11px; font-weight: 700; }
.history-v2-filter input, .history-v2-filter select { width: 100%; min-width: 0; height: 40px; padding: 0 9px; border: 1px solid #d3dae5; border-radius: 9px; background: #fff; }
.history-v2-filter-actions { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-v2-filter-actions a, .history-v2-filter-actions button { display: grid; min-height: 42px; place-items: center; border: 0; border-radius: 10px; text-decoration: none; font-weight: 750; }
.history-v2-filter-actions a { background: #eef2f7; color: #334155; }
.history-v2-filter-actions button { background: #155eef; color: #fff; }
.history-v2-results > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 3px 8px; }
.history-v2-results h2 { margin: 0; font-size: 18px; }
.history-v2-results header > span { min-width: 34px; padding: 5px 9px; border-radius: 999px; background: #eaf0ff; color: #155eef; text-align: center; font-size: 12px; font-weight: 800; }
.history-v2-list { display: grid; gap: 8px; }
.history-v2-item {
    display: grid;
    grid-template-columns: 72px minmax(0,1fr) 46px auto 14px;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #e0e5ed;
    border-radius: 15px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(15,23,42,.035);
}
.history-v2-date, .history-v2-mission, .history-v2-spot { min-width: 0; display: grid; gap: 2px; }
.history-v2-date strong { font-size: 11px; }
.history-v2-date span { color: #64748b; font-size: 11px; }
.history-v2-mission strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.history-v2-mission span { overflow: hidden; color: #64748b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-v2-spot span { color: #64748b; font-size: 10px; }
.history-v2-spot strong { font-size: 13px; }
.history-v2-status { padding: 5px 8px; border-radius: 999px; background: #dcfce7; color: #16723a; font-size: 9px; font-weight: 850; white-space: nowrap; }
.history-v2-status.is-cancelled { background: #fee2e2; color: #b42318; }
.history-v2-item > b { color: #64748b; font-size: 24px; font-weight: 400; }
.history-v2-empty { padding: 36px 18px; border: 1px dashed #cbd5e1; border-radius: 15px; background: #fff; color: #64748b; text-align: center; }

@media (max-width: 430px) {
    .operation-v2-summary, .operation-v2-card { padding: 16px; border-radius: 17px; }
    .operation-v2-worker-row { grid-template-columns: 31px minmax(0,1fr) 118px 38px; gap: 7px; }
    .operation-v2-worker-row > strong { font-size: 12.5px; }
    .operation-v2-worker-row select { padding: 0 5px; font-size: 12px; }
    .history-v2-item { grid-template-columns: 68px minmax(0,1fr) 38px auto 10px; gap: 7px; padding: 11px 9px; }
    .history-v2-status { padding: 4px 6px; font-size: 8px; }
}
@media (max-width: 350px) {
    .mobile-back span { display: none; }
    .operation-v2-times span { font-size: 9.5px; }
    .operation-v2-times strong { font-size: 15px; }
    .operation-v2-worker-row { grid-template-columns: 28px minmax(0,1fr) 102px 35px; }
    .history-v2-item { grid-template-columns: 62px minmax(0,1fr) auto 9px; }
    .history-v2-spot { display: none; }
}


/* Mobile polish: login, timeline and reopen mission */
:root{
    --app-blue:#1f5eff;
    --app-blue-dark:#174bd8;
    --app-ink:#14213d;
    --app-muted:#667085;
    --app-line:#e3e8f0;
    --app-bg:#f4f7fb;
    --app-card:#fff;
}
.primary-button{
    border:0;
    background:var(--app-blue)!important;
    color:#fff!important;
    box-shadow:0 8px 20px rgba(31,94,255,.18);
}
.primary-button:active{background:var(--app-blue-dark)!important;transform:scale(.985)}

/* Login */
.login-body{background:var(--app-bg)}
.login-page{
    width:min(430px,100%);
    min-height:100dvh;
    margin:0 auto;
    padding:max(44px,env(safe-area-inset-top)) 20px max(28px,env(safe-area-inset-bottom));
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:28px;
}
.login-brand{text-align:center}
.login-mark{
    width:64px;height:64px;margin:0 auto 18px;border-radius:20px;
    display:grid;place-items:center;background:var(--app-blue);color:#fff;
    font-size:30px;font-weight:900;box-shadow:0 14px 28px rgba(31,94,255,.24)
}
.login-brand p{margin:0 0 8px;color:var(--app-blue);font-size:12px;font-weight:900;letter-spacing:.14em}
.login-brand h1{font-size:31px;color:var(--app-ink)}
.login-brand span{display:block;margin-top:8px;color:var(--app-muted);font-size:14px}
.login-card{padding:20px;border:1px solid var(--app-line);border-radius:22px;background:#fff;box-shadow:0 14px 36px rgba(20,33,61,.08)}
.login-form{display:grid;gap:16px}
.login-form label{display:grid;gap:7px;color:var(--app-ink);font-size:14px;font-weight:800}
.login-form input{width:100%;min-height:52px;padding:12px 14px;border:1px solid #cfd7e4;border-radius:13px;background:#fff;font:inherit;color:var(--app-ink);outline:none}
.login-form input:focus{border-color:var(--app-blue);box-shadow:0 0 0 4px rgba(31,94,255,.10)}
.login-form button{min-height:54px;margin-top:2px;border-radius:14px;font-weight:900}
.login-language{align-self:center}

/* Reopen */
.reopen-card{margin:16px 0;padding:18px;border:1px solid var(--app-line);border-radius:20px;background:#fff;box-shadow:0 8px 22px rgba(20,33,61,.06)}
.reopen-card h2{margin:0 0 14px;font-size:18px}
.reopen-card .reopen-form{margin:0;padding:0;border:0;border-radius:0;background:transparent}
.reopen-card .reopen-form label{gap:8px;font-size:14px}
.reopen-card .reopen-form label span{font-weight:800;color:var(--app-ink)}
.reopen-card .reopen-form label small{font-weight:500;color:var(--app-muted)}
.reopen-card .reopen-form input{min-height:50px;border-radius:12px}
.reopen-card .reopen-form button{min-height:54px;border-radius:14px}

/* Timeline */
.timeline-mobile-page{padding-top:max(12px,env(safe-area-inset-top));background:var(--app-bg)}
.mobile-page-bar{
    position:sticky;top:0;z-index:5;
    display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:8px;
    margin:-12px -18px 14px;padding:12px 16px;
    border-bottom:1px solid var(--app-line);background:rgba(255,255,255,.94);backdrop-filter:blur(14px)
}
.mobile-page-bar h1{font-size:18px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mobile-back-button{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;color:var(--app-blue);text-decoration:none;font-size:24px;font-weight:700}
.timeline-mission-card{display:grid;gap:5px;padding:18px;border:1px solid var(--app-line);border-radius:20px;background:#fff;box-shadow:0 8px 22px rgba(20,33,61,.06)}
.timeline-mission-card small{color:var(--app-muted);font-size:13px}
.timeline-mission-card strong{font-size:28px;line-height:1.05;color:var(--app-ink)}
.timeline-mission-card span{color:var(--app-ink);font-size:14px}
.timeline-print-button{min-height:52px;margin:12px 0 16px;border-radius:14px;text-decoration:none}
.mobile-timeline{display:grid}
.mobile-timeline-event{display:grid;grid-template-columns:34px 1fr;gap:10px;position:relative}
.mobile-timeline-rail{position:relative;display:flex;justify-content:center}
.mobile-timeline-rail:after{content:"";position:absolute;top:34px;bottom:-12px;width:2px;background:#cfe0ff}
.mobile-timeline-event:last-child .mobile-timeline-rail:after{display:none}
.mobile-timeline-dot{position:relative;z-index:1;display:grid;place-items:center;width:30px;height:30px;margin-top:14px;border-radius:50%;background:var(--app-blue);color:#fff;font-size:13px;font-weight:900;box-shadow:0 0 0 6px #edf3ff}
.mobile-event-card{margin-bottom:12px;padding:16px;border:1px solid var(--app-line);border-radius:18px;background:#fff;box-shadow:0 6px 18px rgba(20,33,61,.05)}
.mobile-event-topline{display:flex;align-items:center;justify-content:space-between;gap:8px}
.mobile-event-topline time{color:var(--app-muted);font-size:12px;white-space:nowrap}
.mobile-event-status{padding:5px 8px;border-radius:999px;background:#dcfce7;color:#16803c;font-size:9px;font-weight:900}
.mobile-event-card h2{margin:9px 0 13px;color:var(--app-ink);font-size:19px}
.mobile-event-card dl{display:grid;gap:10px;margin:0}
.mobile-event-card dl div{display:grid;gap:3px}
.mobile-event-card dt{color:var(--app-muted);font-size:12px;font-weight:800}
.mobile-event-card dd{margin:0;color:var(--app-ink);font-size:14px;line-height:1.45}
.mobile-event-card .event-uid{margin-top:13px;overflow-wrap:anywhere;color:#98a2b3;font-size:8px}

@media(max-width:380px){
    .mobile-page-bar{grid-template-columns:38px 1fr auto;padding-inline:10px}
    .mobile-page-bar h1{font-size:16px}
    .timeline-mission-card strong{font-size:24px}
    .mobile-timeline-event{grid-template-columns:30px 1fr;gap:7px}
    .mobile-event-card{padding:14px}
}

/* =========================================================
   RENDIMIENTO Y FLUIDEZ · RC1
   Reglas globales no destructivas, mobile first.
   ========================================================= */
:root {
    --motion-fast: 110ms;
    --motion-normal: 150ms;
    --motion-ease: cubic-bezier(.2, .8, .2, 1);
    --tap-scale: .985;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

/* Reduce el coste de renderizado de contenido fuera de pantalla. */
.mission-overview-card,
.recent-mission-card,
.operation-card,
.timeline-event,
.admin-card,
.report-card,
.profile-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 180px;
}

/* Respuesta táctil uniforme. */
a,
button,
[role="button"],
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a,
button,
[role="button"] {
    touch-action: manipulation;
}

.primary-button,
.secondary-button,
.danger-button,
.scan-button,
.quick-action,
.mission-overview-card,
.recent-mission-card,
.operation-card,
.back-link,
.card-link,
.profile-chip {
    transition:
        transform var(--motion-fast) var(--motion-ease),
        opacity var(--motion-fast) var(--motion-ease),
        background-color var(--motion-normal) var(--motion-ease),
        border-color var(--motion-normal) var(--motion-ease),
        box-shadow var(--motion-normal) var(--motion-ease),
        color var(--motion-normal) var(--motion-ease);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.scan-button:active,
.quick-action:active,
.mission-overview-card:active,
.recent-mission-card:active,
.operation-card:active,
.back-link:active,
.card-link:active,
.profile-chip:active {
    transform: scale(var(--tap-scale));
}

button[aria-busy="true"],
button.is-submitting {
    pointer-events: none;
    opacity: .72;
}

/* Transición de entrada sin provocar salto de contenido. */
body.app-ready main,
body.app-ready .app,
body.app-ready .app-shell {
    animation: cma-page-in var(--motion-normal) var(--motion-ease) both;
}

body.is-leaving main,
body.is-leaving .app,
body.is-leaving .app-shell {
    opacity: .72;
    transform: translateY(2px);
    transition:
        opacity 90ms ease,
        transform 90ms ease;
}

@keyframes cma-page-in {
    from {
        opacity: .84;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* View Transitions API, cuando el navegador la soporte. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: var(--motion-normal);
    animation-timing-function: var(--motion-ease);
}

/* Evita animaciones innecesarias a quien las tenga desactivadas. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Configuración operativa de plantillas y sugerencias en misión. */
.template-operation-suggestions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    background: #eff6ff;
}
.template-operation-suggestions > small,
.template-operation-heading p {
    margin: 4px 0 0;
    color: #667085;
    line-height: 1.45;
}
.template-operation-suggestions button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #93c5fd;
    border-radius: 11px;
    background: #fff;
    color: #1d4ed8;
    font: inherit;
    font-weight: 800;
    text-align: left;
}
.template-operation-suggestions button span,
.operation-required-label {
    padding: 3px 7px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .7rem;
    font-weight: 800;
}
.template-operation-list {
    display: grid;
    gap: 10px;
}
.template-operation-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, .55fr) 96px;
    gap: 12px;
    align-items: end;
    margin: 0;
    padding: 14px;
    border: 1px solid #e4e9f0;
    border-radius: 16px;
    background: #fff;
}
.template-operation-row label {
    display: grid;
    gap: 6px;
}
.template-operation-row label > span {
    color: #667085;
    font-size: .78rem;
}
.template-operation-toggle {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    gap: 10px;
}
.template-operation-toggle input {
    width: 22px !important;
    min-height: 22px !important;
}
.template-operation-row select,
.template-operation-row input[type="number"] {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
}
@media (max-width: 640px) {
    .template-operation-row {
        grid-template-columns: 1fr 1fr;
    }
    .template-operation-toggle {
        grid-column: 1 / -1;
    }
}
.environment-badge {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 0.5rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid #d97706;
    border-radius: 999px;
    color: #92400e;
    background: #fffbeb;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    vertical-align: middle;
}
