a { color: var(--green-700); text-decoration: none; font-weight: 500; }
a:hover { color: var(--green-600); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--green-700);
    outline-offset: 3px;
}
button, input[type="submit"], input[type="button"], input[type="reset"] {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--green);
    border-radius: var(--radius-small);
    background: var(--green);
    color: var(--surface);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover { background: var(--green-600); }
.button-with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.company-section-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px 18px; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--ink-2); font: inherit; text-align: left; }
.company-section-toggle:hover { background: var(--green-soft); color: var(--green-700); }
.company-section-toggle[aria-expanded="true"] { border-radius: var(--radius-small) var(--radius-small) 0 0; }
.company-section-toggle > span { flex: 1; min-width: 0; }
.company-section-toggle:focus-visible { outline-offset: -3px; }
.company-section-exports > a { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink-2); font-size: 12px; }
.company-section-exports > a:hover { border-color: var(--green); color: var(--green-700); }
@media (max-width: 640px) {
    .company-section-toggle { padding: 14px; }
}
.button-with-icon.form-warn { background: var(--error); border-color: var(--error); color: var(--surface); }
.button-with-icon.form-warn:hover { background: var(--error); filter: brightness(.92); }
button:disabled, input:disabled { opacity: .6; cursor: default; }
.login-card #loginSubmit { width: 100%; margin-top: 4px; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]), select, textarea {
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink-2);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--green-700); }
.inbound-position-selection .toggle-order { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
textarea { resize: vertical; }

.page-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    max-width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--green);
    border-radius: var(--radius-small);
    background: var(--green);
    color: var(--surface);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
}
.page-actions a:hover { background: var(--green-600); border-color: var(--green-600); }

a.table-row-action { display: inline-flex; flex: 0 0 var(--row-action-size, 44px); align-items: center; justify-content: center; width: var(--row-action-size, 44px); height: var(--row-action-size, 44px); border: 0; border-radius: 0; background: var(--green); color: var(--surface); text-decoration: none; }
a.table-row-action:hover { background: var(--green-600); color: var(--surface); }
a.table-row-action--delete { background: var(--row-action-delete); }
a.table-row-action--delete:hover { background: var(--row-action-delete-hover); }
a.table-row-action--reminder { background: var(--warning); }
a.table-row-action--reminder:hover { background: var(--warning); filter: brightness(.92); }
a.table-row-action:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.company-bookings a.company-booking-action { display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 6px; background: var(--green); color: var(--surface); }
.company-bookings a.company-booking-action:hover { background: var(--green-600); color: var(--surface); }
.company-bookings a.company-booking-action--danger { background: var(--error); }
.company-bookings a.company-booking-action--danger:hover { background: var(--error); filter: brightness(.92); }
.accounting-document-link { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 48px; padding: 12px 16px; font-size: 13px; }
.accounting-document-link:hover { background: var(--green-soft); }
.accounting-document-link:focus-visible { outline-offset: -3px; }
.order-documents a.order-document-send { color: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 8px 16px; border-radius: var(--radius-small); background: var(--green); font-size: 14px; font-weight: 600; }
.order-documents a.order-document-send:hover { background: var(--green-600); color: var(--surface); }
.relaunch-send-documents-dialog .send-document-actions > button { min-width: 140px; }
.relaunch-send-documents-dialog .send-document-preview { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; }
.order-document-link { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 16px; font-size: 13px; }
.order-document-link:hover { background: var(--green-soft); }
.order-document-link:focus-visible { outline-offset: -3px; }
.order-document-upload-card .document-upload-header a.download-document { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; min-height: 34px; max-width: 100%; margin-left: auto; padding: 6px 10px; border-radius: 7px; background: var(--green); color: var(--surface); font-size: 12px; font-weight: 600; white-space: nowrap; }
.order-document-upload-card .document-upload-header a.download-document:hover { background: var(--green-600); color: var(--surface); }
.order-document-upload-card .fileinput-button { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; position: relative; min-height: 40px; max-width: calc(100% - 32px); margin: 16px; padding: 8px 16px; border-radius: var(--radius-small); background: var(--green); color: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; overflow: hidden; }
.order-document-upload-card .fileinput-button:hover { background: var(--green-600); }
.order-document-upload-card .fileinput-button:focus-within { outline: 3px solid var(--green-700); outline-offset: 3px; }
.order-document-upload-card .fileinput-button.disabled { opacity: .6; cursor: default; }
.order-document-upload-card .fileinput-button input.file-upload { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }

button.detail-delete { background: var(--row-action-delete); border-color: var(--row-action-delete); color: var(--surface); }
button.detail-delete:hover { background: var(--row-action-delete-hover); border-color: var(--row-action-delete-hover); }
a.detail-open-link { color: inherit; font-weight: inherit; }
a.detail-open-link:hover { color: var(--green-700); text-decoration: underline; }

.lookup-control { position: relative; width: 100%; min-width: 0; }
.lookup-control > input[type="text"] { display: block; width: 100%; }
.lookup-control:has(> .modal-search-link) > input[type="text"] { padding-right: 80px; }
.lookup-control > :is(.modal-search-link, .modal-reset-link) {
    position: absolute;
    top: 1px;
    bottom: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    border-radius: 6px;
    color: var(--ink-2);
}
.lookup-control > .modal-search-link { right: 38px; }
.lookup-control > .modal-reset-link { right: 2px; }
.lookup-control > :is(.modal-search-link, .modal-reset-link):hover { background: var(--green-soft); color: var(--green-700); }
.lookup-control > :is(.modal-search-link, .modal-reset-link):focus-visible { outline-offset: -3px; }
.lookup-control:has(> .form-error.help-block) > :is(.modal-search-link, .modal-reset-link) { bottom: auto; height: 38px; }

.date-input-control { position: relative; width: 100%; min-width: 0; }
.date-input-control > input.hasDatepicker {
    display: block;
    width: 100%;
    padding-right: 46px;
}
.date-input-control > button.ui-datepicker-trigger {
    position: absolute;
    top: 1px;
    right: 2px;
    bottom: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-2);
}
.date-input-control > button.ui-datepicker-trigger:hover { background: var(--green-soft); color: var(--green-700); }
.date-input-control > button.ui-datepicker-trigger:focus-visible { outline-offset: -3px; }
.date-input-control:has(> .form-error.help-block) > button.ui-datepicker-trigger { bottom: auto; height: 38px; }

/* Override the validator's legacy inline border color and bitmap error badge. */
:is(input, select, textarea).error:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.field-has-error > :is(input, select, textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.field-has-error > .lookup-control > input,
.field-has-error > .date-input-control > input,
.field-has-error > .selectize-control > .selectize-input {
    border-color: var(--error) !important;
    background-color: var(--error-soft) !important;
    background-image: none !important;
    outline-color: var(--error);
}

/* Native checkboxes retain keyboard handling and form values as visual switches. */
input[type="checkbox"] {
    appearance: none;
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
    min-height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #d0d4da;
    cursor: pointer;
    vertical-align: middle;
    transition: background 160ms ease;
}
input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
    transition: transform 160ms ease;
}
input[type="checkbox"]:checked { background: var(--green); }
input[type="checkbox"]:checked::after { transform: translateX(18px); }
input[type="checkbox"]:disabled { cursor: default; }
@media (prefers-reduced-motion: reduce) {
    input[type="checkbox"], input[type="checkbox"]::after { transition: none; }
}
