/* Oppdrag page. Shared page chrome (full width, header, typography, status pills,
   card surfaces) comes from operational-view.css; this file holds only what is
   specific to the operation list, scoped to .operations-view. */

/* Header: "Nytt oppdrag" is the primary action, "Oppdater" secondary. */
#organization-overview-page.operations-view .operational-hero-actions>.primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:auto;min-height:40px;padding:8px 18px;font-size:14px}
#organization-overview-page.operations-view .operational-hero-actions>.primary::before{content:"";flex:0 0 16px;width:16px;height:16px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat}
#organization-overview-page.operations-view .operational-hero>div:first-child>.muted{margin:8px 0 0;color:var(--muted);font-size:14px;line-height:1.45}

/* "1 nytt oppdrag – vis": operations that arrived with an automatic update wait behind this line
   above the cards until the user clicks it (drne-design §5). A full-width button in the accent's
   soft tone, so it is seen without moving anything. */
#organization-overview-page.operations-view .operation-new-banner{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;margin:0;padding:10px 16px;border:1px solid var(--primary);border-radius:10px;background:var(--primary-soft);color:var(--ink);font-family:Sora,Arial,sans-serif;font-size:14px;font-weight:600;text-align:left;cursor:pointer}
#organization-overview-page.operations-view .operation-new-banner::before{content:"";flex:0 0 16px;width:16px;height:16px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center/contain no-repeat}
#organization-overview-page.operations-view .operation-new-banner:hover{background:color-mix(in srgb,var(--primary-soft) 70%,var(--primary) 30%)}
#organization-overview-page.operations-view .operation-new-banner:focus-visible{outline:2px solid var(--primary);outline-offset:2px}

/* One heading structure: section title with a count badge. */
#organization-overview-page.operations-view .operation-list-panel{padding:20px 24px 24px}
#organization-overview-page.operations-view .operation-list{display:grid;gap:24px}
#organization-overview-page.operations-view .operation-list-section{gap:12px}
#organization-overview-page.operations-view .operation-section-title{justify-content:flex-start;gap:10px;margin:0}
#organization-overview-page.operations-view .operation-section-title h2{margin:0;font-family:Sora,Arial,sans-serif;font-size:18px;font-weight:600;line-height:1.3;letter-spacing:-.01em;text-transform:none}

/* Operation cards: title, then the place in full ink with a pin, drones on their own row,
   start time (active) or status and end date (other) on the right, discreet edit button.
   A missing place or no drones is said in muted text, so every card has the same rows. */
#organization-overview-page.operations-view .operation-list-items{gap:12px}
#organization-overview-page.operations-view .operation-row{position:relative;min-width:0}
#organization-overview-page.operations-view .operation-row .operation-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px 16px;width:100%;height:100%;min-height:112px;padding:16px 64px 16px 18px;border-radius:10px;text-align:left;font-family:Archivo,Arial,sans-serif;font-weight:400;letter-spacing:normal}
#organization-overview-page.operations-view .operation-card-copy{display:grid;gap:6px;min-width:0}
#organization-overview-page.operations-view .operation-card-copy>strong{color:var(--ink);font-family:Sora,Arial,sans-serif;font-size:16px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
#organization-overview-page.operations-view .operation-card-address{display:inline-flex;align-items:center;gap:6px;color:var(--ink);font-size:14px;font-weight:400;line-height:1.4}
#organization-overview-page.operations-view .operation-card-address.is-missing{color:var(--muted)}
#organization-overview-page.operations-view .operation-card-address.is-missing::before{opacity:.6}
#organization-overview-page.operations-view .operation-card-no-drones{margin-top:4px;color:var(--muted);font-size:13px;line-height:1.4}
#organization-overview-page.operations-view .operation-card-address::before{content:"";flex:0 0 14px;width:14px;height:14px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.6-6-11a6 6 0 0 1 12 0c0 5.4-6 11-6 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.2'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.6-6-11a6 6 0 0 1 12 0c0 5.4-6 11-6 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.2'/%3E%3C/svg%3E") center/contain no-repeat}
#organization-overview-page.operations-view .operation-card-side{display:grid;justify-items:end;align-content:start;gap:6px;min-width:0;margin:0;text-align:right}
#organization-overview-page.operations-view .operation-card-side small{color:var(--muted);font-size:12px;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}

/* Drone chips: neutral like the overview resource badges. A dot only when the state
   is known: green filled = på nett, grey hollow = frakoblet. No red. */
#organization-overview-page.operations-view .operation-drone-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
#organization-overview-page.operations-view .operation-drone-chip{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:4px 10px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--ink);font-size:12px;font-weight:600}
#organization-overview-page.operations-view .operation-drone-chip strong{font-size:12px;font-weight:600;line-height:1.2}
#organization-overview-page.operations-view .operation-drone-status-dot{width:7px;height:7px;flex:0 0 7px;box-sizing:border-box;border-radius:50%;background:transparent}
#organization-overview-page.operations-view .operation-drone-chip.is-online .operation-drone-status-dot{background:var(--success)}
#organization-overview-page.operations-view .operation-drone-chip.is-offline .operation-drone-status-dot{border:1.5px solid var(--muted);background:transparent}
#organization-overview-page.operations-view .operation-drone-chip.is-unknown .operation-drone-status-dot{display:none}

/* Operation status: Aktivt uses the shared green pill; the rest are neutral with an icon. */
#organization-overview-page.operations-view .operation-status{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;font-size:12px;font-weight:600;white-space:nowrap}
#organization-overview-page.operations-view .operation-status:not(.online){border-color:var(--line);background:transparent;color:var(--muted)}
#organization-overview-page.operations-view .operation-status.is-planned::before{content:"";flex:0 0 7px;width:7px;height:7px;box-sizing:border-box;border:1.5px solid currentColor;border-radius:50%}
#organization-overview-page.operations-view .operation-status:is(.is-completed,.is-cancelled)::before{content:"";flex:0 0 12px;width:12px;height:12px;background:currentColor}
#organization-overview-page.operations-view .operation-status.is-completed::before{-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat}
#organization-overview-page.operations-view .operation-status.is-cancelled::before{-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center/contain no-repeat}

/* Edit: discreet icon button with tooltip and aria-label from the module. */
#organization-overview-page.operations-view .operation-row .operation-row-edit{position:absolute;top:12px;right:12px;z-index:2;display:grid;place-items:center;width:36px;height:36px;min-height:36px;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);opacity:1;transform:none}
#organization-overview-page.operations-view .operation-row .operation-row-edit .operation-map-tool-icon svg{width:18px;height:18px}
#organization-overview-page.operations-view .operation-row:hover .operation-row-edit{color:var(--ink)}
#organization-overview-page.operations-view .operation-row .operation-row-edit:hover{border-color:var(--line);background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink)}
#organization-overview-page.operations-view .operation-row .operation-row-edit:focus-visible{outline:2px solid var(--primary);outline-offset:2px;color:var(--ink)}

/* Finished since the list was arranged (is-ended): the card stays where it is among the active ones,
   with its Fullført/Avbrutt badge and a quieter surface and title, until the user arranges the list. */
#organization-overview-page.operations-view .operation-row.is-ended .operation-card:not(:hover):not(.active){border-style:dashed;background:transparent}
#organization-overview-page.operations-view .operation-row.is-ended .operation-card-copy>strong,#organization-overview-page.operations-view .operation-row.is-ended .operation-card-address:not(.is-missing){color:var(--muted)}

/* Archived (fullført/avbrutt) operations: one compact row each, in a single column, so a long
   history can be scanned top to bottom. Name, place and drones on one line (wrapping when narrow),
   end date and status on the right. Quieter surface than the active cards. */
#organization-overview-page.operations-view .operation-row.is-archived .operation-card:not(:hover):not(.active){background:transparent}
#organization-overview-page.operations-view .operation-row.is-archived .operation-card{align-items:center;min-height:0;padding:10px 56px 10px 16px}
#organization-overview-page.operations-view .operation-row.is-archived .operation-card-copy{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px}
#organization-overview-page.operations-view .operation-row.is-archived .operation-card-copy>strong{font-size:15px}
#organization-overview-page.operations-view .operation-row.is-archived :is(.operation-card-address,.operation-card-no-drones){font-size:13px;margin:0}
#organization-overview-page.operations-view .operation-row.is-archived .operation-card-address:not(.is-missing){color:var(--muted)}
#organization-overview-page.operations-view .operation-row.is-archived .operation-drone-chips{margin:0}
#organization-overview-page.operations-view .operation-row.is-archived .operation-drone-chip{min-height:22px;padding:2px 8px;color:var(--muted)}
#organization-overview-page.operations-view .operation-row.is-archived .operation-card-side{display:flex;align-items:center;gap:12px}
#organization-overview-page.operations-view .operation-row.is-archived .operation-row-edit{top:50%;transform:translateY(-50%)}
#organization-overview-page.operations-view .operation-archive-results{gap:6px}
#organization-overview-page.operations-view .operation-archive-result-meta[data-state="empty"]{padding:16px 0;color:var(--ink);font-size:14px}
#organization-overview-page.operations-view .operation-list-empty{min-height:0;align-self:start}

/* Archive: a readable, clickable section header with count and chevron. */
#organization-overview-page.operations-view .operation-archive{margin:0;padding-top:16px;border-top:1px solid var(--line)}
#organization-overview-page.operations-view .operation-archive>summary{display:flex;align-items:center;gap:10px;min-height:56px;padding:10px 12px;margin:0 -12px;border-radius:10px;cursor:pointer}
#organization-overview-page.operations-view .operation-archive>summary:hover{background:color-mix(in srgb,var(--ink) 6%,transparent)}
#organization-overview-page.operations-view .operation-archive>summary:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
#organization-overview-page.operations-view .operation-archive>summary>span:first-child{display:grid;gap:4px}
#organization-overview-page.operations-view .operation-archive>summary strong{color:var(--ink);font-family:Sora,Arial,sans-serif;font-size:16px;font-weight:600;line-height:1.3}
#organization-overview-page.operations-view .operation-archive>summary small{color:var(--muted);font-size:13px;font-weight:400;line-height:1.4}
#organization-overview-page.operations-view .operation-archive>summary>.pill{margin-left:auto}
#organization-overview-page.operations-view .operation-archive>summary::after{content:"";order:3;flex:0 0 20px;width:20px;height:20px;background:var(--muted);transform:none;transition:transform .15s ease;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat}
#organization-overview-page.operations-view .operation-archive[open]>summary::after{transform:rotate(180deg)}
#organization-overview-page.operations-view .operation-archive-body{gap:12px;padding-top:12px}
#organization-overview-page.operations-view .operation-archive-result-meta{margin:0;color:var(--muted);font-size:12px}

/* Narrow cards (phones, or narrow grid columns): status and end date move under the
   address so the title and drone badges keep the full card width. */
#organization-overview-page.operations-view .operation-row{container-type:inline-size}
@container (max-width:520px){
 #organization-overview-page.operations-view .operation-row .operation-card{grid-template-columns:minmax(0,1fr);grid-template-rows:1fr auto;gap:10px;padding:14px 56px 14px 16px}
 #organization-overview-page.operations-view .operation-card-side{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:8px;text-align:left}
 #organization-overview-page.operations-view .operation-card-side small{order:2}
 /* Archived rows: the name on its own line, place and drones under it. */
 #organization-overview-page.operations-view .operation-row.is-archived .operation-card-copy>strong{flex-basis:100%}
}

@media(max-width:700px){
 #organization-overview-page.operations-view .operation-list-panel{padding:16px}
}
@media(max-width:420px){
 #organization-overview-page.operations-view .operational-hero-actions>.primary{width:100%}
}

/* Wide screens (>=1280px): active and archived operations flow into a grid. */
@media(min-width:1280px){
 #organization-overview-page.operations-view .operation-list-section{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,420px),1fr));align-items:stretch;gap:12px}
 #organization-overview-page.operations-view .operation-list-section>:is(.operation-section-title,.operation-list-empty){grid-column:1/-1}
}

/* Edit / new operation dialog: sections Oppdrag, Droner, Kart; one "Droner" header with
   the selection count; drone cards with status dot and monospace serial. The footer
   (shared dialog style) stays visible while the form scrolls. */
#organization-overview-page.operations-view .operation-editor-dialog{width:min(760px,calc(100vw - 32px))}
#organization-overview-page.operations-view .operation-editor-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px}
#organization-overview-page.operations-view .operation-editor-form>:is(h2,p,h3,fieldset,details,.dialog-actions,label:has(textarea)){grid-column:1/-1}
#organization-overview-page.operations-view .operation-editor-form>h2{margin:0}
#organization-overview-page.operations-view .operation-editor-form>p.muted{margin:-8px 0 0;color:var(--muted);font-size:14px}
#organization-overview-page.operations-view .operation-editor-form>p:empty{display:none}
#organization-overview-page.operations-view .operation-editor-form>label{display:grid;gap:6px;margin:0}
#organization-overview-page.operations-view .operation-editor-form :is(.operation-editor-section,.operation-assignment-picker>legend){margin:0;color:var(--muted);font-family:Sora,Arial,sans-serif;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}
#organization-overview-page.operations-view .operation-editor-form>.operation-editor-section{margin-top:6px;padding-top:16px;border-top:1px solid var(--line)}
#organization-overview-page.operations-view .operation-editor-form>p.muted+.operation-editor-section{margin-top:0;padding-top:0;border-top:0}
#organization-overview-page.operations-view .operation-editor-form textarea{min-height:96px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--ink);font:inherit;font-size:14px;line-height:1.45;resize:vertical}
#organization-overview-page.operations-view .operation-editor-form :is(input,textarea,select):user-invalid{border-color:var(--error-ink);box-shadow:0 0 0 1px var(--error-ink)}
#organization-overview-page.operations-view .operation-editor-form label:has(:user-invalid){color:var(--error-ink)}
#organization-overview-page.operations-view .operation-assignment-picker{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-width:0;margin:6px 0 0;padding:16px 0 0;border:0;border-top:1px solid var(--line);border-radius:0}
#organization-overview-page.operations-view .operation-assignment-picker>legend{float:left;grid-column:1;padding:0}
#organization-overview-page.operations-view .operation-assignment-picker>.operation-assignment-count{grid-column:2;margin:0;color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}
#organization-overview-page.operations-view .operation-assignment-picker>:not(legend,.operation-assignment-count){grid-column:1/-1}
#organization-overview-page.operations-view .operation-assignment-search{display:grid;gap:6px;margin:0}
#organization-overview-page.operations-view .operation-assignment-groups{display:grid;gap:12px}
#organization-overview-page.operations-view .operation-assignment-groups>section{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
#organization-overview-page.operations-view .operation-assignment-groups>section>h3{grid-column:1/-1;margin:0;color:var(--muted);font-size:13px;font-weight:600}
#organization-overview-page.operations-view .operation-assignment-groups>section:only-child>h3{display:none}
#organization-overview-page.operations-view label.operation-assignment-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:10px;margin:0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--ink);cursor:pointer}
#organization-overview-page.operations-view label.operation-assignment-card[hidden]{display:none}
#organization-overview-page.operations-view label.operation-assignment-card:hover{border-color:color-mix(in srgb,var(--primary) 55%,var(--line))}
#organization-overview-page.operations-view label.operation-assignment-card.is-selected{border-color:var(--primary);background:var(--primary-soft);box-shadow:inset 3px 0 0 var(--primary)}
#organization-overview-page.operations-view label.operation-assignment-card:has(input:focus-visible){outline:2px solid var(--primary);outline-offset:2px}
#organization-overview-page.operations-view label.operation-assignment-card input{margin-top:1px}
#organization-overview-page.operations-view label.operation-assignment-card>span{display:grid;gap:2px;min-width:0}
#organization-overview-page.operations-view label.operation-assignment-card strong{color:var(--ink);font-size:14px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
#organization-overview-page.operations-view label.operation-assignment-card small{color:var(--muted);font-size:12px;font-weight:400}
#organization-overview-page.operations-view .operation-assignment-serial{color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;overflow-wrap:anywhere}
#organization-overview-page.operations-view label.operation-assignment-card small:is(.is-online,.is-offline){display:inline-flex;align-items:center;gap:6px;margin-top:4px;font-weight:600}
#organization-overview-page.operations-view label.operation-assignment-card small:is(.is-online,.is-offline)::before{content:"";flex:0 0 7px;width:7px;height:7px;box-sizing:border-box;border-radius:50%}
#organization-overview-page.operations-view label.operation-assignment-card small.is-online{color:var(--success-ink)}
#organization-overview-page.operations-view label.operation-assignment-card small.is-online::before{background:var(--success)}
#organization-overview-page.operations-view label.operation-assignment-card small.is-offline::before{border:1.5px solid currentColor}
#organization-overview-page.operations-view .operation-editor-form>details>summary{display:flex;align-items:center;gap:8px;min-height:40px;color:var(--ink);font-size:14px;font-weight:600;list-style:none;cursor:pointer}
#organization-overview-page.operations-view .operation-editor-form>details>summary::-webkit-details-marker{display:none}
#organization-overview-page.operations-view .operation-editor-form>details>summary::before{content:"";flex:0 0 16px;width:16px;height:16px;background:var(--muted);transition:transform .15s ease;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat}
#organization-overview-page.operations-view .operation-editor-form>details[open]>summary::before{transform:rotate(90deg)}
@media(max-width:600px){
 #organization-overview-page.operations-view .operation-editor-form{grid-template-columns:minmax(0,1fr)}
 #organization-overview-page.operations-view .operation-assignment-picker{grid-template-columns:minmax(0,1fr)}
 #organization-overview-page.operations-view .operation-assignment-picker>.operation-assignment-count{grid-column:1}
}
#organization-overview-page.operations-view .operation-editor-form>details.operation-position-fields{margin:0;padding:0;border:0}

