/* ===== Dashboard  Unified look ===== */

:root {
    --header-bg: #F5F7FA; /* app header gray */
    --header-border: #E5E7EB;
    --header-text: #111827;
    --card-bg: #ffffff;
    --card-border: #E5E7EB;
    --card-radius: 8px;
    --muted: #6B7280;
    --green: #369950;
    --red: #D64855;
}

/* --- Badges used in Calendar list --- */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.6em;
    border-radius: 0.4rem;
    font-weight: 600;
}

.bg-light-primary {
    background-color: #e0e7ff;
}

.text-primary {
    color: #4338ca;
}

.bg-light-warning {
    background-color: #ffa50033;
}

.text-warning {
    color: darkorange !important;
}

/* --- Cards --- */
.card.card-custom,
.dashboard-card-body { /* keep old class harmless if still present */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.card-header,
.dashboard-sub-head { /* map legacy header to match card headers */
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    min-height: 48px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .card-title,
    .dashboard-sub-head h4 {
        margin: 0;
        font-size: 12px;
        line-height: 1;
        letter-spacing: .08em;
        text-transform: uppercase;
        font-weight: 700;
        color: var(--header-text);
    }

.card-body {
    padding: 16px;
}

/* --- Numbers toned down --- */
.currency-value,
.widget-cell .value,
.graph-value .value,
.graph-value .currency-value {
    font-weight: 600; /* was heavier before */
    font-size: 26px;
}

.graph-value .label,
.widget-cell .label {
    color: var(--muted);
}

/* growth chips */
.growth-value {
    align-items: center;
    font-weight: 600;
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

/* Progress bars inside cards */
.progress {
    display: flex;
    height: 8px;
    background: #F3F4F6;
    border-radius: 999px;
    overflow: hidden;
}

    .progress .progress-bar {
        height: 100%;
    }

/* Graph area spacing */
.graph-box-main {
    padding: 8px 0;
}

.dashboard-garph-image {
    margin-top: 8px;
}

/* Widget rows (Revenue metrics grid) */
.widget-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}

.widget-cell {
    border-top: 1px dashed #eee;
    padding-top: 10px;
}

    .widget-cell .label {
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 4px;
    }

/* Todo / checklist styles (Tasks + Calendar list) */
.todo-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

    .todo-item:last-child {
        border-bottom: 0;
    }

.todo-checkbox {
    margin-right: 10px;
}

.todo-title {
    font-weight: 600;
}

.todo-subtitle {
    color: var(--muted);
    margin: 0;
}

.year-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.graph-years .value {
    font-weight: 600;
}

/* Tabs row up top */
.tabs-controls .nav-link {
    color: #6B7280;
    font-weight: 600;
    padding: 6px 10px;
}

    .tabs-controls .nav-link.active {
        color: #111827;
        border-bottom: 2px solid #111827;
    }

/* Utilities */
.mt-15 {
    margin-top: 15px;
}

.mb-12 {
    margin-bottom: 12px;
}

.gap-2 {
    gap: 8px;
}
/* Summary tiles */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* force 7 tiles on one row */
    gap: 12px;
    margin: 0 0 14px;
    padding-left: 0;
}

@media (max-width: 1200px) {
    .summary-bar {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

.summary-card {
    flex: 1 1 0; /* equal widths */
    min-width: 160px;
    padding: 16px 18px 14px;
    border-radius: 0; /* square corners */
    background: #fff;
    border: 1px solid #dbe5f5; /* light blue border */
    box-shadow: 0 2px 10px rgba(3, 24, 60, 0.12); /* subtle blue-tinted shadow */
    text-align: center;
    transition: box-shadow .12s ease, border-color .12s ease;
}

    .summary-card:hover {
        box-shadow: 0 6px 18px rgba(3, 24, 60, 0.18);
        border-color: #cfdcf2;
    }

.summary-label {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748B;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #03183C;
}

@media (max-width: 768px) {
    .summary-card {
        min-width: 140px;
        padding: 14px 12px;
    }

    .summary-value {
        font-size: 1.05rem;
    }
}

/* ----- Revenue metrics layout (scoped; avoids changing main Dashboard cards) ----- */
.metrics-layout-root .dashboard-card.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0;
    padding-right: 20px;
}

.metrics-layout-root .report-time-select {
    height: 34px;
    padding: 6px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    background: #fff;
    font-weight: 600;
    font-size: 12px;
    outline: none;
    width: 100%;
}

.metrics-layout-root .report-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px 0;
    display: block;
    white-space: nowrap;
}

.metrics-layout-root .report-filter-date {
    width: 160px;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    font-weight: 600;
    font-size: 12px;
    outline: none;
}

.metrics-layout-root .report-inline-filters-gap {
    gap: 12px;
}

@media (min-width: 768px) {
    .metrics-layout-root .dashboard-card.row {
        display: grid !important;
        grid-template-columns: 220px 1fr 1.25fr !important;
        grid-template-rows: auto auto !important;
        gap: 12px !important;
        align-items: start !important;
    }

    .metrics-layout-root .dashboard-topbar {
        grid-column: 2 / -1 !important;
        grid-row: 1 !important;
        align-self: start !important;
        display: flex !important;
        justify-content: stretch !important;
        align-items: stretch !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        min-width: 0 !important;
    }

    .metrics-layout-root .dashboard-filters-strip {
        width: 100% !important;
    }

    .metrics-layout-root .dashboard-filters-strip .card-body {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
        min-width: 0 !important;
    }

    .metrics-layout-root .dashboard-filters-strip .report-filter-label {
        margin-top: 0 !important;
    }

    .metrics-layout-root .dashboard-filters-strip .card-body > .nav {
        margin-bottom: 0 !important;
    }

    .metrics-layout-root .dashboard-filters-strip .tabs-controls {
        display: flex !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding-left: 6px !important;
        scroll-padding-left: 6px !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        scrollbar-width: none !important;
    }

    .metrics-layout-root .dashboard-filters-strip .tabs-controls::-webkit-scrollbar {
        height: 0 !important;
    }

    .metrics-layout-root .dashboard-filters-strip .tabs-controls .nav-link:not(.active) {
        background: #ffffff !important;
        border: 1px solid #e5e5e5 !important;
        border-radius: 20px !important;
        box-shadow: none !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        padding: 6px 12px !important;
        margin-right: 8px !important;
        color: #111827 !important;
        cursor: pointer !important;
    }

    .metrics-layout-root .dashboard-filters-strip .tabs-controls .nav-link:not(.active):hover {
        background: #f8fafc !important;
        border-color: #e5e7eb !important;
    }

    .metrics-layout-root .dashboard-card.row > .col-md-3,
    .metrics-layout-root .dashboard-card.row > .col-md-4,
    .metrics-layout-root .dashboard-card.row > .col-md-5 {
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
    }

    .metrics-layout-root .dashboard-card.row > .col-md-3 {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
    }

    .metrics-layout-root .dashboard-card.row > .col-md-4 {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    .metrics-layout-root .dashboard-card.row > .col-md-5 {
        grid-column: 3 !important;
        grid-row: 2 !important;
    }
}

/* ----- CRM reports: inner nav + one main column (Revenue grid targets col-md-4/5; col-md-9 was only getting 1fr) ----- */
.crm-metrics-layout-root .dashboard-card.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0;
    padding-right: 20px;
}

@media (min-width: 768px) {
    .crm-metrics-layout-root .dashboard-card.row {
        display: grid !important;
        grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) !important;
        gap: 16px !important;
        align-items: start !important;
    }

    .crm-metrics-layout-root .dashboard-card.row > .col-md-3:first-child {
        grid-column: 1 !important;
        grid-row: 1 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
    }

    .crm-metrics-layout-root .dashboard-card.row > .col-md-9 {
        grid-column: 2 !important;
        grid-row: 1 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
    }
}

@media (max-width: 767.98px) {
    .crm-metrics-layout-root .dashboard-card.row {
        display: block !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .main-content.form-1400:has(.crm-metrics-layout-root) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .metrics-layout-root .dashboard-card.row {
        display: block !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .main-content.form-1400:has(.metrics-layout-root) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .metrics-layout-root .pagetitle {
        font-size: 1.5rem;
        text-align: center;
    }

    .metrics-layout-root .report-filter-mobile-card {
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        padding: 12px;
    }

    .metrics-layout-root .report-filter-date {
        width: 100%;
    }
}

.metrics-layout-root .card.card-custom .card-header {
    background: #f0f2f6 !important;
    border-bottom: 1px solid #e3e6ea !important;
    padding: 15px 20px !important;
}

.metrics-layout-root .card.card-custom .card-header .card-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #1e2a3b !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.metrics-layout-root .dashboard-filters-strip #pills-tab .nav-link.active,
.metrics-layout-root .dashboard-filters-strip #pills-tab .nav-link[aria-current="true"] {
    background-color: #EEF3FB !important;
    background: #EEF3FB !important;
    border: 1px solid #c7d6f0 !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

/* ----- Exported / printed report documents ----- */
.report-doc-page {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
}

.report-doc-inner {
    max-width: 850px;
    margin: 0 auto;
    padding: 24px 16px 40px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1b1b1b;
    line-height: 1.55;
}

.report-doc-layout-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
}

.report-doc-layout-main {
    vertical-align: top;
    padding: 0;
}

.report-doc-layout-logo {
    width: 240px;
    vertical-align: top;
    text-align: right;
    padding: 0;
}

.report-doc-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
}

.report-doc-meta {
    font-size: 12px;
    color: #374151;
    line-height: 1.35;
}

.report-doc-emphasis {
    font-weight: 700;
}

.report-doc-logo-img {
    max-width: 220px;
    max-height: 80px;
    width: auto;
    height: auto;
    display: inline-block;
}

.report-stat-strip {
    margin: 24px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    border-bottom: 2px solid #9ca3af;
}

.report-stat-strip--spaced {
    margin: 28px 0;
}

.report-stat-cell {
    padding: 14px 10px;
    text-align: center;
    border-right: 1px solid #e5e7eb;
}

.report-stat-cell:last-child {
    border-right: none;
}

.report-stat-strip .report-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.report-stat-strip .report-stat-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.report-stat-cell-inverse {
    background: #111827;
}

.report-stat-cell-inverse .report-stat-label {
    color: #d1d5db;
}

.report-stat-cell-inverse .report-stat-value {
    color: #ffffff;
    font-size: 17px;
}

.report-table-wrap {
    font-size: 12px;
}

.report-table-wrap .report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table-wrap .report-table thead th {
    color: #000;
    background: #c0d7ed;
    padding: 10px 8px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-table-wrap .report-table tbody td {
    padding: 9px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.report-table-wrap .report-num {
    text-align: right;
    white-space: nowrap;
}

.report-total-row td {
    font-weight: 700;
    border-top: 2px solid #111827;
}

/* Invoice-items style summary row (table cells) */
.report-stat-table {
    width: 100%;
    border-collapse: collapse;
}

.report-stat-table td {
    padding: 10px 8px;
    font-weight: 600;
    text-align: center;
    background: #f9fafb;
    color: #111827;
    font-size: 16px;
}

.report-stat-strip .report-stat-table td.report-stat-cell {
    background: transparent;
    vertical-align: middle;
}

.report-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 10px;
}

/* On-screen & PDF breakdown panels (sales tax, etc.) */
.report-breakdown-doc {
    background: #fff;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.report-breakdown-meta {
    font-size: 12px;
    color: #374151;
    line-height: 1.35;
    margin-bottom: 18px;
}

.report-breakdown-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.report-breakdown-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #111827;
}

.report-breakdown-grid {
    width: 100%;
    max-width: 720px;
}

.report-breakdown-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 18px;
    padding: 2px 0;
    font-size: 13px;
    color: #111827;
}

.report-breakdown-row-head {
    font-weight: 700;
    color: #374151;
    padding-bottom: 6px;
}

.report-breakdown-amt {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.report-breakdown-total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-weight: 700;
}

.report-breakdown-stack {
    margin-top: 22px;
}

.report-breakdown-rule {
    border-top: 1px solid #e5e7eb;
    margin: 22px 0;
}

.report-breakdown-simple-table {
    width: 100%;
    max-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}

.report-breakdown-simple-table .report-breakdown-row-head td {
    color: #374151;
    font-weight: 700;
    padding: 4px 0;
}

.report-breakdown-simple-table tbody td {
    padding: 3px 0;
}

.report-breakdown-simple-table .report-breakdown-amt {
    text-align: right;
}

.report-breakdown-simple-table .report-breakdown-total td {
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-weight: 700;
}

.report-breakdown-simple-table .report-breakdown-total .report-breakdown-amt {
    text-align: right;
}

/* Minimal tabular print (e.g. revenue by job PDF) */
.report-print-simple {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #222;
}

.report-print-simple .report-simple-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

.report-print-simple .report-simple-date {
    margin-bottom: 18px;
    color: #555;
}

.report-print-simple table {
    width: 100%;
    border-collapse: collapse;
}

.report-print-simple th {
    background: #f1f1f1;
    text-align: left;
    padding: 7px;
    border: 1px solid #ddd;
}

.report-print-simple td {
    padding: 7px;
    border: 1px solid #ddd;
}

.report-print-simple .report-num {
    text-align: right;
}

.report-print-simple tfoot td {
    font-weight: bold;
    background: #fafafa;
}

.report-chart-host {
    padding-left: 20px;
    width: 100%;
}

.report-pdf-frame-wrap {
    padding: 20px;
}

.report-pdf-frame-wrap--compact {
    padding: 12px;
}

.report-pdf-frame {
    width: 100%;
    height: 900px;
    border: none;
}

/* Revenue report list tables & empty states (replaces redundant inline CSS) */
.revenuereport-table-full {
    width: 100%;
}

.report-empty-headline {
    font-size: 24px;
}

.report-empty-detail {
    font-size: 12px;
}

.report-col-w-10 {
    width: 10% !important;
}

.report-col-w-12 {
    width: 12% !important;
}

.report-link-underlined {
    text-decoration: underline;
}

.report-td-end,
.report-th-end {
    text-align: right;
}

.report-empty-job-img {
    height: 169%;
    right: 10%;
    bottom: 15%;
    width: 70%;
}

.report-filter-date-narrow {
    width: 150px;
}