:root {
    --bg: #f0eeee;
    --surface: #ffffff;
    --surface-soft: #faf8fb;
    --surface-strong: #f4eff7;
    --text: #250044;
    --muted: #766d7d;
    --line: #e6dfe8;
    --primary: #ff0045;
    --primary-dark: #d9003d;
    --primary-soft: #fff0f4;
    --purple: #2b0050;
    --purple-2: #560078;
    --danger: #b00030;
    --success: #18a874;
    --focus: #ff7aa4;
    --shadow: 0 18px 46px rgba(37, 0, 68, 0.09);
    --shadow-soft: 0 10px 26px rgba(37, 0, 68, 0.07);
}

.wo-trip-planner { padding: 16px; margin: 12px 0; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.wo-trip-planner h3 { margin: 0 0 8px; }
.wo-trip-planner p { color: var(--muted); line-height: 1.5; }
.wo-truck-scroll { max-width: 100%; overflow-x: auto; padding: 0 0 12px; }
.wo-truck { display: flex; align-items: stretch; min-width: 650px; gap: 0; padding: 12px 0 28px; }
.wo-truck-cab, .wo-truck-doors { position: relative; display: flex; flex-direction: column; justify-content: flex-end; flex: 0 0 108px; color: var(--purple); text-align: center; font-size: 10px; font-weight: 700; }
.wo-truck-cab svg, .wo-truck-doors svg { width: 100%; height: 220px; }
.wo-truck-doors { flex-basis: 125px; }
.wo-truck-cargo { position: relative; display: flex; align-items: stretch; flex: 1; gap: 10px; margin: 32px 0 32px; border: 3px solid var(--purple); border-bottom-width: 9px; border-radius: 7px 2px 2px 3px; padding: 14px; background: var(--surface); min-width: 350px; }
.wo-truck-cargo::before, .wo-truck-cargo::after { content: ''; position: absolute; bottom: -26px; width: 32px; height: 32px; border: 9px solid var(--purple); background: var(--surface); border-radius: 50%; }
.wo-truck-cargo::before { left: 25%; } .wo-truck-cargo::after { right: 12%; }
.wo-truck-stop { position: relative; display: grid; align-content: center; gap: 10px; min-width: 180px; flex: 1; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; padding: 18px 34px 18px 12px; }
.wo-truck-remove { position: absolute; top: 4px; right: 5px; border: 0; background: transparent; color: var(--primary); font-size: 30px; line-height: 1; padding: 2px 5px; cursor: pointer; }
.wo-truck-add { flex: 0 0 125px; display: grid; align-content: center; gap: 8px; }
.wo-truck-plus { display: grid; place-content: center; gap: 4px; width: 100%; min-height: 115px; border: 2px dashed #14875e; border-radius: 8px; background: #eef9f2; color: #126844; cursor: pointer; font: inherit; font-weight: 700; padding: 12px; }
.wo-truck-plus strong { font-size: 40px; line-height: 1; } .wo-truck-plus:disabled { opacity: .5; cursor: default; }
.wo-truck-add:has(select:not([hidden])) { flex-basis: 230px; }
.wo-truck-add select { width: 100%; min-width: 0; }
.wo-truck-stop[draggable="true"] { cursor: grab; }
.wo-truck-stop strong { color: var(--purple); font-size: 15px; }
.wo-truck-order { display: flex; gap: 6px; flex-wrap: wrap; }
.wo-truck-order button { padding: 6px 8px; font-size: 11px; }
.wo-trip-destination { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.wo-trip-assignment { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 12px; align-items: center; margin: 8px 0; }
.wo-trip-label { display: block; margin-top: 5px; color: var(--muted); white-space: nowrap; }
.wo-trip-allocation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px),1fr)); gap: 16px; margin: 18px 0; }
.wo-trip-cia { padding: 16px; border: 2px dashed var(--line); border-top: 4px solid var(--purple); border-radius: 12px; background: var(--surface-soft); min-height: 200px; min-width: 0; }
.wo-trip-cia h3 { margin: 0 0 8px; color: var(--purple); }
.wo-trip-cia.is-drop-target { border-color: var(--success); background: #eef9f2; }
.wo-trip-drop-hint { padding: 32px 6px; text-align: center; color: var(--muted); }
.wo-trip-male-card { position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 14px; cursor: grab; }
.wo-trip-male-card strong { font-size: 16px; color: var(--purple); }
.wo-trip-male-card dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 10px; }
.wo-trip-male-card dt { color: var(--muted); } .wo-trip-male-card dd { margin: 0; overflow-wrap: anywhere; }
#woTransferMalesBody tr[draggable="true"] { cursor: grab; }
.wo-modal-panel:has(#woTripCreate:not([hidden])) { width: min(1100px, calc(100vw - 32px)); max-width: none; }
@media (max-width: 600px) { .wo-trip-assignment { grid-template-columns: 1fr; } }

.wo-azure-review {
    width: min(1540px, calc(100% - 32px));
    margin: 28px auto;
}

.wo-azure-sql {
    max-width: 100%;
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

[hidden] { display: none !important; }

.farm-modal-panel { max-height: calc(100dvh - 24px); overflow-y: auto; }
#farmMovementConfirmModal .farm-modal-panel { padding: 18px; gap: 14px; }
#farmMovementConfirmModal .farm-modal-panel h2 { font-size: 20px; }
#farmMovementConfirmModal .farm-modal-panel p { font-size: 18px; font-weight: 600; }
#farmMovementConfirmModal .farm-modal-actions button { font-size: 16px; min-height: 55px; padding: 10px; }
#farmMovementConfirmAccept { grid-row: 1; grid-column: 2; }
#farmMovementReject { grid-row: 1; grid-column: 1; }
#farmMovementConfirmModal:has(#farmMovementReject:not([hidden])) #farmMovementConfirmCancel { grid-row: 2; grid-column: 1 / -1; min-height: 40px; font-size: 14px; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 0, 69, 0.09), transparent 34rem),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.topbar {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 154px;
    padding: 28px max(20px, calc((100vw - 1540px) / 2 + 20px));
    border-bottom: 0;
    background:
        radial-gradient(circle at 86% 22%, rgba(255, 0, 69, 0.44) 0 2px, transparent 3px),
        linear-gradient(112deg, #2b0050 0%, #3c0061 48%, #7c003e 100%);
    color: #fff;
}

.topbar::after {
    position: absolute;
    right: -9rem;
    top: -17rem;
    width: 36rem;
    height: 36rem;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.19) 0deg 1deg, transparent 1deg 6deg);
    content: "";
    opacity: 0.75;
    pointer-events: none;
}

.topbar h1,
.topbar p,
.content h2,
.panel h2 {
    margin: 0;
}

.topbar h1 {
    font-size: clamp(28px, 4vw, 50px);
    font-weight: 700;
    letter-spacing: 0;
}

.topbar p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 16px;
}

.brand-lockup,
.topbar-title,
.user-bar {
    position: relative;
    z-index: 1;
}

.brand-lockup {
    flex: 0 0 auto;
}

.brand-logo-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 190px;
    height: 102px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.brand-logo-card img {
    display: block;
    width: 154px;
    height: auto;
}

.topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.status-badge {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.status-badge-danger {
    border-color: rgba(180, 35, 24, 0.28);
    background: #ffe3df;
    color: var(--danger);
}

.status-badge-success {
    border-color: rgba(19, 121, 91, 0.28);
    background: #e5f6ef;
    color: var(--success);
}

.sidebar .status-badge,
.content .status-badge,
.wo-panel .status-badge,
.wo-current .status-badge {
    border-color: rgba(43, 0, 80, 0.12);
    background: var(--surface-strong);
    color: var(--text);
}

.user-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-link {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    width: min(1540px, calc(100% - 40px));
    min-height: calc(100vh - 154px);
    margin: -18px auto 0;
    padding-bottom: 18px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    border-right: 0;
    background: transparent;
}

.module {
    display: grid;
    gap: 10px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.search-module {
    background: var(--surface);
}

.operation-module {
    border-color: rgba(255, 0, 69, 0.16);
    background: linear-gradient(180deg, #fff 0%, #fff8fa 100%);
}

.module h2,
.content h2 {
    color: var(--text);
    font-size: 22px;
}

label {
    color: var(--muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
}

select,
input[type="search"],
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 0 14px;
    font: inherit;
}

input[type="search"],
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
    height: 42px;
}

textarea {
    min-height: 74px;
    padding-top: 10px;
    resize: vertical;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 78% 12%, rgba(255, 0, 69, 0.18), transparent 22rem),
        linear-gradient(125deg, #2b0050 0%, #4a0067 52%, #7c003e 100%);
}

.login-shell {
    width: min(440px, calc(100vw - 24px));
}

.login-panel {
    display: grid;
    gap: 12px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.login-panel h1,
.login-panel p {
    margin: 0;
}

.login-panel h1 {
    color: var(--text);
    font-size: 30px;
}

.login-panel p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.login-logo {
    width: 188px;
    height: 96px;
    margin-bottom: 8px;
}

.selector-page {
    min-height: 100vh;
}

.selector-shell {
    display: grid;
    align-items: start;
    min-height: calc(100vh - 154px);
    padding: 34px 20px;
}

.tool-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 18px;
    width: min(980px, 100%);
    margin: 0 auto;
}

.tool-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    min-height: 232px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.tool-card::after {
    position: absolute;
    right: -94px;
    bottom: -110px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: repeating-conic-gradient(from -25deg, rgba(255, 0, 69, 0.13) 0deg 2deg, transparent 2deg 8deg);
    content: "";
    pointer-events: none;
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.tool-card.is-new {
    border-color: rgba(255, 0, 69, 0.16);
    background: linear-gradient(180deg, #fff 0%, #fff5f8 100%);
}

.tool-card.is-farm {
    border-color: rgba(19, 121, 91, 0.2);
    background: linear-gradient(180deg, #fff 0%, #f3fbf7 100%);
}

.tool-card-kicker {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tool-card strong {
    font-size: 28px;
}

.tool-card span {
    line-height: 1.45;
}

.tool-card-action {
    align-self: end;
    justify-self: start;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 14px 26px rgba(255, 0, 69, 0.22);
}

.farm-entry-page {
    min-height: 100vh;
    background: #f3f5f7;
    color: var(--text);
}

.farm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 5px;
    border-bottom: 2px solid var(--line);
    background: #fff;
}

.farm-topbar h1,
.farm-topbar p {
    margin: 0;
}

.farm-topbar h1 {
    font-size: 20px;
    line-height: 1.1;
}

.farm-topbar-actions {
    display: flex;
    gap: 12px;
}

.farm-topbar-actions a {
    color: var(--muted);
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}

.farm-shell {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 auto;
    padding: 5px 5px 14px;
}

.farm-panel,
.farm-current {
    width: 100%;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.farm-detail:not([hidden]) {
    display: grid;
    width: 100%;
    gap: 10px;
}

.farm-panel {
    padding: 10px;
}

.farm-section-head,
.farm-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.farm-section-head h2,
.farm-section-head p,
.farm-current h2,
.farm-current p {
    margin: 0;
}

.farm-current {
    padding: 5px 10px;
    width: calc(100% + 10px);
    margin-inline: -5px;
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 10px;
}

.farm-current > .secondary-button { grid-column: 1; grid-row: 1; justify-self: start; min-height: 44px; font-size: 14px; }

.farm-save-all {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-self: end;
    min-height: 44px;
    background: #13795b;
    color: #fff;
    font-size: 15px;
    padding: 8px;
    white-space: normal;
}

.farm-entry-page .farm-current .farm-save-all { background: #13795b; border-color: #13795b; color: #fff; }
.farm-current-marker { height: 1px; margin-bottom: -11px; }
.farm-current.is-compact { padding: 4px 10px; box-shadow: 0 3px 12px #0002; }
.farm-current.is-compact h2 { font-size: 15px; }
.farm-current.is-compact p { font-size: 12px; }
.farm-current.is-compact .farm-save-all { min-height: 44px; font-size: 15px; padding: 8px; }
.farm-current > div { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; }
.farm-current .status-badge { display: none; }
.farm-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; padding: 12px 16px; color: var(--muted); font-size: 12px; }
.farm-footer a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.farm-entry-page .message.is-visible { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(720px, calc(100% - 28px)); max-height: 35vh; overflow: auto; }
.farm-section-head h2 { font-size: 20px; }

.farm-current h2 {
    font-size: 15px;
    line-height: 1.1;
    flex: 0 1 auto;
    max-width: 45%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.farm-current p {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.farm-entry-list,
.farm-line-list {
    display: grid;
    width: 100%;
    gap: 12px;
    margin-top: 0;
}
.farm-entry-list { margin-top: 10px; }

.farm-list-group {
    display: grid;
    gap: 12px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.farm-list-group h3 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.farm-list-group + .farm-list-group {
    margin-top: 4px;
}

.farm-list-group:nth-child(2) {
    border-color: #49a078;
    background: #eefbf5;
}

.farm-list-group:nth-child(2) .farm-entry-button {
    border-color: #49a078;
    background: #f9fffc;
}

.farm-entry-button {
    display: grid;
    gap: 8px;
    width: 100%;
    min-height: 104px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.farm-entry-button strong {
    font-size: 20px;
    line-height: 1.1;
}

.farm-entry-button span,
.farm-entry-button small {
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
}

.farm-line {
    display: grid;
    gap: 12px;
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    border: 3px solid #cdd8e3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(13, 31, 45, 0.08);
}

.farm-line.is-entered {
    border-color: #49a078;
    background: #eefbf5;
}

.farm-line.is-manual {
    border-color: #b6bd35;
    background: #fbfde7;
}

.farm-line.is-not-entered {
    border-color: #d85047;
    background: #fff1ef;
}

.farm-line-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(108, 126, 145, 0.18);
}

.farm-line-head div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.farm-line-head strong {
    font-size: 20px;
    line-height: 1;
    overflow-wrap: anywhere;
}

.farm-line-head span {
    color: var(--muted);
    font-size: 16px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.farm-line-head small {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.farm-line-status {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    white-space: normal;
    max-width: 42%;
    overflow-wrap: anywhere;
}

.farm-status-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.farm-status-buttons button,
.farm-save-button {
    min-height: 55px;
    font-size: 18px;
    font-weight: 900;
}

.farm-field {
    display: grid;
    gap: 5px;
}

.farm-field span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
}

.farm-field input,
.farm-field textarea,
.farm-field select {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 2px solid #cdd8e3;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.farm-field textarea {
    min-height: 64px;
    resize: vertical;
}

.farm-save-button {
    width: 100%;
}

.farm-line.is-entered [data-farm-status="ENTERED"].is-selected {
    border-color: #13795b;
    background: #13795b;
    color: #fff;
}

.farm-line.is-not-entered [data-farm-status="NOT_ENTERED"].is-selected {
    border-color: #b42318;
    background: #b42318;
    color: #fff;
}

.message.is-info {
    border: 1px solid rgba(83, 101, 121, 0.28);
    background: #f6f9fc;
    color: #536579;
}

.farm-entry-page .message {
    width: min(720px, 100%);
    padding: 14px 16px;
    border-width: 2px;
    font-size: 18px;
    font-weight: 900;
}

.farm-entry-page button:disabled {
    cursor: wait;
    opacity: 0.68;
}

.farm-scan-panel {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.farm-scan-panel .farm-field input {
    min-height: 44px;
    border-color: var(--primary);
    font-size: 18px;
}

.farm-movement-group {
    display: grid;
    gap: 16px;
    width: 100%;
}

.farm-movement-group h3 {
    width: 100%;
    margin: 0 auto;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--purple);
    color: #fff;
    font-size: 18px;
}

.farm-movement-group-lines {
    display: grid;
    gap: 12px;
}

.farm-manual-box {
    display: grid;
    gap: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(108, 126, 145, 0.18);
}

.farm-movement-note {
    padding: 12px 14px;
    border: 2px solid rgba(182, 189, 53, 0.36);
    border-radius: 8px;
    background: #fbfde7;
    color: #526000;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}

.farm-movement-note.is-danger {
    border-color: rgba(216, 80, 71, 0.45);
    background: #fff1ef;
    color: #8f241c;
}

.farm-modal[hidden] {
    display: none;
}

.farm-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(18, 24, 33, 0.62);
}

.farm-modal-panel {
    display: grid;
    gap: 18px;
    width: min(560px, 100%);
    padding: 26px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.farm-modal-panel h2,
.farm-modal-panel p {
    margin: 0;
}

.farm-modal-panel h2 {
    font-size: 24px;
}

.farm-modal-panel p {
    color: var(--muted);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.35;
}

.farm-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.farm-modal-actions button {
    min-height: 62px;
    font-size: 20px;
    font-weight: 900;
}

@media (max-width: 760px) {
    .tool-choice {
        grid-template-columns: 1fr;
    }

    .farm-topbar {
        align-items: flex-start;
    }

    .farm-topbar-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

.work-order-shell {
    min-height: calc(100vh - 154px);
    padding: 0 0 18px;
}

.wo-home-view,
.wo-detail-view {
    display: grid;
    gap: 16px;
}

.wo-detail-view {
    width: min(1540px, calc(100% - 40px));
    margin: -18px auto 0;
}

.wo-home-view[hidden],
.wo-detail-view[hidden],
.wo-modal[hidden] {
    display: none;
}

.wo-module-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(1540px, calc(100% - 40px));
    min-height: 118px;
    margin: -18px auto 0;
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.wo-module-hero::after {
    position: absolute;
    right: -7rem;
    top: -12rem;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    background: repeating-conic-gradient(from -15deg, rgba(255, 0, 69, 0.12) 0deg 2deg, transparent 2deg 8deg);
    content: "";
    pointer-events: none;
}

.wo-module-hero h2,
.wo-module-hero p {
    margin: 0;
}

.wo-module-hero h2 {
    font-size: 34px;
    font-weight: 700;
}

.wo-module-hero p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.wo-panel,
.wo-column {
    display: grid;
    gap: 12px;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.wo-list-panel {
    min-width: 0;
    padding: 24px 28px;
}

.wo-list-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.wo-list-panel-closed {
    background: linear-gradient(180deg, #fff 0%, #fbf8fc 100%);
}

.wo-panel[hidden] {
    display: none;
}

.wo-main {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
}

.wo-home-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    width: min(1540px, calc(100% - 40px));
    margin: 0 auto;
    align-items: start;
}

.wo-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.wo-list-header h2,
.wo-list-header p {
    margin: 0;
}

.wo-list-header h2 {
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
}

.wo-list-header p {
    margin-top: 4px;
    color: var(--muted);
}

.wo-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: end;
    padding: 0;
}

.wo-filter-field {
    display: grid;
    gap: 5px;
}

.wo-filter-field span {
    color: var(--muted);
    font-weight: 700;
}

.wo-side-panel {
    position: sticky;
    top: 12px;
    gap: 16px;
}

.wo-side-create-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 14px 26px rgba(255, 0, 69, 0.22);
}

.wo-side-create-button:hover {
    background: var(--primary-dark);
}

.wo-side-create-button span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    font-size: 22px;
    line-height: 1;
}

.wo-side-section {
    display: grid;
    gap: 10px;
}

.wo-side-section h2 {
    margin: 0;
    color: #536579;
    font-size: 16px;
}

.wo-section-header,
.wo-current,
.wo-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.field-label em {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
}

.field-label em.is-required {
    border-color: rgba(180, 35, 24, 0.24);
    background: #fff1ef;
    color: var(--danger);
}

.wo-help-text {
    color: var(--muted);
    line-height: 1.35;
}

.wo-current {
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.wo-current .status-badge {
    border-color: rgba(43, 0, 80, 0.12);
    background: var(--surface-strong);
    color: var(--text);
}

.wo-panel h2,
.wo-column h2,
.wo-column p,
.wo-current h2,
.wo-current p {
    margin: 0;
}

.wo-column p,
.wo-current p {
    color: var(--muted);
    line-height: 1.45;
}

.wo-stats {
    justify-content: flex-end;
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-strong);
    font-weight: 700;
}

.wo-stats span:first-child {
    color: var(--primary);
    font-size: 22px;
}

.wo-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.wo-male-form-panel {
    width: 100%;
}

.wo-male-form-body[hidden] {
    display: none;
}

.wo-entry-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    align-items: end;
}

.wo-entry-fields .wo-help-text {
    align-self: center;
}

.wo-entry-fields label {
    align-self: center;
}

.wo-entry-fields #woNumbersInput {
    min-height: 68px;
}

.wo-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.wo-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.wo-table {
    min-width: 1180px;
}

.wo-transfer-picker {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.wo-transfer-picker[hidden] {
    display: none;
}

.wo-transfer-list-wrap {
    max-height: 440px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.wo-transfer-list-table {
    min-width: 920px;
}

.wo-transfer-list-table th,
.wo-transfer-list-table td {
    white-space: nowrap;
}

.wo-transfer-row-selected td {
    background: var(--primary-soft);
    color: var(--muted);
}

.wo-list-table {
    min-width: 980px;
}

.wo-movement-row td {
    height: 54px;
}

.wo-type-badge {
    display: inline-flex;
    align-items: center;
    min-width: 112px;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 10px 18px rgba(37, 0, 68, 0.12);
}

.wo-type-badge-entry {
    background: #780015;
}

.wo-type-badge-transfer {
    background: #6d00dc;
}

.wo-type-badge-exit {
    background: #463639;
}

.wo-type-badge-default {
    background: var(--purple);
}

.wo-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.wo-pagination span {
    min-width: 188px;
    text-align: center;
}

.wo-pagination button {
    min-height: 34px;
    padding: 0 12px;
}

.wo-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 24px;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.wo-sort-button::after {
    color: #95a1ad;
    content: "↕";
}

.wo-sort-button[data-sort-direction="asc"]::after {
    content: "↑";
}

.wo-sort-button[data-sort-direction="desc"]::after {
    content: "↓";
}

.wo-table th,
.wo-table td {
    padding: 6px 8px;
}

.wo-table tr.wo-line-removed td {
    background: #fff1ef;
    border-top-color: rgba(180, 35, 24, 0.22);
    border-bottom-color: rgba(180, 35, 24, 0.22);
}

.wo-table tr.wo-line-removed input,
.wo-table tr.wo-line-removed select,
.wo-table tr.wo-line-removed textarea {
    border-color: rgba(180, 35, 24, 0.28);
    background: #fffafa;
}

.wo-table tr.wo-line-entered td {
    background: #f1fbf6;
    border-top-color: rgba(19, 121, 91, 0.18);
    border-bottom-color: rgba(19, 121, 91, 0.18);
}

.wo-table tr.wo-line-entered input,
.wo-table tr.wo-line-entered select,
.wo-table tr.wo-line-entered textarea {
    border-color: rgba(19, 121, 91, 0.22);
    background: #fbfffd;
}

.wo-actions-cell {
    vertical-align: middle;
}

.wo-actions-content {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wo-actions-cell button {
    min-height: 26px;
}

.wo-stage-badge {
    display: inline-grid;
    gap: 3px;
    min-width: 96px;
    padding: 7px 9px;
    border: 1px solid #222;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
}

.wo-stage-badge small {
    color: inherit;
    font-size: 10px;
    font-weight: 800;
    opacity: 0.9;
}

.wo-stage-badge.is-ok {
    border-color: #13795b;
    background: #e7f7ef;
    color: #0f5f48;
}

.wo-stage-badge.is-manual {
    border-color: #b6bd35;
    background: #fbfde7;
    color: #526000;
}

.wo-stage-badge.is-pending {
    border-color: #222;
    background: #222;
    color: #fff;
}

.wo-stage-badge.is-blocked {
    border-color: #d85047;
    background: #fff1ef;
    color: #8f241c;
}

.wo-stage-badge.is-na {
    min-width: 34px;
    border-color: var(--line);
    background: var(--surface-strong);
    color: var(--muted);
    text-align: center;
}

.wo-close-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    padding: 16px;
    border: 1px solid rgba(180, 35, 24, 0.24);
    border-radius: 8px;
    background: #fff7f5;
}

.wo-completion-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.wo-completion-actions .wo-close-action {
    min-width: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
}

.wo-completion-actions button {
    min-height: 48px;
    width: 100%;
    margin-top: auto;
    white-space: normal;
}

.wo-save-action {
    background: #edf8f4;
    border-color: #98ceba;
}

.wo-completion-actions .wo-save-action h3 {
    color: #126447;
}

.wo-save-button {
    background: #13734f;
    color: #fff;
    border: 1px solid #13734f;
    border-radius: 6px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.wo-save-button:hover:not(:disabled) {
    background: #0d573b;
}

.wo-operation-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: rgba(37, 0, 68, 0.3);
}

.wo-operation-overlay[hidden] {
    display: none;
}

.wo-operation-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: calc(100% - 32px);
    padding: 24px;
    border-radius: 8px;
    background: var(--surface);
    font-size: 20px;
    box-shadow: var(--shadow);
}

.wo-operation-spinner {
    flex: 0 0 28px;
    height: 28px;
    border: 3px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: wo-spin 0.8s linear infinite;
}

@keyframes wo-spin {
    to { transform: rotate(360deg); }
}

.wo-close-action h3,
.wo-close-action p {
    margin: 0;
}

.wo-close-action h3 {
    color: var(--danger);
    font-size: 16px;
}

.wo-sql-preview {
    margin-top: 0;
}

.wo-line-input,
.wo-line-select,
.wo-line-textarea {
    min-width: 130px;
    font-size: 12px;
}

.wo-line-textarea {
    width: 220px;
    min-height: 44px;
    resize: vertical;
}

.wo-sql-preview #woSqlText {
    display: block;
    width: 100%;
    min-height: 340px;
    border: 0;
    padding: 12px;
    resize: vertical;
    color: #10202b;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
}

.wo-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
}

.wo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 33, 43, 0.48);
}

.wo-modal-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    width: min(480px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    padding: 18px;
    box-shadow: 0 24px 60px rgba(37, 0, 68, 0.24);
}

.wo-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.message.wo-floating-message {
    position: fixed;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 1100;
    width: min(600px, calc(100vw - 32px));
    max-height: min(40vh, 300px);
    overflow-y: auto;
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 20px;
    box-shadow: 0 14px 36px rgba(23, 33, 43, 0.16);
}

#ownerOperationFields,
#centerOperationFields,
#deactivateOperationFields,
#meatOwnerOperationFields,
#maleGroupOperationFields,
#publicSaleOperationFields,
#internalSaleOperationFields,
#productionDateOperationFields {
    display: grid;
    gap: 5px;
}

#centerOperationFields[hidden],
#ownerOperationFields[hidden],
#deactivateOperationFields[hidden],
#meatOwnerOperationFields[hidden],
#maleGroupOperationFields[hidden],
#publicSaleOperationFields[hidden],
#internalSaleOperationFields[hidden],
#productionDateOperationFields[hidden] {
    display: none;
}

select:focus,
input:focus,
button:focus {
    outline: 3px solid rgba(255, 122, 164, 0.38);
    outline-offset: 1px;
}

button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.primary-button {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 14px 26px rgba(255, 0, 69, 0.2);
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.secondary-button {
    border-color: var(--line);
    background: var(--surface-strong);
    color: var(--text);
}

.danger-button {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
    box-shadow: 0 14px 26px rgba(176, 0, 48, 0.18);
}

.danger-button:hover:not(:disabled) {
    background: #8f1b13;
}

.wo-warning-box {
    padding: 10px;
    border: 1px solid rgba(180, 35, 24, 0.24);
    border-radius: 6px;
    background: #fff7f5;
    color: #6f1b14;
    line-height: 1.4;
}

.counter {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.counter span:first-child {
    color: var(--primary);
    font-size: 26px;
    font-weight: 700;
}

.message {
    display: none;
    padding: 5px;
    border-radius: 6px;
    line-height: 1.4;
}

.message.is-visible {
    display: block;
}

.message.is-error {
    border: 1px solid rgba(180, 35, 24, 0.35);
    background: #fff1ef;
    color: var(--danger);
}

.message.is-success {
    border: 1px solid rgba(19, 121, 91, 0.35);
    background: #edf8f4;
    color: var(--success);
}

.content {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.table-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.inactive-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.inactive-toggle input {
    width: 18px;
    height: 18px;
}

.table-wrap {
    overflow: auto;
    max-height: calc(100vh - 120px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.horizontal-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
    margin-bottom: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.horizontal-scroll-top div {
    height: 1px;
}

table {
    width: 100%;
    min-width: 1550px;
    border-collapse: collapse;
}

th,
td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 12px;
    text-transform: uppercase;
}

.filter-row th {
    top: 23px;
    padding: 0;
    background: #fbf8fc;
}

.filter-row input {
    width: 100%;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 8px;
    font-size: 12px;
    text-transform: none;
}

.sort-button {
    width: 100%;
    min-height: 22px;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    text-transform: uppercase;
    font-size: 12px;
}

th.check-col,
td.check-col {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 32px;
    min-width: 32px;
    background: inherit;
}

thead th.check-col {
    z-index: 4;
    background: var(--surface-strong);
}

thead .filter-row th.check-col {
    background: #f7f9fb;
}

th.sticky-number,
td.sticky-number {
    position: sticky;
    left: 32px;
    z-index: 2;
    min-width: 110px;
    background: inherit;
    border-right: 1px solid #b8c2cc;
    box-shadow: 4px 0 8px rgba(23, 33, 43, 0.08);
}

thead th.sticky-number {
    z-index: 4;
    background: var(--surface-strong);
}

thead .filter-row th.sticky-number {
    background: #f7f9fb;
}

.sort-button.is-active::after {
    content: " ▲";
}

.sort-button.is-desc::after {
    content: " ▼";
}

tbody tr:hover {
    background: #fff7fa;
}

tbody td.check-col,
tbody td.sticky-number {
    background: #fff;
}

tbody tr:hover td.check-col,
tbody tr:hover td.sticky-number {
    background: #fff7fa;
}

.check-col {
    width: 32px;
    text-align: center;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.empty-state {
    height: 120px;
    color: var(--muted);
    text-align: center;
}

.owner-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sql-preview {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
}

.sql-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
}

.sql-preview-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

#sqlPreviewText {
    display: block;
    width: 100%;
    min-height: 260px;
    border: 0;
    padding: 12px;
    resize: vertical;
    color: #10202b;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .topbar,
    .table-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        min-height: 0;
        padding: 20px 16px 46px;
    }

    .topbar h1 {
        font-size: 32px;
    }

    .topbar p {
        font-size: 14px;
    }

    .brand-logo-card {
        width: 156px;
        height: 84px;
        border-radius: 16px;
    }

    .brand-logo-card img {
        width: 128px;
    }

    .app-shell,
    .tool-choice,
    .wo-board,
    .wo-form-grid {
        grid-template-columns: 1fr;
    }

    .app-shell,
    .wo-module-hero,
    .wo-home-workspace,
    .wo-detail-view {
        width: calc(100% - 24px);
        margin-left: auto;
        margin-right: auto;
    }

    .app-shell {
        margin-top: -26px;
    }

    .wo-module-hero {
        align-items: flex-start;
        padding: 22px 16px;
    }

    .wo-home-workspace {
        grid-template-columns: 1fr;
    }

    .wo-list-panel {
        padding: 16px;
    }

    .wo-side-panel {
        position: static;
        order: -1;
    }

    .wo-list-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .wo-close-action {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-shell {
        min-height: auto;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}
/* Farm departure selection: separate the view action from final confirmation. */
.farm-departure-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.farm-departure-card > p,
.farm-departure-card > small { margin: 0; }
.wo-office-tracking { margin: 12px 0; }
.wo-office-tracking h2 { margin: 0; font-size: 18px; }
.wo-office-phases { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.wo-office-phase { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 12px; }
.wo-office-phase.is-done { border-color: #97cbb5; background: #e7f7ef; color: #0f5f48; }
.wo-office-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.wo-office-count { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.wo-office-count strong { font-size: 24px; line-height: 1; }
.wo-office-count span { font-size: 12px; font-weight: 600; }
.wo-office-count.is-ok { background: #e7f7ef; color: #0f5f48; }
.wo-office-count.is-blocked { background: #fff1ef; color: #8f241c; }
.wo-office-count.is-manual { background: #fbfde7; color: #526000; }
.wo-tracking-cell { min-width: 240px; max-width: 340px; vertical-align: top; }
.wo-line-tracking { display: grid; gap: 5px; padding: 2px 0; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
.wo-line-tracking p { margin: 0; }
.wo-line-tracking > strong { font-size: 13px; }
.wo-tracking-warning { color: #8f241c; font-weight: 600; }
.wo-line-tracking details { margin-top: 3px; }
.wo-line-tracking summary { cursor: pointer; color: var(--purple); text-decoration: underline; }
.wo-line-tracking details p { margin-top: 5px; }
.wo-table tr.wo-line-manual td { background: #fbfde7; border-color: #e3e7ba; }
.wo-table tr.wo-line-manual input,
.wo-table tr.wo-line-manual select,
.wo-table tr.wo-line-manual textarea { background: #fffff7; border-color: #d4d9a1; }
.wo-office-route-alerts p { padding: 9px 12px; border-left: 3px solid #d85047; background: #fff1ef; color: #8f241c; font-size: 13px; }
.wo-office-activity { margin-top: 10px; font-size: 13px; }
.wo-office-activity > summary { cursor: pointer; font-weight: 600; }
.wo-office-activity li { margin: 10px 0; }
.wo-office-activity li p { margin: 3px 0; }
.wo-office-activity time { color: var(--muted); margin-right: 6px; }
@font-face { font-family: "SC Work Orders"; src: url("space-grotesk.ttf") format("truetype"); font-display: swap; font-weight: 300 700; }
body.wo-office-page { font-family: "SC Work Orders", "Segoe UI", Arial, sans-serif; font-size: 14px; }
.wo-office-page .topbar { min-height: 88px; padding: 12px 20px; gap: 20px; }
.wo-office-page .brand-logo-card { width: 112px; height: 62px; border-radius: 10px; }
.wo-office-page .brand-logo-card img { width: 94px; }
.wo-office-page .topbar h1 { font-size: 27px; line-height: 1.2; }
.wo-office-page .topbar p { font-size: 13px; }
.wo-office-page .topbar .eyebrow { font-size: 10px; margin-bottom: 4px; }
.wo-office-page .user-bar { gap: 8px; font-size: 12px; }
.wo-office-page .work-order-shell { width: calc(100% - 32px); max-width: none; margin: 16px auto; }
.wo-office-page .wo-detail-view, .wo-office-page .wo-form-grid, .wo-office-page .wo-panel { min-width: 0; }
.wo-office-page .wo-panel { padding: 16px; gap: 12px; }
.wo-office-page .wo-panel h2, .wo-office-page .wo-current h2 { font-size: 20px; }
.wo-office-page .wo-help-text, .wo-office-page .wo-current p { font-size: 13px; line-height: 1.45; color: #62546d; }
.wo-office-page .wo-current { gap: 12px; padding: 14px 16px; }
.wo-office-page .wo-current > div:first-child { flex: 1 1 420px; }
.wo-office-page .wo-current .wo-stats { min-width: 100px; padding: 8px 12px; }
.wo-office-page .wo-office-tracking { margin: 0; gap: 10px; }
.wo-office-page .wo-section-header { margin-bottom: 0; }
.wo-office-page .wo-office-phases { margin: 0; }
.wo-office-page .wo-office-phase { font-size: 13px; }
.wo-office-page .wo-office-count { padding: 10px 12px; }
.wo-office-page .wo-office-count span { font-size: 14px; }
.wo-office-page #woOfficeTrackingNote { margin: 0; }
.wo-office-page .wo-office-route-alerts:empty { display: none; }
.wo-office-page .wo-office-route-alerts p { margin: 5px 0; }
.wo-office-page .wo-office-activity { margin-top: 0; font-size: 14px; }
.wo-office-page .wo-male-form-panel .wo-section-header h2 { font-size: 17px; }
.wo-lines-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.wo-lines-toolbar label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.wo-lines-toolbar .wo-line-search { flex: 1 1 260px; }
.wo-lines-toolbar select { min-width: 195px; }
.wo-view-switch { display: flex; gap: 4px; }
.wo-view-switch button[aria-pressed="true"] { background: #2d004c; border-color: #2d004c; color: white; }
.wo-office-page button, .wo-office-page input, .wo-office-page select, .wo-office-page textarea { font-family: inherit; }
.wo-office-page .secondary-button, .wo-office-page .primary-button { font-size: 14px; min-height: 38px; }
.wo-office-page .wo-lines-toolbar input, .wo-office-page .wo-lines-toolbar select { padding: 8px 10px; font-size: 14px; min-height: 38px; }
.wo-office-page #woVisibleLineSummary { margin: 0; }
.wo-office-page #woMovementLinesTable { max-height: 68vh; scroll-padding-block: 46px 12px; }
.wo-office-page #woMovementLinesTable .wo-table { width: 100%; font-size: 14px; min-width: 1600px; }
.wo-office-page #woMovementLinesTable[data-view="tracking"] .wo-table { min-width: 1050px; }
.wo-office-page #woMovementLinesTable th { position: sticky; top: 0; z-index: 3; background: #f4eff7; font-size: 13px; text-transform: none; letter-spacing: normal; padding: 11px 10px; }
.wo-office-page #woMovementLinesTable td { padding: 10px; vertical-align: top; }
.wo-office-page #woMovementLinesTable td:first-child, .wo-office-page #woMovementLinesTable th:first-child { position: sticky; left: 0; min-width: 145px; box-shadow: 1px 0 var(--line); }
.wo-office-page #woMovementLinesTable th:first-child { z-index: 4; }
.wo-office-page #woMovementLinesTable td:first-child { z-index: 2; background: white; }
.wo-office-page #woMovementLinesTable .wo-line-entered td:first-child { background: #f0fbf7; }
.wo-office-page #woMovementLinesTable .wo-line-removed td:first-child { background: #fff1ef; }
.wo-office-page #woMovementLinesTable .wo-line-manual td:first-child { background: #fbfde7; }
.wo-animal-id strong { display: block; font-size: 15px; }
.wo-animal-id small, .wo-animal-identification small, .wo-animal-identification span { display: block; margin-top: 4px; font-size: 13px; }
.wo-animal-identification { min-width: 185px; max-width: 230px; white-space: normal; overflow-wrap: anywhere; }
.wo-office-page .wo-line-tracking { font-size: 13px; max-width: 330px; }
.wo-office-page .wo-line-tracking > strong { font-size: 14px; }
.wo-office-page .wo-stage-badge { font-size: 13px; padding: 8px; }
.wo-office-page .wo-stage-badge small { font-size: 12px; }
.wo-office-page .wo-line-input, .wo-office-page .wo-line-select { font-size: 14px; padding: 8px; min-height: 38px; }
.wo-office-page .wo-actions-content { gap: 6px; min-width: 120px; }
.wo-office-page .wo-actions-content button { font-size: 13px; padding: 6px 9px; }
.wo-office-page .wo-actions-content button[aria-pressed="true"] { border-color: #2d004c; color: #2d004c; font-weight: 700; opacity: 1; }
.wo-office-page .wo-completion-actions { padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 16px; }
.wo-office-page .wo-close-action { padding: 12px; gap: 8px; }
.wo-office-page .wo-close-action h3 { font-size: 16px; margin: 0; }
.wo-office-page .wo-close-action p { margin: 4px 0 0; }
.wo-office-page .wo-close-action button { min-height: 42px; font-size: 14px; }
@media (max-width: 900px) {
    .wo-office-page .topbar { flex-wrap: wrap; gap: 10px; }
    .wo-office-page .topbar h1 { font-size: 23px; }
    .wo-office-page .user-bar { width: 100%; justify-content: flex-end; }
    .wo-office-page .work-order-shell { width: calc(100% - 16px); margin: 8px auto; }
    .wo-office-page .wo-completion-actions { position: static; }
    .wo-lines-toolbar > label { flex: 1 1 200px; }
}
.wo-office-page .wo-lines-toolbar a.secondary-button { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.wo-office-page #woMovementLinesTable input:disabled,
.wo-office-page #woMovementLinesTable select:disabled,
.wo-office-page #woMovementLinesTable textarea:disabled { opacity: 1; color: var(--text); background: var(--surface-soft); }
.wo-office-page .wo-home-workspace { width: 100%; max-width: none; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
.wo-office-page .wo-detail-view { width: 100%; max-width: none; margin-inline: 0; }
.wo-office-page .wo-list-table th, .wo-office-page .wo-sort-button { font-size: 13px; }
.wo-office-page .wo-list-table td { font-size: 14px; padding: 10px; }
.wo-office-page .wo-pagination { flex-wrap: wrap; gap: 8px; }
.wo-office-page .wo-side-panel label, .wo-office-page .wo-side-panel input, .wo-office-page .wo-side-panel select { font-size: 14px; }
@media (max-width: 1100px) { .wo-office-page .wo-home-workspace { grid-template-columns: 1fr; } }
.wo-office-page .wo-module-hero { padding: 16px 20px; }
.wo-office-page .wo-module-hero h2 { font-size: 24px; }
.wo-trip-group-overview > .wo-section-header p { margin: 6px 0 0; font-size: 14px; }
.wo-office-page #woTripPlanner { min-width: 0; max-width: 100%; }
.wo-trip-group-links { display: flex; flex-wrap: wrap; gap: 8px; }
.wo-trip-ot-link { padding: 5px 9px; min-height: 30px; font: inherit; font-size: 13px; font-weight: 600; color: #2d004c; background: white; border: 1px solid #d6c8e1; border-radius: 7px; cursor: pointer; }
.wo-trip-ot-link.is-current { background: #eee5f5; border-color: #735087; }
.wo-trip-before-after { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.wo-trip-before-after > section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.wo-trip-before-after > .wo-trip-result-card { background: #f3fbf7; }
.wo-trip-before-after h3 { font-size: 19px; margin: 0 0 12px; }
.wo-trip-before-after .eyebrow { font-size: 11px; margin-bottom: 6px; }
.wo-trip-before-after p { margin: 6px 0; font-size: 14px; }
.wo-trip-stop-summary { display: grid; gap: 5px; padding: 10px 0; border-top: 1px solid var(--line); }
.wo-trip-stop-summary > .wo-trip-ot-link { justify-self: start; }
.wo-trip-stop-summary strong { overflow-wrap: anywhere; }
.wo-trip-stop-summary p { margin: 0; }
.wo-trip-stop-summary details { font-size: 13px; }
.wo-trip-stop-summary summary { cursor: pointer; text-decoration: underline; }
.wo-trip-stop-summary ul { margin: 7px 0; display: flex; gap: 8px 16px; flex-wrap: wrap; padding-left: 20px; }
.wo-trip-difference { padding: 2px 6px; border-radius: 4px; background: #fff0cc; color: #6e4300; font-weight: 700; }
.wo-trip-deviations > h3,.wo-trip-not-exited > h3 { font-size: 17px; margin: 4px 0 8px; }
.wo-trip-deviation { padding: 14px; border: 1px solid #dfbe71; border-left: 4px solid #b07700; border-radius: 10px; background: #fff9e9; }
.wo-trip-deviation + .wo-trip-deviation { margin-top: 10px; }
.wo-trip-deviation h3 { margin: 0 0 10px; font-size: 18px; }
.wo-trip-deviation p { margin: 8px 0 0; font-size: 14px; }
.wo-trip-route-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.wo-trip-route-comparison > div { display: grid; gap: 5px; justify-items: start; min-width: 0; }
.wo-trip-route-comparison span { color: #6e4300; font-size: 13px; font-weight: 600; }
.wo-trip-route-comparison strong { font-size: 15px; overflow-wrap: anywhere; }
.wo-trip-not-exited p { margin: 6px 0; padding: 10px; background: #fff1ef; border-radius: 8px; }
@media (max-width: 760px) { .wo-trip-before-after,.wo-trip-route-comparison { grid-template-columns: 1fr; } }
