:root {
    --brand-teal: #4e2121;
    --brand-teal-hover: #3a1818;
    --brand-navy: #4e2121;
    --brand-orange: #FF6600;
    --brand-gray: #58595B;
    --bg-page: #f4f7f9;
    --bg-card: #ffffff;
    --border-light: #e5e7eb;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
    --radius-card: 1rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--brand-navy);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    scrollbar-width: thin;
    scrollbar-color: rgba(78, 33, 33, 0.38) #e8ecef;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #e8ecef;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(78, 33, 33, 0.32);
    border-radius: 999px;
    border: 2px solid #e8ecef;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--brand-teal);
    border: 2px solid #e8ecef;
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

/* ── Shell ── */
.admin-shell {
    display: flex;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--brand-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.admin-sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    height: var(--topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.admin-sidebar-brand img {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}

.admin-sidebar-brand span {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    color: #fff;
}

.admin-sidebar.collapsed .admin-sidebar-brand span,
.admin-sidebar.collapsed .nav-label,
.admin-sidebar.collapsed .nav-section-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.admin-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.75rem 0.75rem 0.35rem;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.admin-nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.85;
}

.admin-sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ── Main content ── */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-sidebar.collapsed ~ .admin-main {
    margin-left: var(--sidebar-collapsed);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-topbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
}

/* ── User menu ── */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-light);
    background: #fff;
    border-radius: 9999px;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--brand-navy);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.user-menu-btn:hover {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ── Cards & tables ── */
.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

.stat-card .stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.stat-card .stat-value-sm {
    font-size: 1.05rem;
}

.dash-chart-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.15rem 1.25rem 1.35rem;
    box-shadow: var(--shadow-card);
    height: 100%;
}

.dash-chart-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.dash-chart-sub {
    margin: 0.15rem 0 0.85rem;
    color: #6b7280;
    font-size: 0.8rem;
}

.dash-chart-card canvas {
    display: block;
    width: 100% !important;
    height: 260px !important;
}

.dash-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-bottom-color: var(--border-light);
    background: #fff;
}

/* ── Buttons ── */
.btn {
    border-radius: 9999px;
    font-weight: 600;
}

.btn-primary {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
}

.btn-primary:not(.btn-sm) {
    padding: 0.5rem 1.25rem;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-teal-hover);
    border-color: var(--brand-teal-hover);
    color: #fff;
}

.btn-outline-primary {
    color: var(--brand-teal);
    border-color: var(--brand-teal);
}

.btn-outline-primary:hover {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
}

.btn-success {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.btn-group-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.btn-group-actions form {
    display: inline;
    margin: 0;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-header .subtitle {
    color: var(--brand-gray);
    font-size: 0.9rem;
    margin: 0;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(10, 31, 68, 0.6);
}

.form-control,
.form-select {
    border-radius: 0.5rem;
    border-color: var(--border-light);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.12);
}

.badge { font-weight: 600; }

/* ── Auth layout ── */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-teal) 100%);
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    padding: 2rem;
}

.auth-card .auth-logo {
    height: 40px;
    margin-bottom: 1.5rem;
}

.auth-card h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-card .auth-subtitle {
    color: var(--brand-gray);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ── Mobile ── */
.mobile-menu-btn {
    display: none;
    border: none;
    background: none;
    padding: 0.25rem;
    color: var(--brand-navy);
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ── Jobs page ── */
.jobs-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-height) - 3rem);
    min-width: 0;
}

.jobs-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.jobs-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.jobs-page-sub {
    margin: 0.2rem 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.jobs-page-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.jobs-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.15rem 0.35rem 0.15rem 0.75rem;
    min-width: 240px;
}

.jobs-search-input {
    border: 0;
    box-shadow: none !important;
    min-height: 1.85rem;
    font-size: 0.85rem;
    padding: 0;
}

.jobs-search-btn {
    border: 0;
    background: transparent;
    color: var(--brand-gray);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jobs-search-btn svg {
    width: 1rem;
    height: 1rem;
}

.jobs-add-btn,
.list-add-btn {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
}

.jobs-add-btn:hover,
.list-add-btn:hover {
    background: var(--brand-teal-hover);
    border-color: var(--brand-teal-hover);
    color: #fff;
}

.jobs-view-toggle {
    display: inline-flex;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.2rem;
    gap: 0.15rem;
}

.jobs-view-toggle a {
    border: 0;
    background: transparent;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

.jobs-view-toggle a.active {
    background: var(--brand-teal);
    color: #fff;
}

.jobs-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.jobs-filters .form-select,
.jobs-filters .form-control,
.jobs-filters .ts-wrapper {
    width: auto;
    min-width: 0;
    min-height: 2.15rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8rem;
    border-radius: 999px;
}

.jobs-filters .ts-wrapper {
    flex: 1 1 9.5rem;
    max-width: 100%;
}

.jobs-filters .ts-wrapper .ts-control {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0.15rem 1.85rem 0.15rem 0.65rem !important;
    min-height: 0;
}

.jobs-filters .ts-wrapper.single .ts-control > .item {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.jobs-filters .form-control {
    flex: 1 1 8rem;
}

.jobs-filters-dash {
    color: #6b7280;
}

.jobs-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.jobs-status-chips a {
    border: 1px solid var(--border-light);
    background: #fff;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.jobs-status-chips a:hover {
    color: var(--brand-teal);
    border-color: #d6b4b4;
}

.jobs-status-chips a.active {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
}

/* ── Job board ── */
.job-board-wrap {
    width: 100%;
    min-width: 0;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.job-board {
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
    width: 100%;
    min-width: min-content;
    min-height: calc(100vh - 320px);
}

.job-column {
    flex: 1 1 220px;
    min-width: 220px;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    border: 2px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}

.job-column[data-status="JobReceived"] { background: #eef2f7; }
.job-column[data-status="Designing"] { background: #f4eefc; }
.job-column[data-status="ProofReading"] { background: #fbf6e8; }
.job-column[data-status="ProofApproved"] { background: #e8f7ee; }
.job-column[data-status="Processing"] {
    background: #e7f3fb;
    flex: 2.15 1 380px;
    min-width: 380px;
}

.job-process-split {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    flex: 1;
    min-height: 8rem;
    padding: 0 0.3rem 0.35rem;
}

.job-board-wrap,
.job-board,
.job-column,
.job-lane,
.job-column-cards {
    scrollbar-width: thin;
    scrollbar-color: rgba(78, 33, 33, 0.4) transparent;
}

.job-board-wrap::-webkit-scrollbar,
.job-board::-webkit-scrollbar,
.job-column::-webkit-scrollbar,
.job-lane::-webkit-scrollbar,
.job-column-cards::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.job-board-wrap::-webkit-scrollbar-track,
.job-board::-webkit-scrollbar-track,
.job-column::-webkit-scrollbar-track,
.job-lane::-webkit-scrollbar-track,
.job-column-cards::-webkit-scrollbar-track {
    background: transparent;
}

.job-board-wrap::-webkit-scrollbar-thumb,
.job-board::-webkit-scrollbar-thumb,
.job-column::-webkit-scrollbar-thumb,
.job-lane::-webkit-scrollbar-thumb,
.job-column-cards::-webkit-scrollbar-thumb {
    background: rgba(78, 33, 33, 0.28);
    border: 1px solid transparent;
    background-clip: padding-box;
}

.job-board-wrap::-webkit-scrollbar-thumb:hover,
.job-board::-webkit-scrollbar-thumb:hover,
.job-column::-webkit-scrollbar-thumb:hover,
.job-lane::-webkit-scrollbar-thumb:hover,
.job-column-cards::-webkit-scrollbar-thumb:hover {
    background: var(--brand-teal);
    border: 1px solid transparent;
    background-clip: padding-box;
}

.job-lane {
    flex: 1 1 0;
    min-width: 0;
    min-height: 3.5rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.42);
    padding: 0.35rem 0.3rem 0.4rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.job-lane[data-lane="Outsourced"] {
    background: rgba(219, 234, 254, 0.55);
}

.job-lane.is-over {
    outline: 2px solid #0f766e;
    outline-offset: -2px;
}

.job-lane-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #334155;
    margin: 0.05rem 0.1rem 0.35rem;
}

.job-group {
    margin-bottom: 0.45rem;
    padding: 0 0.35rem;
}

.job-column > .job-group:first-of-type {
    padding-top: 0.05rem;
}

.job-group:last-child {
    margin-bottom: 0.25rem;
}

.job-group-title {
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 0.1rem 0.25rem;
}

.job-group-cards {
    min-height: 0.5rem;
    flex: none;
    overflow: visible;
    padding: 0;
}

.job-column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 0.15rem 0.35rem 0.35rem;
    min-height: 3rem;
}

.job-lane > .job-column-cards {
    padding: 0;
    min-height: 2.5rem;
}
.job-column[data-status="ReadyForDelivery"] { background: #e6f7f3; }
.job-column[data-status="Delivered"] { background: #e9f8ee; }

.job-column.is-over {
    border-color: #0f766e;
}

.job-column-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    min-height: 2.6rem;
    padding: 0.5rem 0.45rem 0.3rem;
    flex-shrink: 0;
}

.job-column-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.job-column-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.12rem;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.job-column-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.job-column-title {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
}

.job-column-count {
    min-width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.28rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.job-column-add {
    display: none;
}

.job-card {
    position: relative;
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.32rem 0.42rem;
    margin-bottom: 0.28rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: grab;
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.job-card:last-child {
    margin-bottom: 0;
}

.job-card.is-dragging {
    opacity: 0.45;
}

.job-card.is-high {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 3px 0 0 #dc3545;
}

.job-card.is-normal {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 3px 0 0 #64748b;
}

.job-card.is-low {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 3px 0 0 #16a34a;
}

.job-card-top {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.06rem;
}

.job-card-date {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--brand-gray);
    white-space: nowrap;
}

.job-card-date.is-overdue {
    color: #dc3545;
}

.job-card-number {
    font-size: 0.62rem;
    color: var(--brand-gray);
    font-weight: 600;
}

.job-card-assignee {
    margin-left: auto;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.55rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.job-card-title {
    font-weight: 650;
    font-size: 0.76rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 1.4rem;
}

.job-card-title a {
    color: inherit;
    text-decoration: none;
}

.job-card-title a:hover {
    color: var(--brand-teal);
    text-decoration: underline;
}

.job-card-meta,
.job-card-qty {
    font-size: 0.68rem;
    color: var(--brand-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card-process {
    display: inline-block;
    margin-top: 0.1rem;
    font-size: 0.58rem;
    font-weight: 700;
    color: #334155;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 0.04rem 0.35rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card-process.is-out {
    background: #dbeafe;
    color: #1d4ed8;
}

.job-card-bottom {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.job-priority {
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.08rem 0.4rem;
    line-height: 1.2;
}

.job-priority.is-high {
    background: #fee2e2;
    color: #b91c1c;
}

.job-priority.is-normal {
    background: #e2e8f0;
    color: #334155;
}

.job-priority.is-low {
    background: #dcfce7;
    color: #166534;
}

.job-card-due {
    margin-left: auto;
    font-size: 0.62rem;
    color: var(--brand-gray);
    white-space: nowrap;
}

.job-card-due.is-overdue {
    color: #dc3545;
    font-weight: 700;
}

.job-card-status {
    margin-top: 0.2rem;
}

.job-card-next {
    position: absolute;
    right: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.45rem;
    height: 1.45rem;
    border: 0;
    border-radius: 999px;
    background: var(--brand-teal);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.job-card-next svg {
    width: 0.9rem;
    height: 0.9rem;
    display: block;
}

.job-card-next:hover {
    background: var(--brand-teal-hover);
}

.job-card-next[hidden] {
    display: none;
}

@media (hover: hover) {
    .job-card-next {
        opacity: 0;
        pointer-events: none;
    }

    .job-card:hover .job-card-next,
    .job-card:focus-within .job-card-next {
        opacity: 1;
        pointer-events: auto;
    }
}

.job-card[draggable="false"] {
    cursor: default;
}

.jobs-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.85rem;
    padding: 0.7rem 0.4rem 0;
    border-top: 1px solid var(--border-light);
}

.jobs-priority-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 0.5rem;
    padding-right: 0.85rem;
    border-right: 1px solid var(--border-light);
}

.jobs-priority-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
}

.jobs-priority-legend-item i {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
    display: inline-block;
}

.jobs-priority-legend-item i.is-high { background: #dc3545; }
.jobs-priority-legend-item i.is-normal { background: #64748b; }
.jobs-priority-legend-item i.is-low { background: #16a34a; }

.jobs-footer-stat {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.jobs-footer-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jobs-footer-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.jobs-footer-icon.is-jobs { background: #e2e8f0; color: #334155; }
.jobs-footer-icon.is-progress { background: #ffedd5; color: #c2410c; }
.jobs-footer-icon.is-ready { background: #dcfce7; color: #166534; }
.jobs-footer-icon.is-done { background: #dcfce7; color: #15803d; }

.jobs-footer-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.jobs-footer-label {
    font-size: 0.68rem;
    color: var(--brand-gray);
}

.jobs-footer-reports {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
}

.jobs-footer-reports svg {
    width: 1rem;
    height: 1rem;
}

.job-history {
    margin: 0;
    padding-left: 1.1rem;
}

.job-history li + li {
    margin-top: 0.75rem;
}

@media (min-width: 992px) {
    .job-card-status {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .job-board {
        overflow-x: auto;
        min-height: 28rem;
    }

    .job-column {
        flex: 0 0 210px;
        min-width: 210px;
        max-height: 28rem;
    }

    .job-column[data-status="Processing"] {
        flex: 0 0 360px;
        min-width: 360px;
    }

    .job-process-split {
        flex-direction: column;
    }
}

.report-hub-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 1.25rem 1.35rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.report-hub-card:hover {
    border-color: var(--brand-teal);
    color: inherit;
    box-shadow: 0 8px 28px rgba(78, 33, 33, 0.1);
}

.report-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.report-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.report-page-sub {
    margin: 0.2rem 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.report-tabs {
    display: flex;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    margin: 1rem 0 1rem;
}

.report-tab {
    position: relative;
    padding: 0.55rem 0;
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.report-tab:hover {
    color: var(--brand-teal);
}

.report-tab.active {
    color: var(--brand-teal);
}

.report-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--brand-teal);
    border-radius: 2px 2px 0 0;
}

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.report-period {
    display: inline-flex;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.2rem;
    gap: 0.15rem;
}

.report-period-btn {
    border: 0;
    background: transparent;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

.report-period-btn:hover {
    color: var(--brand-teal);
}

.report-period-btn.active {
    background: var(--brand-teal);
    color: #fff;
}

.report-range {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.report-range svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.report-range .form-control {
    width: auto;
    min-height: 1.7rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.78rem;
    border: 0;
    box-shadow: none;
}

.report-toolbar-select {
    width: auto;
    min-width: 160px;
    min-height: 2.15rem;
    font-size: 0.8rem;
    border-radius: 999px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.report-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.15rem 0.85rem;
    min-width: min(280px, 100%);
    flex: 1;
}

.report-search svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.report-search .form-control {
    border: 0;
    box-shadow: none !important;
    min-height: 1.85rem;
    padding: 0;
    font-size: 0.82rem;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.report-kpi {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.report-kpi-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

.report-kpi-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.report-kpi-icon.is-total { background: #eef2ff; color: #4338ca; }
.report-kpi-icon.is-cash { background: #ecfdf3; color: #15803d; }
.report-kpi-icon.is-upi { background: #f3e8ff; color: #7e22ce; }
.report-kpi-icon.is-bank { background: #eff6ff; color: #2563eb; }
.report-kpi-icon.is-card { background: #fdf2f8; color: #db2777; }
.report-kpi-icon.is-advance { background: #fff7ed; color: #ea580c; }
.report-kpi-icon.is-payments { background: #fefce8; color: #ca8a04; }

.report-kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.report-kpi-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

.report-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
    overflow: hidden;
}

.report-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.15rem 0.35rem;
}

.report-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.report-card-meta {
    margin: 0.15rem 0 0;
    color: #6b7280;
    font-size: 0.8rem;
}

.report-table {
    font-size: 0.86rem;
}

.report-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 700;
    border-bottom-color: var(--border-light);
    background: #fff;
    padding: 0.7rem 1.15rem;
}

.report-table tbody td,
.report-table tfoot th {
    padding: 0.8rem 1.15rem;
    vertical-align: middle;
    border-color: #f3f4f6;
}

.report-table tfoot {
    background: #f9fafb;
}

.job-types-table .job-type-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
}

.job-types-table .job-type-actions form {
    display: inline-flex;
    margin: 0;
}

.job-types-table .job-type-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 0.45rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    line-height: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.job-types-table .job-type-action svg {
    width: 1rem;
    height: 1rem;
}

.job-types-table .job-type-action.is-save:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.job-types-table .job-type-action.is-hide:hover,
.job-types-table .job-type-action.is-show:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    color: #111827;
}

.job-types-table .job-type-action.is-delete {
    color: #b91c1c;
    border-color: #fecaca;
}

.job-types-table .job-type-action.is-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.board-column-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}

.board-column-field .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.board-column-field-check {
    display: flex;
    align-items: center;
    min-height: 2.35rem;
}

.board-column-field-check .form-check {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.board-column-field-check .form-check-label {
    line-height: 1.35;
    font-size: 0.88rem;
    color: #374151;
}

.board-columns-table .board-column-sort {
    width: 4.5rem;
}

.board-columns-table td {
    vertical-align: middle;
}

.board-column-drag-col {
    width: 2rem;
    padding-left: 0.5rem !important;
    padding-right: 0.25rem !important;
}

.board-column-drag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    color: #9ca3af;
    letter-spacing: -0.12em;
    cursor: grab;
    user-select: none;
    font-size: 0.85rem;
    line-height: 1;
}

.board-columns-table tbody tr[data-column-id] {
    cursor: grab;
}

.board-columns-table tbody tr.is-dragging {
    opacity: 0.55;
    background: #f8fafc;
}

.board-columns-table tbody tr.is-over {
    box-shadow: inset 0 2px 0 #8b3a3a;
}

.board-column-flows {
    white-space: nowrap;
    color: #4b5563;
    font-size: 0.88rem;
}

@media (min-width: 900px) {
    .board-column-form-grid {
        grid-template-columns: 1.4fr 1.3fr 1.2fr auto;
    }

    .board-column-field-action {
        min-width: 7.5rem;
    }
}

@media (max-width: 899px) {
    .board-column-form-grid {
        grid-template-columns: 1fr;
    }

    .board-column-field-sort {
        max-width: 8rem;
    }
}

.report-day-row {
    cursor: pointer;
}

.report-day-row:hover,
.report-day-row.is-open {
    background: #f8fafc;
}

.report-day-chevron {
    text-align: right;
    color: #9ca3af;
    font-size: 1.1rem;
    width: 2rem;
}

.report-day-detail {
    display: none;
}

.report-day-detail.is-open {
    display: block;
}

.report-add-btn {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
}

.report-add-btn:hover {
    background: var(--brand-teal-hover);
    border-color: var(--brand-teal-hover);
    color: #fff;
}

.report-row-link {
    color: #9ca3af;
    text-decoration: none;
    font-weight: 700;
    padding: 0 0.35rem;
}

.pay-mode {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 0.25rem;
}

.pay-mode.is-cash { background: #ecfdf3; color: #15803d; }
.pay-mode.is-upi { background: #f3e8ff; color: #7e22ce; }
.pay-mode.is-bank { background: #eff6ff; color: #2563eb; }
.pay-mode.is-card { background: #fdf2f8; color: #db2777; }
.pay-mode.is-advance { background: #fff7ed; color: #c2410c; }

.ts-wrapper.form-select,
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    border-radius: 0.55rem;
    border-color: #e5e7eb;
    min-height: 2.35rem;
    font-size: 0.9rem;
}

.ts-wrapper.single .ts-control {
    padding-right: 2rem !important;
    position: relative;
}

.ts-wrapper.single .ts-control > .item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* When open/focused, hide the selected chip so the search input is empty and typed into. */
.ts-wrapper.single.focus .ts-control > .item,
.ts-wrapper.single.input-active .ts-control > .item,
.ts-wrapper.single.dropdown-active .ts-control > .item {
    display: none !important;
}

.ts-wrapper.single.focus .ts-control > input,
.ts-wrapper.single.input-active .ts-control > input,
.ts-wrapper.single.dropdown-active .ts-control > input,
.ts-wrapper.single.focus.input-hidden .ts-control > input,
.ts-wrapper.single.dropdown-active.input-hidden .ts-control > input {
    width: 100% !important;
    min-width: 4rem !important;
    opacity: 1 !important;
    position: relative !important;
    left: 0 !important;
    pointer-events: auto !important;
}

.ts-wrapper.form-control-sm .ts-control,
.ts-wrapper.form-select-sm .ts-control {
    min-height: 1.9rem;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .jobs-filters .ts-wrapper,
    .jobs-filters .form-select:not(.ts-wrapper),
    .jobs-filters .form-control {
        flex: 1 1 calc(50% - 0.35rem);
        width: auto;
        max-width: 100%;
    }

    .jobs-filters .ts-wrapper .ts-control {
        padding-right: 1.75rem !important;
    }

    .report-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .jobs-filters .ts-wrapper,
    .jobs-filters .form-select:not(.ts-wrapper),
    .jobs-filters .form-control {
        flex: 1 1 100%;
    }
}
