/* Shared UI composition modeled on the imported Zenith Products/forms patterns. */
.mf-page-toolbar { margin-bottom: 16px; }
.mf-page-toolbar-main { display: flex; flex-direction: column; gap: 14px; }
.mf-breadcrumb { margin-bottom: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .75rem; line-height: 1rem; color: var(--muted-foreground); }
.mf-breadcrumb a { color: var(--muted-foreground); transition: color .15s ease; }
.mf-breadcrumb a:hover { color: var(--foreground); }
.mf-breadcrumb span[aria-current="page"] { color: var(--foreground); }
.mf-breadcrumb svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: .65; }
.mf-page-title { font-size: 1.5rem; line-height: 2rem; font-weight: 650; letter-spacing: -.025em; color: var(--foreground); }
.mf-page-description { margin-top: 3px; max-width: 760px; font-size: .8125rem; line-height: 1.35rem; color: var(--muted-foreground); }
.mf-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 0 auto; }

.mf-status-tabs { width: fit-content; max-width: 100%; margin-bottom: 16px; display: flex; align-items: center; gap: 2px; overflow-x: auto; padding: 2px; border-radius: calc(var(--radius) - 1px); background: var(--muted); }
.mf-status-tab { min-height: 30px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 5px 11px; border-radius: calc(var(--radius) - 2px); font-size: .75rem; font-weight: 550; color: var(--muted-foreground); transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.mf-status-tab:hover { color: var(--foreground); }
.mf-status-tab.is-active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.mf-status-tab span { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: color-mix(in oklab, var(--muted-foreground) 12%, transparent); font-size: 10px; }

.mf-table-toolbar { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.mf-table-toolbar-left { min-width: 0; flex: 1 1 620px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mf-table-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.mf-table-search { position: relative; width: min(100%, 340px); flex: 1 1 220px; }
.mf-table-search > svg { position: absolute; left: 11px; top: 50%; z-index: 1; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.dir-rtl .mf-table-search > svg { left: auto; right: 11px; }
.mf-table-search .mf-input { height: 36px; padding-left: 35px; }
.dir-rtl .mf-table-search .mf-input { padding-left: 12px; padding-right: 35px; }
.mf-table-quick-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mf-filter-control { height: 32px; min-width: 118px; padding: 0 28px 0 10px; border: 1px dashed var(--border); border-radius: calc(var(--radius) - 2px); background: var(--background); font-size: .75rem; color: var(--foreground); outline: none; }
.mf-filter-control:hover { background: var(--muted); }
.mf-filter-control:focus { border-style: solid; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 18%, transparent); }
.mf-btn-sm { height: 32px; padding: 0 10px; font-size: .75rem; }

.mf-columns-menu { position: relative; }
.mf-columns-menu > summary { list-style: none; cursor: pointer; }
.mf-columns-menu > summary::-webkit-details-marker { display: none; }
.mf-columns-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; width: 210px; padding: 8px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 1px); background: var(--popover, var(--background)); box-shadow: 0 10px 28px rgb(0 0 0 / .12); }
.dir-rtl .mf-columns-popover { right: auto; left: 0; }
.mf-columns-title { padding: 5px 7px 7px; font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.mf-columns-popover label { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 5px 7px; border-radius: calc(var(--radius) - 3px); font-size: .75rem; color: var(--foreground); cursor: pointer; }
.mf-columns-popover label:hover { background: var(--muted); }

.mf-filter-chips { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mf-filter-chips-label { margin-right: 2px; font-size: .6875rem; font-weight: 600; color: var(--muted-foreground); }
.mf-filter-chip { min-height: 26px; display: inline-flex; align-items: center; gap: 7px; padding: 3px 5px 3px 8px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 3px); background: var(--background); font-size: .6875rem; color: var(--muted-foreground); }
.mf-filter-chip strong { font-weight: 600; color: var(--foreground); }
.mf-filter-chip a { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--muted-foreground); font-size: .875rem; line-height: 1; }
.mf-filter-chip a:hover { background: var(--muted); color: var(--foreground); }
.mf-clear-filters { padding: 4px 6px; font-size: .6875rem; font-weight: 550; color: var(--muted-foreground); }
.mf-clear-filters:hover { color: var(--foreground); text-decoration: underline; }

.mf-table-frame { overflow-x: auto; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--background); }
.mf-table-frame .mf-table th { height: 40px; padding: 8px 12px; background: transparent; font-size: .6875rem; font-weight: 600; letter-spacing: .035em; text-transform: none; color: var(--muted-foreground); }
.mf-table-frame .mf-table td { padding: 10px 12px; }
.mf-table-frame .mf-table tbody tr:hover { background: color-mix(in oklab, var(--muted) 45%, transparent); }
.mf-table [hidden] { display: none !important; }
.mf-table-row-actions { text-align: right; }

/* Form pages now share the same page header language as table pages. */
.mf-form-page > .mf-page-toolbar { margin-bottom: 22px; }

/* Dashboard chart enhancement: compact controls and responsive SVG rendering. */
.mf-dashboard-chart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mf-dashboard-chart-switcher { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--muted); }
.mf-dashboard-chart-switch { height: 26px; min-width: 42px; padding: 0 8px; border: 0; border-radius: calc(var(--radius) - 4px); background: transparent; font-size: 10px; font-weight: 600; color: var(--muted-foreground); cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.mf-dashboard-chart-switch:hover { color: var(--foreground); }
.mf-dashboard-chart-switch.is-active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.mf-chart[data-dashboard-chart-enhanced="1"] { display: block; width: 100%; height: 260px; min-width: 0 !important; padding-top: 0; }
.mf-dashboard-chart-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mf-dashboard-chart-gridline { stroke: color-mix(in oklab, var(--border) 70%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mf-dashboard-chart-baseline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mf-dashboard-chart-bar { transition: opacity .15s ease; vector-effect: non-scaling-stroke; }
.mf-dashboard-chart-bar:hover { opacity: 1; }
.mf-dashboard-chart-line { vector-effect: non-scaling-stroke; }
.mf-dashboard-chart-point { vector-effect: non-scaling-stroke; }
.mf-dashboard-chart-axis-label { fill: var(--muted-foreground); font-size: 10px; }

@media (min-width: 640px) {
    .mf-page-toolbar-main { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

@media (min-width: 900px) {
    .mf-table-toolbar--single-row { flex-wrap: nowrap; }
    .mf-table-toolbar--single-row .mf-table-toolbar-left { flex: 1 1 auto; flex-wrap: nowrap; }
    .mf-table-toolbar--single-row .mf-table-search { width: auto; max-width: none; min-width: 220px; flex: 1 1 380px; }
    .mf-table-toolbar--single-row .mf-table-quick-filters { min-width: 0; flex: 0 1 auto; flex-wrap: nowrap; }
    .mf-table-toolbar--single-row .mf-table-quick-filters > .mf-quick-filter { width: clamp(150px, 15vw, 210px); min-width: 0; flex: 0 1 210px; }
    .mf-table-toolbar--single-row .mf-table-toolbar-actions { flex: 0 0 auto; }
}

@media (max-width: 720px) {
    .mf-page-actions { width: 100%; }
    .mf-page-actions .mf-btn { flex: 1; }
    .mf-status-tabs { width: 100%; }
    .mf-table-toolbar { align-items: stretch; }
    .mf-table-toolbar-left { flex-basis: 100%; }
    .mf-table-search { width: 100%; max-width: none; flex-basis: 100%; }
    .mf-table-quick-filters { width: 100%; }
    .mf-filter-control { min-width: 0; flex: 1 1 140px; }
    .mf-table-toolbar-actions { margin-left: auto; }
    .mf-table-toolbar-left > .mf-btn { flex: 0 0 auto; }
    .mf-dashboard-chart-header { flex-direction: column; align-items: stretch; }
    .mf-dashboard-chart-switcher { width: fit-content; }
    .mf-chart[data-dashboard-chart-enhanced="1"] { height: 230px; }
}

/* Management dashboard card headings keep the title above the subtitle. */
.mf-page:has(.mf-dashboard-grid) .mf-dashboard-chart-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 3px;
}
.mf-page:has(.mf-dashboard-grid) .mf-dashboard-chart-header > .mf-card-title {
    grid-column: 1;
    grid-row: 1;
}
.mf-page:has(.mf-dashboard-grid) .mf-dashboard-chart-header > .mf-card-subtitle {
    grid-column: 1;
    grid-row: 2;
    margin-top: 0;
}
.mf-page:has(.mf-dashboard-grid) .mf-dashboard-chart-header > .mf-dashboard-chart-switcher {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
}

@media (max-width: 720px) {
    .mf-page:has(.mf-dashboard-grid) .mf-dashboard-chart-header {
        grid-template-columns: minmax(0, 1fr);
    }
    .mf-page:has(.mf-dashboard-grid) .mf-dashboard-chart-header > .mf-dashboard-chart-switcher {
        grid-column: 1;
        grid-row: 3;
        justify-self: start;
        margin-top: 6px;
    }
}
