:root {
    --ink: #12202b;
    --ink-soft: #4a5d6a;
    --paper: #f3f6f4;
    --panel: #ffffff;
    --line: #d7e0db;
    --teal: #0f766e;
    --teal-deep: #0b5c56;
    --teal-soft: #d8f3ef;
    --amber: #b45309;
    --amber-soft: #fff4e5;
    --danger: #b42318;
    --shadow: 0 18px 40px rgba(18, 32, 43, 0.08);
    --radius: 18px;
    --font-sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --font-display: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Auth */
.auth-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #16343a;
    background-image:
        linear-gradient(180deg, rgba(16, 32, 41, 0.55) 0%, rgba(16, 32, 41, 0.35) 45%, rgba(16, 32, 41, 0.6) 100%),
        url("../assets/auth-background.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.auth-shell {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-body .app-footer {
    border-top: 0;
    color: rgba(247, 251, 249, 0.82);
    background: rgba(16, 32, 41, 0.28);
}

.auth-simple {
    width: min(100%, 400px);
}

.auth-brand-simple {
    display: flex;
    justify-content: center;
    margin: 0 0 1.75rem;
}

.auth-logo {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.sidebar-brand strong,
.topbar-title,
.page-header h1,
.auth-card h2,
.metric-value {
    font-family: var(--font-display);
}

.auth-card {
    width: 100%;
    padding: 2rem 1.75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    animation: rise 500ms ease both;
}

.auth-kicker {
    margin: 0 0 0.5rem;
    color: var(--teal);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    margin: 0.4rem 0 1.5rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field label {
    font-size: 0.9rem;
    font-weight: 600;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font: inherit;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: fit-content;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
}

.field .remember {
    min-height: 2.9rem;
}

.remember input[type="checkbox"],
.field input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    accent-color: var(--teal);
}

.remember input[type="checkbox"]:focus,
.field input[type="checkbox"]:focus {
    outline: 2px solid rgba(15, 118, 110, 0.35);
    outline-offset: 2px;
    box-shadow: none;
}

.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-inline-link {
    color: var(--teal-deep);
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-inline-link:hover {
    color: var(--teal);
    text-decoration: underline;
}

.auth-form .btn-primary {
    width: 100%;
}

.auth-footer-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0.75rem;
    justify-items: start;
}

.auth-footer-actions p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.auth-footer-actions-stack {
    justify-items: stretch;
}

.auth-footer-actions-stack .auth-inline-link {
    text-align: center;
}

.btn-inline {
    display: inline-flex;
    width: auto;
    margin-top: 0;
    text-decoration: none;
}

.btn-primary,
.btn-ghost,
.btn-secondary {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.btn-primary {
    margin-top: 0.35rem;
    padding: 0.95rem 1.1rem;
    border-radius: 12px;
    background: var(--teal);
    color: #fff;
    transition: background 160ms ease, transform 160ms ease;
}

.btn-primary:hover {
    background: var(--teal-deep);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.1rem;
    border-radius: 12px;
    background: var(--teal-soft);
    color: var(--teal-deep);
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.btn-secondary:hover {
    background: #c7ebe5;
    transform: translateY(-1px);
}

.form-error,
.field-error {
    color: var(--danger);
    font-size: 0.86rem;
}

.form-error ul {
    margin: 0;
    padding-left: 1.1rem;
}

/* App shell */
.app-body {
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.05), transparent 18rem),
        var(--paper);
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem 1.15rem;
    background: #102029;
    color: #eef6f3;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-brand-mark {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: var(--teal);
    font-family: var(--font-display);
    font-weight: 700;
}

.sidebar-brand span {
    display: grid;
}

.sidebar-brand strong {
    font-size: 1.05rem;
}

.sidebar-brand small {
    color: rgba(238, 246, 243, 0.7);
}

.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.nav-section-label {
    margin: 0.85rem 0 0.25rem;
    padding: 0 0.95rem;
    color: rgba(238, 246, 243, 0.45);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-section-label:first-child {
    margin-top: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    color: rgba(238, 246, 243, 0.78);
    transition: background 160ms ease, color 160ms ease;
}

.nav-link-icon {
    width: 1.1rem;
    text-align: center;
    opacity: 0.75;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(15, 118, 110, 0.28);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.75rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(238, 246, 243, 0.1);
    transition: background 160ms ease;
}

.user-chip:hover {
    background: rgba(15, 118, 110, 0.22);
}

.user-chip-avatar {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    background: var(--teal);
    font-family: var(--font-display);
    font-weight: 700;
}

.user-chip-copy {
    display: grid;
    min-width: 0;
}

.user-chip-copy strong {
    font-size: 0.9rem;
}

.user-chip-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(238, 246, 243, 0.65);
}

.user-chip-topbar {
    max-width: 16rem;
    padding: 0.4rem 0.75rem 0.4rem 0.4rem;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.user-chip-topbar .user-chip-avatar {
    width: 2rem;
    height: 2rem;
    color: #fff;
}

.user-chip-topbar .user-chip-copy small {
    color: var(--ink-soft);
}

.user-chip-topbar:hover,
.user-chip-topbar.is-active {
    background: var(--teal-soft);
    border-color: rgba(15, 118, 110, 0.35);
}

.btn-ghost {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    background: transparent;
    color: rgba(238, 246, 243, 0.86);
    border: 1px solid rgba(238, 246, 243, 0.14);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
}

.topbar-left {
    min-width: 0;
}

.topbar-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.topbar-logout {
    margin: 0;
}

.btn-topbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.btn-topbar:hover,
.btn-topbar.is-active {
    border-color: rgba(15, 118, 110, 0.35);
    background: var(--teal-soft);
    color: var(--teal-deep);
}

.btn-topbar-muted {
    color: var(--ink-soft);
}

.content {
    flex: 1;
    padding: 2rem;
}

.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding: 1rem 2rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.86rem;
}

.app-footer p {
    margin: 0;
}

.app-footer-powered {
    font-weight: 500;
}

.page-header {
    margin-bottom: 1.75rem;
    animation: rise 500ms ease both;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    color: var(--ink-soft);
    font-size: 0.86rem;
}

.breadcrumb a {
    color: var(--teal);
    font-weight: 600;
}

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.page-subtitle {
    margin: 0.55rem 0 0;
    color: var(--ink-soft);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    animation: rise 550ms ease both;
}

.metric:nth-child(2) { animation-delay: 60ms; }
.metric:nth-child(3) { animation-delay: 120ms; }
.metric:nth-child(4) { animation-delay: 180ms; }

.metric-warn {
    background: linear-gradient(180deg, var(--amber-soft), #fff);
}

.metric-label,
.metric-hint {
    margin: 0;
    color: var(--ink-soft);
}

.metric-label {
    font-size: 0.88rem;
    font-weight: 600;
}

.metric-value {
    margin: 0.55rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.metric-hint {
    font-size: 0.84rem;
}

.panel {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    animation: rise 600ms ease 120ms both;
}

.panel-header h2 {
    margin: 0 0 0.45rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.panel-header p {
    margin: 0;
    color: var(--ink-soft);
}

.checklist {
    margin: 1.25rem 0 0;
    padding-left: 1.15rem;
    color: var(--ink-soft);
    line-height: 1.7;
}

.form-panel {
    max-width: none;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.account-side {
    display: grid;
    gap: 1rem;
}

.action-card {
    padding: 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f7fbf9);
    box-shadow: var(--shadow);
    animation: rise 550ms ease both;
}

.action-card-muted {
    background: #fff;
}

.action-card-kicker {
    margin: 0 0 0.4rem;
    color: var(--teal);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.action-card h2 {
    margin: 0 0 0.45rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.action-card p {
    margin: 0 0 1rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.action-card-email {
    font-weight: 600;
    color: var(--ink) !important;
    word-break: break-word;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-action {
    display: grid;
    gap: 0.35rem;
    padding: 1.2rem 1.3rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    transition: border-color 160ms ease, transform 160ms ease;
}

.quick-action:hover {
    border-color: rgba(15, 118, 110, 0.35);
    transform: translateY(-2px);
}

.quick-action strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.quick-action span {
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.45;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-pill-ok {
    background: var(--teal-soft);
    color: var(--teal-deep);
}

.status-pill-off {
    background: #fdecec;
    color: var(--danger);
}

.app-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.form-actions .btn-primary {
    margin-top: 0;
}

.input-readonly {
    background: #eef3f0 !important;
    color: var(--ink-soft);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem 0 0.25rem;
}

.detail-value {
    margin: 0.35rem 0 0;
    font-weight: 600;
}

.status-banner {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: var(--teal-soft);
    color: var(--teal-deep);
    font-weight: 600;
    animation: rise 400ms ease both;
}

/* Freight system components */
.status-banner-error {
    background: #fdecec;
    color: var(--danger);
}

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 0.75rem;
}

.data-table th,
.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
}

.data-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.045);
}

.data-table .num {
    text-align: right;
}

.data-table tfoot td {
    border-bottom: 0;
    padding-top: 0.5rem;
}

.table-link {
    color: var(--teal-deep);
    font-weight: 600;
}

.table-link:hover {
    text-decoration: underline;
}

.table-subtext {
    display: block;
    color: var(--ink-soft);
    font-size: 0.82rem;
}

.row-voided td {
    opacity: 0.55;
}

.status-pill-stage {
    background: #e7effc;
    color: #1d4ed8;
}

.empty-hint {
    margin: 1rem 0 0.25rem;
    color: var(--ink-soft);
}

.filter-panel {
    position: relative;
    z-index: 5;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.filter-form input[type="text"],
.filter-form input[type="date"],
.filter-form input[type="number"],
.filter-form select {
    box-sizing: border-box;
    height: 2.65rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 0.75rem;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.2;
    color: var(--ink);
    background: #fff;
}

.filter-form input[type="number"] {
    width: 5.5rem;
    min-width: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.filter-form input[type="number"]::-webkit-outer-spin-button,
.filter-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-form .filter-search {
    flex: 1 1 240px;
}

.filter-form .btn-secondary,
.filter-form .btn-primary {
    padding: 0.6rem 1rem;
}

.jobs-filter-form {
    display: grid;
    gap: 1.15rem;
}

.jobs-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.jobs-filter-grid .field label {
    font-size: 0.82rem;
}

.multi-dropdown {
    position: relative;
    z-index: 1;
}

.multi-dropdown.is-open {
    z-index: 10;
}

.multi-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font: inherit;
    text-align: left;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.multi-dropdown-trigger:hover {
    border-color: rgba(15, 118, 110, 0.35);
}

.multi-dropdown.is-open .multi-dropdown-trigger,
.multi-dropdown-trigger:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.multi-dropdown-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-dropdown-caret {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--ink-soft);
    border-bottom: 2px solid var(--ink-soft);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
}

.multi-dropdown.is-open .multi-dropdown-caret {
    transform: rotate(225deg) translateY(-1px);
}

.multi-dropdown-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    max-height: 16rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.jobs-filter-grid .multi-dropdown-option,
.multi-dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}

.multi-dropdown-option:hover {
    background: rgba(15, 118, 110, 0.08);
}

.multi-dropdown-option span {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
    white-space: nowrap;
}

.field .multi-dropdown-option input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    accent-color: var(--teal);
}

.field .multi-dropdown-option input[type="checkbox"]:focus {
    box-shadow: none;
}

.jobs-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--line);
}

.jobs-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.jobs-filter-buttons .btn-primary,
.jobs-filter-buttons .btn-secondary {
    margin-top: 0;
}

.ajax-table-panel.is-loading,
.jobs-table-panel.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.table-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-range {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pagination-page {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.pagination-page:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: var(--teal-soft);
    color: var(--teal-deep);
}

.pagination-page.is-active {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.staff-prod-filters {
    align-items: end;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.filter-inline {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.filter-inline input[type="date"],
.filter-inline select {
    min-width: 9rem;
}

.filter-inline input[type="number"] {
    align-self: stretch;
    min-width: 0;
    width: 5.5rem;
}

.report-legend {
    margin: 0 0 1.25rem;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

.report-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.staff-prod-table .staff-name {
    font-weight: 600;
}

.attention-pill {
    display: inline-block;
    margin-left: 0.45rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.12);
    color: #9a3412;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

.row-attention td {
    background: rgba(254, 243, 199, 0.35);
}

.cell-warn {
    color: #9a3412;
    font-weight: 700;
}

.muted-meta {
    color: var(--ink-soft);
    font-size: 0.88em;
}

.stage-bar-static {
    cursor: default;
    text-decoration: none;
    color: inherit;
}

.stage-docs-block {
    margin-top: 0.35rem;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: rgba(15, 118, 110, 0.03);
}

.stage-docs-label {
    margin: 0 0 0.25rem;
    font-weight: 650;
    color: var(--ink);
}

.optional-tag {
    margin-left: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stage-docs-hint {
    margin: 0 0 0.85rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.field-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.file-picker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
    min-height: 2.65rem;
}

.file-picker-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-picker-trigger {
    margin: 0;
    cursor: pointer;
}

.file-picker-names {
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.3;
    word-break: break-word;
}

.field .file-picker-input,
.field .file-picker-input:focus {
    width: 1px;
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.history-docs {
    margin: 0;
    padding: 0;
    list-style: none;
}

.history-docs li + li {
    margin-top: 0.2rem;
}

@media (max-width: 1100px) {
    .jobs-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .jobs-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Pipeline */
.pipeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    list-style: none;
    margin: 1.25rem 0 0.5rem;
    padding: 0;
}

.pipeline-step {
    position: relative;
    flex: 1 1 0;
    min-width: 88px;
    text-align: center;
    padding-top: 1.4rem;
}

.pipeline-step::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: -50%;
    width: 100%;
    height: 3px;
    background: var(--line);
}

.pipeline-step:first-child::before {
    display: none;
}

.pipeline-dot {
    position: absolute;
    top: 0.2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--line);
    z-index: 1;
}

.pipeline-done .pipeline-dot,
.pipeline-done::before {
    background: var(--teal);
    border-color: var(--teal);
}

.pipeline-current .pipeline-dot {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18);
}

.pipeline-current::before {
    background: var(--teal);
}

.pipeline-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.pipeline-current .pipeline-label {
    color: var(--teal-deep);
}

.pipeline-done .pipeline-label {
    color: var(--ink);
}

.stage-advance-form {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.stage-advance-form h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

/* Dashboard widgets */
.stage-bars {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.stage-bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 34px;
    align-items: center;
    gap: 0.75rem;
}

.stage-bar-row:hover .stage-bar-label {
    color: var(--teal-deep);
}

.stage-bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.stage-bar-track {
    height: 0.6rem;
    background: #edf2ef;
    border-radius: 999px;
    overflow: hidden;
}

.stage-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--teal);
}

.stage-bar-count {
    text-align: right;
    font-weight: 700;
    font-family: var(--font-display);
}

.volume-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 170px;
    margin-top: 1.25rem;
}

.volume-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 0.3rem;
}

.volume-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--teal), var(--teal-deep));
}

.volume-count {
    font-size: 0.78rem;
    font-weight: 700;
}

.volume-label {
    font-size: 0.72rem;
    color: var(--ink-soft);
}

/* Forms */
.form-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem 1.25rem 1.25rem;
    margin: 0;
}

.form-section legend {
    padding: 0 0.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--teal-deep);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.field-span-2 {
    grid-column: span 2;
}

.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font: inherit;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.detail-list {
    display: grid;
    gap: 0;
    margin: 0.75rem 0 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eef2ef;
}

.detail-list dt {
    color: var(--ink-soft);
    font-size: 0.86rem;
    font-weight: 600;
}

.detail-list dd {
    margin: 0;
    font-size: 0.92rem;
}

.upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin: 1rem 0 0.5rem;
    padding: 0.9rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
}

.upload-form input[type="text"],
.upload-form select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    background: #fff;
}

.upload-form input[type="text"] {
    flex: 1 1 160px;
}

.btn-danger {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0.8rem 1.1rem;
    border-radius: 12px;
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #8f1c13;
}

.btn-link-danger {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--danger);
    padding: 0;
}

.btn-link-danger:hover {
    text-decoration: underline;
}

.invoice-lines-table input[type="text"],
.invoice-lines-table input[type="number"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font: inherit;
}

.invoice-lines-table input[type="number"] {
    max-width: 110px;
    text-align: right;
}

@media (max-width: 1100px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: span 1;
    }

    .stage-bar-row {
        grid-template-columns: 120px 1fr 30px;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .metric-grid,
    .quick-actions,
    .account-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 1rem;
    }

    .content,
    .topbar,
    .app-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        padding: 1.5rem 1rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-header-actions,
    .form-actions {
        width: 100%;
    }

    .page-header-actions .btn-primary,
    .page-header-actions .btn-secondary,
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}
