.brm-appointments-hub {
    width: min(100%, 1320px);
    margin: 0 auto;
    color: var(--brm-text, #0f172a);
    font-family: var(--brm-font-ui, inherit);
    font-size: 14px;
    box-sizing: border-box;
}

.brm-appointments-hub *,
.brm-appointments-hub *::before,
.brm-appointments-hub *::after { box-sizing: border-box; }

.brm-ah-header { margin: 0 0 14px; }
.brm-ah-header h1 {
    margin: 0;
    color: var(--brm-text, #0f172a);
    font: 700 22px/1.3 var(--brm-font-ui, inherit);
    letter-spacing: -0.02em;
}
.brm-ah-header p {
    margin: 4px 0 0;
    color: var(--brm-text-2, #475569);
    font-size: 13px;
    line-height: 1.45;
}

.brm-ah-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--brm-border, #e5e7eb);
    border-radius: 12px;
    margin: 0 0 16px;
    background: var(--brm-surface-2, #f8fafc);
}
.brm-ah-tab {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--brm-text-2, #475569);
    font: 600 14px/1.3 var(--brm-font-ui, inherit);
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.brm-ah-tab:hover {
    background: var(--brm-surface, #fff);
    color: var(--brm-accent, #2563eb);
}
.brm-ah-tab.is-active {
    background: var(--brm-accent-soft, #eff6ff);
    color: var(--brm-accent, #2563eb);
    font-weight: 700;
    box-shadow: 0 1px 3px rgb(15 23 42 / .12);
}
.brm-ah-tab svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.brm-ah-tab:focus-visible { outline: 2px solid var(--brm-accent, #2563eb); outline-offset: -3px; }
.brm-ah-panel[hidden] { display: none !important; }
.brm-ah-panel { min-width: 0; }

/* The appointment action is moved outside its original .berberim-appt-v2
   parent, so recreate its compact panel styling within this page only. */
.brm-ah-appointment-actions { margin: 0 0 14px; }
.brm-ah-appointment-actions .bv2-add-appt-launch-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 !important;
}
.brm-ah-appointment-actions .bv2-add-appt-launch {
    display: inline-flex !important;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px !important;
    border: 1px solid var(--brm-accent, #2563eb) !important;
    border-radius: 8px !important;
    background: var(--brm-accent, #2563eb) !important;
    color: #fff !important;
    font: 600 13px/1.2 var(--brm-font-ui, inherit) !important;
    box-shadow: 0 1px 3px rgb(37 99 235 / .18);
    cursor: pointer;
}
.brm-ah-appointment-actions .bv2-add-appt-launch:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}
.brm-ah-calendar { min-width: 0; margin-bottom: 16px; }
.brm-ah-appointment-list > .bv2-header,
.brm-ah-panel[data-brm-ah-panel="takvim"] .bv2-header,
.brm-ah-panel[data-brm-ah-panel="musterilerim"] .bv2-header { display: none !important; }
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-container:empty::before {
    display: block;
    padding: 22px 16px;
    color: var(--brm-text-2, #64748b);
    font-size: 13px;
    text-align: center;
    content: "İstatistikler yükleniyor…";
}

/* Tighten the existing report cards without changing their data or controls. */
.brm-ah-panel .bv2-section-divider { margin-top: 16px; margin-bottom: 10px; }
.brm-ah-panel .bv2-stats-kpi-card { min-height: 0; padding: 14px; }
.brm-ah-panel .bv2-ext-kpi-card { padding: 12px; }
.brm-ah-panel .bv2-ext-chart-wrap { margin-top: 14px; }

/* The appointment list follows the compact mobile card pattern, while the
   calendar above keeps its existing layout and controls. */
body.brm-panel .brm-ah-appointment-list .berberim-appt-v2 { width: 100%; margin: 0; }
body.brm-panel .brm-ah-appointment-list .bv2-section-divider { margin: 16px 0 10px !important; }
body.brm-panel .brm-ah-appointment-list .bv2-appt-list-box { padding: 0 0 8px !important; }
body.brm-panel .brm-ah-appointment-list .bv2-add-appt-launch-wrap { margin: 8px 0 !important; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-list { gap: 8px; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-item {
    overflow: hidden;
    border: 1px solid var(--brm-border, #e2e8f0);
    border-radius: 12px;
    background: var(--brm-surface, #fff);
    box-shadow: var(--brm-shadow, 0 1px 3px rgb(15 23 42 / .06));
}
body.brm-panel .brm-ah-appointment-list .brm-kacc-head-row { align-items: center; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-head { min-height: 60px; padding: 10px 12px; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-title { font-size: 13px; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-sub { font-size: 11px; line-height: 1.4; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-head-actions { gap: 6px; padding-right: 10px; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-amount { gap: 6px; }
body.brm-panel .brm-ah-appointment-list .bv2-status-badge { padding: 3px 8px; font-size: 10px; }
body.brm-panel .brm-ah-appointment-list .brm-kacc-body { border-top: 1px solid var(--brm-border, #e2e8f0); }

.brm-ah-list-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 12px;
    padding: 4px;
    border: 1px solid var(--brm-border, #e2e8f0);
    border-radius: 11px;
    background: var(--brm-surface-2, #f8fafc);
}
.brm-ah-list-tab {
    display: flex;
    min-width: 0;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--brm-text-2, #475569);
    font: 600 12px/1.25 var(--brm-font-ui, inherit);
    text-align: center;
    text-decoration: none;
}
.brm-ah-list-tab:hover { color: var(--brm-accent, #2563eb); }
.brm-ah-list-tab.is-active {
    border-color: var(--brm-border, #e2e8f0);
    background: var(--brm-surface, #fff);
    color: var(--brm-accent, #2563eb);
    box-shadow: 0 1px 2px rgb(15 23 42 / .06);
}
.brm-ah-list-tab span {
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--brm-accent-soft, #eff6ff);
    color: var(--brm-accent, #2563eb);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.brm-ah-list-tab:focus-visible { outline: 2px solid var(--brm-accent, #2563eb); outline-offset: 2px; }

.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-v2 { color: var(--brm-text, #0f172a); }
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-v2 .bv2-header { display: flex !important; }
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-container { min-height: 76px; }
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .brm-ah-stats-loading {
    margin: 0;
    padding: 22px 16px;
    color: var(--brm-text-2, #64748b);
    font-size: 13px;
    text-align: center;
}
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .bv2-stats-error {
    margin: 8px 0;
    padding: 14px;
    border: 1px solid var(--brm-border, #e2e8f0);
    border-radius: 10px;
    background: var(--brm-surface, #fff);
    color: var(--brm-text, #0f172a);
}

@media (min-width: 1200px) {
    .brm-appointments-hub { padding-right: 6px; padding-left: 6px; }
}

@media (max-width: 640px) {
    .brm-appointments-hub { width: 100%; }
    .brm-ah-header { margin-bottom: 10px; }
    .brm-ah-header h1 { font-size: 20px; }
    .brm-ah-header p { font-size: 12px; }
    .brm-ah-tabs { gap: 3px; padding: 3px; margin: 0 -2px 12px; }
    .brm-ah-tab { min-height: 40px; gap: 5px; padding: 7px 3px; font-size: clamp(11px, 3.35vw, 13px); }
    .brm-ah-tab svg { width: 15px; height: 15px; }
    .brm-ah-panel[data-brm-ah-panel="takvim"] .brm-ah-calendar #bcal-add-appt {
        justify-content: center;
        text-align: center;
    }
    .brm-ah-calendar { margin-bottom: 12px; }
    .brm-ah-list-tabs { margin-bottom: 10px; }
    .brm-ah-list-tab { min-height: 35px; gap: 5px; padding: 6px 5px; font-size: 11px; }
    body.brm-panel .brm-ah-appointment-list .brm-kacc-head { min-height: 56px; padding: 9px 10px; }
    body.brm-panel .brm-ah-appointment-list .brm-kacc-head-actions { flex-wrap: wrap; justify-content: flex-end; }
    .brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-container { min-height: 64px; }
    .brm-ah-panel .bv2-stats-kpi-card { padding: 10px; }
    .brm-ah-panel .bv2-ext-kpi-card { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .brm-ah-tab { transition: none; }
}

/* Mobile-app statistics presentation, scoped to the unified appointments hub. */
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-v2.brm-ah-stats-mode .bv2-header {
    display: none !important;
}
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-v2.brm-ah-stats-mode .bv2-shimmer-bar {
    display: none !important;
}
.brm-ah-panel[data-brm-ah-panel="istatistikler"] .berberim-stats-v2.brm-ah-stats-mode .berberim-stats-container {
    min-height: 0;
}
.brm-ah-stats-mode .brm-ah-stats-range {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto 12px;
}
.brm-ah-stats-mode .brm-ah-stats-range button {
    min-width: 0;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--brm-border, #273142);
    border-radius: 12px;
    background: var(--brm-surface, #11151d);
    color: var(--brm-text-2, #9aa4b5);
    font: 600 13px/1.2 var(--brm-font-ui, inherit);
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.brm-ah-stats-mode .brm-ah-stats-range button:hover,
.brm-ah-stats-mode .brm-ah-stats-range button[aria-pressed="true"] {
    border-color: var(--brm-accent, #3b82f6);
    background: var(--brm-accent-soft, rgb(59 130 246 / .14));
    color: var(--brm-accent, #3b82f6);
}
.brm-ah-stats-mode .brm-ah-stats-range button:focus-visible {
    outline: 2px solid var(--brm-accent, #3b82f6);
    outline-offset: 2px;
}
.brm-ah-stats-mode .bv2-stats-kpi-row {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}
.brm-ah-stats-mode .bv2-stats-kpi-card {
    display: flex;
    min-width: 0;
    min-height: 112px;
    align-items: flex-start;
    gap: 9px;
    padding: 13px;
    border: 1px solid var(--brm-border, #273142);
    border-radius: 15px;
    background: var(--brm-surface, #11151d);
    color: var(--brm-text, #f4f6fb);
    box-shadow: none;
}
.brm-ah-stats-mode .bv2-stats-kpi-icon {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    color: var(--brm-accent, #3b82f6);
}
.brm-ah-stats-mode .bv2-stats-kpi-icon svg { width: 19px; height: 19px; }
.brm-ah-stats-mode .bv2-stats-kpi-body { min-width: 0; }
.brm-ah-stats-mode .bv2-stats-kpi-label {
    margin: 0 0 8px;
    color: var(--brm-text-2, #9aa4b5);
    font-size: 12px;
    line-height: 1.35;
}
.brm-ah-stats-mode .bv2-stats-kpi-value {
    color: var(--brm-text, #f4f6fb);
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.brm-ah-stats-mode .bv2-stats-kpi-value strong { font-weight: 750; }
.brm-ah-stats-mode .bv2-stats-kpi-sub {
    margin-top: 7px;
    color: var(--brm-text-2, #9aa4b5);
    font-size: 11px;
    line-height: 1.4;
}
.brm-ah-stats-mode .brm-ah-stats-accordion {
    min-width: 0;
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid var(--brm-border, #273142);
    border-radius: 15px;
    background: var(--brm-surface, #11151d);
    color: var(--brm-text, #f4f6fb);
    box-shadow: none;
}
.brm-ah-stats-mode .brm-ah-stats-accordion > summary {
    position: relative;
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 12px;
    padding: 13px 17px;
    color: var(--brm-text, #f4f6fb);
    font: 650 15px/1.35 var(--brm-font-ui, inherit);
    list-style: none;
    cursor: pointer;
}
.brm-ah-stats-mode .brm-ah-stats-accordion > summary::-webkit-details-marker { display: none; }
.brm-ah-stats-mode .brm-ah-stats-accordion > summary::marker { content: ""; }
.brm-ah-stats-mode .brm-ah-stats-accordion > summary::after {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-left: auto;
    border-top: 2px solid var(--brm-text-2, #9aa4b5);
    border-right: 2px solid var(--brm-text-2, #9aa4b5);
    content: "";
    transform: rotate(45deg);
    transition: transform .16s ease;
}
.brm-ah-stats-mode .brm-ah-stats-accordion[open] > summary::after {
    transform: rotate(135deg);
}
.brm-ah-stats-mode .brm-ah-stats-accordion > summary:focus-visible {
    outline: 2px solid var(--brm-accent, #3b82f6);
    outline-offset: -3px;
}
.brm-ah-stats-mode .brm-ah-stats-accordion > summary .bv2-section-icon,
.brm-ah-stats-mode .brm-ah-stats-accordion > summary .bv2-stats-chart-icon {
    display: inline-flex;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    align-items: center;
    justify-content: center;
    color: var(--brm-accent, #3b82f6);
}
.brm-ah-stats-mode .brm-ah-stats-accordion > summary .bv2-section-icon svg,
.brm-ah-stats-mode .brm-ah-stats-accordion > summary .bv2-stats-chart-icon svg {
    width: 20px;
    height: 20px;
}
.brm-ah-stats-mode .brm-ah-stats-chart-accordion > summary > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--brm-accent, #3b82f6);
}
.brm-ah-stats-mode .brm-ah-stats-chart-accordion > summary > span { min-width: 0; }
.brm-ah-stats-mode .brm-ah-stats-accordion > summary h3,
.brm-ah-stats-mode .brm-ah-stats-accordion > summary .bv2-stats-chart-title {
    margin: 0;
    color: inherit;
    font: inherit;
}
.brm-ah-stats-mode .brm-ah-stats-accordion-content {
    min-width: 0;
    padding: 0 15px 15px;
    border-top: 1px solid var(--brm-border, #273142);
}
.brm-ah-stats-mode .brm-ah-stats-accordion-content > :first-child { margin-top: 12px; }
.brm-ah-stats-mode .brm-ah-stats-package-accordion,
.brm-ah-stats-mode .brm-ah-stats-session-accordion { max-width: 920px; margin-right: auto; margin-left: auto; }
.brm-ah-stats-mode .bv2-stats-chart-card {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.brm-ah-stats-mode .bv2-stats-chart-card .bv2-stats-chart-header { display: none; }
.brm-ah-stats-mode .bv2-stats-chart-card .bv2-stats-chart-body { min-height: 220px; }
.brm-ah-stats-mode .bv2-ext-chart-wrap,
.brm-ah-stats-mode .bv2-ext-kpi-card,
.brm-ah-stats-mode .bv2-stats-list-card,
.brm-ah-stats-mode .bv2-heatmap-wrap {
    border-color: var(--brm-border, #273142);
    background: var(--brm-surface-2, #171c26);
    color: var(--brm-text, #f4f6fb);
}
.brm-ah-stats-mode .bv2-ext-kpi-label,
.brm-ah-stats-mode .bv2-ext-chart-header,
.brm-ah-stats-mode .bv2-stats-list-title { color: var(--brm-text-2, #9aa4b5); }
.brm-ah-stats-mode .brm-kacc-item {
    border-color: var(--brm-border, #273142);
    background: var(--brm-surface, #11151d);
    color: var(--brm-text, #f4f6fb);
}
.brm-ah-stats-mode .brm-kacc-body { border-color: var(--brm-border, #273142); }

@media (max-width: 1050px) {
    .brm-ah-stats-mode .bv2-stats-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .brm-ah-stats-mode .brm-ah-stats-range { gap: 7px; margin-bottom: 10px; }
    .brm-ah-stats-mode .brm-ah-stats-range button { min-height: 38px; padding: 7px 8px; }
    .brm-ah-stats-mode .bv2-stats-kpi-row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 13px;
    }
    .brm-ah-stats-mode .bv2-stats-kpi-card {
        grid-column: span 2;
        min-height: 88px;
        gap: 6px;
        padding: 10px 8px;
        border-radius: 13px;
    }
    .brm-ah-stats-mode .bv2-stats-kpi-card:nth-child(n+4) { grid-column: span 3; }
    .brm-ah-stats-mode .bv2-stats-kpi-icon { width: 17px; height: 18px; flex-basis: 17px; }
    .brm-ah-stats-mode .bv2-stats-kpi-icon svg { width: 17px; height: 17px; }
    .brm-ah-stats-mode .bv2-stats-kpi-label { margin-bottom: 7px; font-size: 11px; }
    .brm-ah-stats-mode .bv2-stats-kpi-value { font-size: 17px; }
    .brm-ah-stats-mode .bv2-stats-kpi-sub { margin-top: 5px; font-size: 10px; }
    .brm-ah-stats-mode .brm-ah-stats-accordion { margin: 9px 0; border-radius: 14px; }
    .brm-ah-stats-mode .brm-ah-stats-accordion > summary { min-height: 54px; gap: 10px; padding: 12px 14px; font-size: 14px; }
    .brm-ah-stats-mode .brm-ah-stats-accordion-content { padding: 0 11px 12px; }
    .brm-ah-stats-mode .bv2-stats-chart-card .bv2-stats-chart-body { min-height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
    .brm-ah-stats-mode .brm-ah-stats-range button,
    .brm-ah-stats-mode .brm-ah-stats-accordion > summary::after { transition: none; }
}
