:root {
    --wash-cream: #f7f2e8;
    --wash-paper: #fffaf2;
    --wash-ink: #2b241f;
    --wash-bronze: #af5a2d;
    --wash-gold: #d6a534;
    --wash-olive: #67733a;
    --wash-sage: #dce4cf;
    --wash-danger: #b84a3f;
    --wash-shadow: 0 18px 40px rgba(61, 42, 24, 0.08);
}

body {
    font-family: "Inter", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(214, 165, 52, 0.12), transparent 28%),
        linear-gradient(180deg, #f9f5ec 0%, #f2e8d6 100%);
    color: var(--wash-ink);
    padding: 0;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    background-image:
        linear-gradient(rgba(43, 36, 31, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(43, 36, 31, 0.05) 1px, transparent 1px);
    background-size: 12px 12px;
    z-index: -1;
}

.app-navbar {
    background: linear-gradient(135deg, rgba(214, 165, 52, 0.95), rgba(175, 90, 45, 0.96));
    border-bottom: 1px solid rgba(43, 36, 31, 0.14);
    box-shadow: 0 10px 30px rgba(61, 42, 24, 0.12);
}

.app-navbar .navbar-brand {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.app-navbar .nav-link {
    color: rgba(255, 250, 242, 0.92);
    font-weight: 600;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: #fff;
    background: rgba(43, 36, 31, 0.18);
}

.app-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

.app-hero,
.app-card,
.table-card,
main[style],
form,
.bill-box,
.display-table,
.data-table {
    border-radius: 1.25rem;
}

.app-hero,
.app-card,
.table-card,
main[style],
.bill-box,
form:not(.no-card) {
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: var(--wash-shadow);
}

.app-hero {
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1.5rem;
}

.app-eyebrow {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(103, 115, 58, 0.12);
    color: var(--wash-olive);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 0.75rem;
}

.app-hero h1,
.app-hero h2,
.page-section-title,
h2,
h3 {
    color: var(--wash-ink);
}

.app-grid {
    display: grid;
    gap: 1rem;
}

.app-grid.metrics {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.metric-panel {
    padding: 1.2rem;
    background: rgba(255, 250, 242, 0.9);
    border: 1px solid rgba(43, 36, 31, 0.08);
    border-radius: 1rem;
}

.metric-panel .metric-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(43, 36, 31, 0.64);
    font-weight: 800;
}

.metric-panel .metric-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.35rem;
}

.dashboard {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    gap: 1rem;
}

.dashboard a,
.admin-tile,
.quick-action-tile {
    background: rgba(255, 250, 242, 0.94);
    color: var(--wash-ink);
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: var(--wash-shadow);
}

.dashboard a:hover,
.admin-tile:hover,
.quick-action-tile:hover {
    background: var(--wash-bronze);
    color: #fff;
}

.dashboard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0;
}

.dashboard-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.9rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(43, 36, 31, 0.08);
    font-weight: 700;
    line-height: 1;
}

.dashboard-link-pill span {
    display: inline-block;
    white-space: nowrap;
}

table {
    margin: 0;
}

.table-card,
.display-table,
.data-table {
    overflow: hidden;
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: var(--wash-shadow);
    background: rgba(255, 250, 242, 0.92);
}

th,
td {
    white-space: normal;
    vertical-align: middle;
}

th {
    background: rgba(103, 115, 58, 0.12);
    color: var(--wash-ink);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

tr:hover td {
    background-color: rgba(214, 165, 52, 0.08);
}

.button,
button,
.btn-primary,
.btn-retro {
    border-radius: 999px !important;
    font-weight: 700;
    border: none;
    background: var(--wash-bronze);
    color: #fff;
}

.button:hover,
button:hover,
.btn-primary:hover,
.btn-retro:hover {
    background: #94471f;
    color: #fff;
}

.button.add-payment,
.button.convert,
.btn-success {
    background: var(--wash-olive);
}

.button.invoice {
    background: #4f7e74;
}

.button.add-jobs,
.button.jobs,
.btn-warning {
    background: var(--wash-gold);
    color: var(--wash-ink);
}

.button.delete,
.btn-danger {
    background: var(--wash-danger);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    border-radius: 0.9rem !important;
    border: 1px solid rgba(43, 36, 31, 0.15);
    background: rgba(255, 252, 247, 0.96);
    padding: 0.72rem 0.9rem !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(175, 90, 45, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(175, 90, 45, 0.12);
}

.flash-pickups {
    animation: flashPulse 1.2s infinite;
}

@keyframes flashPulse {
    0%, 100% {
        background: var(--wash-danger);
        color: #fff !important;
    }
    50% {
        background: #d96d61;
        color: #fff !important;
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge.pending { background: rgba(214, 165, 52, 0.16); color: #876410; }
.status-badge.ready { background: rgba(103, 115, 58, 0.16); color: #52612c; }
.status-badge.complete { background: rgba(79, 126, 116, 0.15); color: #3d675e; }
.status-badge.cancelled { background: rgba(184, 74, 63, 0.14); color: #8f372d; }

.page-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.table-responsive-wrap {
    overflow-x: auto;
}

.app-footer {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1rem;
    color: rgba(43, 36, 31, 0.66);
    font-size: 0.9rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.job-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
}

.feature-tile {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 180px;
    padding: 1.25rem;
    text-decoration: none;
    border-radius: 1.2rem;
    background: rgba(255, 250, 242, 0.94);
    color: var(--wash-ink);
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: var(--wash-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.feature-tile:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(214, 165, 52, 0.18), rgba(175, 90, 45, 0.14));
    color: var(--wash-ink);
    box-shadow: 0 22px 45px rgba(61, 42, 24, 0.14);
}

.job-catalog-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    min-height: 0;
    width: 100%;
    padding: 1rem 1.05rem;
    text-decoration: none;
    border-radius: 1.4rem;
    background: rgba(255, 250, 242, 0.94);
    color: var(--wash-ink);
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: 0 18px 34px rgba(112, 91, 68, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    cursor: pointer;
    appearance: none;
}

.job-catalog-tile:hover,
.job-catalog-tile:focus-visible {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(214, 165, 52, 0.12), rgba(26, 115, 232, 0.08));
    color: var(--wash-ink);
    border-color: rgba(26, 115, 232, 0.2);
    box-shadow: 0 20px 38px rgba(41, 86, 168, 0.12);
}

.job-catalog-tile .feature-icon {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 1rem;
    flex-shrink: 0;
}

.job-catalog-tile .feature-title {
    font-size: 1.15rem;
    margin-bottom: 0;
}

.job-catalog-tile .feature-copy {
    margin-top: auto;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(103, 115, 58, 0.14);
    color: var(--wash-olive);
    font-size: 1.25rem;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.feature-copy {
    color: rgba(43, 36, 31, 0.7);
    line-height: 1.55;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.summary-card {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 250, 242, 0.94);
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: var(--wash-shadow);
}

.summary-card .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(43, 36, 31, 0.58);
    font-weight: 800;
}

.summary-card .value {
    font-size: 1.7rem;
    font-weight: 800;
    margin-top: 0.3rem;
}

.modal.fade,
.modal.show {
    background: transparent !important;
}

.modal.fade .modal-dialog,
.modal.show .modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
    margin: 0.5rem auto;
}

.modal.fade .modal-content,
.modal.show .modal-content {
    margin: 0 !important;
}

.modal-backdrop {
    z-index: 1055 !important;
}

.modal {
    z-index: 1060 !important;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.muted-note {
    color: rgba(43, 36, 31, 0.62);
    font-size: 0.95rem;
}

.empty-state {
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px dashed rgba(43, 36, 31, 0.18);
    border-radius: 1rem;
    background: rgba(255, 250, 242, 0.7);
    color: rgba(43, 36, 31, 0.72);
}

.chart-frame {
    position: relative;
    width: 100%;
    min-height: 320px;
    height: 320px;
}

.chart-frame--wide {
    min-height: 360px;
    height: 360px;
}

.chart-frame canvas {
    width: 100% !important;
    height: 100% !important;
}

.section-stack {
    display: grid;
    gap: 1.5rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.inline-filter-bar > * {
    flex: 1 1 180px;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(103, 115, 58, 0.1);
    color: var(--wash-olive);
    font-weight: 700;
    text-decoration: none;
}

.pill-link:hover {
    background: rgba(103, 115, 58, 0.18);
    color: var(--wash-olive);
}

.search-container {
    display: flex;
    justify-content: center;
    margin: 0 0 1.5rem;
}

.dashboard-search-shell {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(360px, 560px);
    gap: 1.25rem;
    align-items: center;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-search-copy {
    max-width: 42rem;
}

.dashboard-search-float {
    display: flex;
    justify-content: flex-end;
}

.search-container--float {
    justify-content: flex-end;
    width: 100%;
    margin: 0;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    width: min(760px, 100%);
    padding: 1rem;
    border-radius: 1.2rem;
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid rgba(43, 36, 31, 0.08);
    box-shadow: var(--wash-shadow);
}

.search-form input {
    flex: 1 1 auto;
    min-height: 4rem;
    font-size: 1.05rem;
}

.search-form button {
    min-width: 8.75rem;
    min-height: 4rem;
    padding-inline: 1.5rem;
}

.section-title {
    margin: 2rem 0 1rem;
    color: var(--wash-ink);
}

.no-data {
    padding: 1.25rem;
    text-align: center;
    color: rgba(43, 36, 31, 0.68);
    background: rgba(255, 250, 242, 0.76);
    border: 1px dashed rgba(43, 36, 31, 0.16);
    border-radius: 1rem;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0 2rem;
    flex-wrap: wrap;
}

.page-btn,
.page-number {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-weight: 700;
    background: rgba(103, 115, 58, 0.12);
    color: var(--wash-olive);
}

.page-number.active,
.page-btn:hover,
.page-number:hover {
    background: var(--wash-bronze);
    color: #fff;
}

.job-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(43, 36, 31, 0.38);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.job-popup-content {
    width: min(520px, 100%);
    background: rgba(255, 250, 242, 0.98);
    border-radius: 1.2rem;
    box-shadow: 0 24px 48px rgba(43, 36, 31, 0.24);
    padding: 1.25rem;
}

.popup-table {
    width: 100%;
    border-collapse: collapse;
}

.popup-table th,
.popup-table td {
    padding: 0.7rem;
    border: 1px solid rgba(43, 36, 31, 0.12);
}

.job-popup-icon {
    margin-left: 0.4rem;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .app-shell {
        padding: 1rem 0.75rem 2rem;
    }

    .dashboard {
        padding: 0 0.75rem 1.5rem;
    }

    .page-toolbar {
        align-items: stretch;
    }

    .chart-frame,
    .chart-frame--wide {
        min-height: 280px;
        height: 280px;
    }

    .search-form {
        flex-direction: column;
    }

    .dashboard-search-shell {
        grid-template-columns: 1fr;
        padding: 1.15rem;
    }

    .dashboard-search-float,
    .search-container--float {
        justify-content: stretch;
    }
}
