/* ─── Align brand palette ───────────────────────────────────────────
   navy   #27475A   sage   #8D9C84   green  #6D8458
   Used throughout the shell. Sidebar = navy, primary action = sage. */
body.ap-dashboard-body {
    margin: 0;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background: #f4f1ea;
    color: #123044;
}

.ap-dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
}

.ap-dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 10px 10px;
    background: #f4f1ea;
    border-right: 1px solid #e5ddcf;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.ap-dashboard-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ap-dashboard-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 52px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #e6eef2;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.ap-topbar-titleblock {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.ap-topbar-pagetitle {
    font-size: 1rem;
    font-weight: 700;
    color: #27475A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    padding-left: 11px;
    position: relative;
}

.ap-topbar-pagetitle::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    border-radius: 2px;
    background: #8D9C84;
}

.ap-topbar-subtitle {
    font-size: 0.72rem;
    color: #8a9fad;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.ap-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ap-dashboard-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 360px);
    padding: 12px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #dce8ee;
    box-shadow: 0 10px 28px rgba(15, 52, 74, 0.06);
}

.ap-dashboard-search svg,
.ap-topbar-action svg,
.ap-dashboard-nav__icon svg,
.ap-inline-icon svg,
.ap-activity-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.ap-dashboard-search input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: #375161;
    font-size: 0.95rem;
}

.ap-dashboard-topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ap-topbar-action {
    position: relative;
    width: 42px;
    height: 42px;
    border: 1px solid #dce8ee;
    border-radius: 50%;
    background: #fff;
    color: #197d8f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(15, 52, 74, 0.06);
}

.ap-topbar-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #18a8b8;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ap-user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ap-user-chip__meta {
    text-align: right;
    line-height: 1.2;
}

.ap-user-chip__name,
.ap-profile-card__name {
    font-weight: 600;
    color: #1e3342;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
}

.ap-profile-card__name {
    font-size: 0.82rem;
}

.ap-user-chip__name {
    font-size: 0.88rem;
}

.ap-user-chip__role,
.ap-profile-card__role,
.ap-muted {
    color: #77909f;
    font-size: 0.86rem;
}

.ap-avatar,
.ap-profile-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(180deg, #f8d7c1 0%, #e7b89c 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7d4d2a;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 52, 74, 0.12);
}

.ap-dashboard-content {
    padding: 16px 20px;
}

.ap-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #27475A;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.4rem;
    padding: 6px 8px 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid #e5ddcf;
}

.ap-brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #d8fbff 0%, #b8edf2 38%, #31a0ad 70%, #167786 100%);
    position: relative;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.ap-brand__mark::before,
.ap-brand__mark::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.82);
}

.ap-brand__mark::after {
    inset: 12px;
    border-width: 1px;
}

.ap-brand__text {
    font-size: 1.15rem;
    color: #27475A;
}

.ap-dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ap-dashboard-nav__link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 10px;
    color: #3c4a44;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.84rem;
    transition: background-color .2s ease, color .2s ease, box-shadow .15s ease, transform .15s ease;
    min-width: 0;
}

.ap-dashboard-nav__link span:not(.ap-dashboard-nav__icon) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.ap-dashboard-nav__link:hover {
    color: #4a5b41;
    background: rgba(109, 132, 88, 0.12);
}

.ap-dashboard-nav__link--active {
    color: #fff;
    background: #6D8458;
    box-shadow: 0 8px 18px rgba(109, 132, 88, 0.28);
}

.ap-dashboard-nav__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.88;
}

.ap-dashboard-sidebar__footer {
    margin-top: auto;
    display: grid;
    gap: 18px;
}

.ap-plan-card,
.ap-profile-card,
.ap-surface,
.ap-stat-card,
.ap-panel-card,
.ap-table-card,
.ap-side-card {
    background: #fff;
    border: 1px solid #e4edf1;
    border-radius: 22px;
    box-shadow: 0 18px 38px rgba(15, 52, 74, 0.08);
}

.ap-plan-card {
    padding: 18px;
    background: linear-gradient(180deg, rgba(232, 247, 249, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
}

.ap-plan-card__eyebrow,
.ap-card-eyebrow,
.ap-label {
    color: #8ca0ac;
    font-size: 0.8rem;
    font-weight: 500;
}

.ap-plan-card__title {
    margin-top: 8px;
    font-size: 1.12rem;
    font-weight: 700;
}

.ap-outline-button,
.ap-ghost-button,
.ap-primary-button,
.ap-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ap-outline-button:hover,
.ap-ghost-button:hover,
.ap-primary-button:hover,
.ap-danger-button:hover {
    transform: translateY(-1px);
}

.ap-outline-button {
    border: 1px solid #8D9C84;
    color: #5c6e51;
    background: transparent;
}

.ap-ghost-button {
    border: 1px solid #dce8ee;
    color: #405867;
    background: #fff;
}

.ap-primary-button {
    border: 0;
    color: #fff;
    background: #8D9C84;
    box-shadow: 0 10px 22px rgba(109, 132, 88, 0.26);
}

.ap-primary-button:hover {
    background: #7c8c73;
}

/* Accent "blue" button — used sparingly on a few key CTAs for contrast */
.ap-primary-button--blue {
    background: #27475A;
    box-shadow: 0 10px 22px rgba(39, 71, 90, 0.26);
}
.ap-primary-button--blue:hover {
    background: #1f3a48;
}

.ap-danger-button {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #d86d6d 0%, #bd4747 100%);
    box-shadow: 0 18px 30px rgba(189, 71, 71, 0.22);
}

.ap-primary-button--small,
.ap-outline-button--small,
.ap-ghost-button--small,
.ap-danger-button--small {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.86rem;
}

.ap-outline-button--small {
    border: 1px solid #b3c0a8;
    color: #5c6e51;
    background: #fbfcfa;
}

.ap-ghost-button--small {
    border: 1px solid #d8e4ea;
    color: #405867;
    background: #ffffff;
}

.ap-profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    min-width: 0;
}

.ap-profile-card > div {
    min-width: 0;
    flex: 1;
}

.ap-profile-card__spacer {
    margin-left: auto;
    color: #7f96a4;
}

.ap-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

/* Title is now in the topbar — hide duplicate h1 in list-page headers */
.ap-page-header h1 {
    display: none;
}

.ap-page-header p {
    margin: 0;
    color: #69808f;
    font-size: 0.88rem;
}

.ap-page-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ap-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.ap-stat-card {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ap-stat-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ap-stat-card--link:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(15, 52, 74, 0.13);
    color: inherit;
}

.ap-stat-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ap-stat-card__icon,
.ap-inline-icon,
.ap-activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5c6e51;
    background: linear-gradient(180deg, rgba(141, 156, 132, 0.18) 0%, rgba(141, 156, 132, 0.06) 100%);
}

.ap-stat-card__value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #153244;
    line-height: 1.1;
}

.ap-trend-positive {
    color: #15a26d;
    font-size: 0.86rem;
    font-weight: 600;
}

.ap-text-link {
    color: #5c6e51;
    font-weight: 600;
    text-decoration: none;
}

.ap-dashboard-board {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 18px;
    align-items: start;
}

.ap-trio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.ap-trio-grid > * {
    display: flex;
    flex-direction: column;
}

@media (max-width: 1100px) {
    .ap-trio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .ap-trio-grid { grid-template-columns: 1fr; }
}

.ap-panel-card,
.ap-table-card,
.ap-side-card {
    padding: 14px 16px;
}

.ap-panel-card h2,
.ap-table-card h2,
.ap-side-card h2,
.ap-section-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
}

.ap-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ap-card-value {
    margin-top: 10px;
    font-size: 2rem;
    font-weight: 700;
    color: #173345;
}

.ap-card-subtitle {
    color: #69808f;
    font-size: 0.92rem;
}

.ap-select-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #dde8ed;
    background: #fff;
    color: #4f6878;
    font-size: 0.86rem;
}

.ap-chart-host {
    height: 290px;
}

.ap-chart-host canvas,
.ap-donut-host canvas {
    width: 100% !important;
    height: 100% !important;
}

.ap-donut-host {
    position: relative;
    height: 240px;
    margin-bottom: 16px;
}

.ap-donut-total {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ap-donut-total__value {
    font-size: 1.75rem;
    font-weight: 700;
}

.ap-donut-total__label {
    color: #7a909d;
    font-size: 0.86rem;
}

.ap-legend-list,
.ap-activity-list,
.ap-action-list {
    display: grid;
    gap: 12px;
}

.ap-legend-item,
.ap-activity-item,
.ap-action-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
}

.ap-legend-item__dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
}

.ap-legend-item__amount,
.ap-activity-item__time {
    color: #6e8594;
    font-size: 0.85rem;
}

.ap-table-card {
    /* span all columns when used as a standalone full-width section inside a grid */
    grid-column: 1 / -1;
}

/* Inside the dashboard board, each card occupies its own column to keep a balanced 2x2 layout */
.ap-dashboard-board > .ap-table-card,
.ap-dashboard-board > .ap-panel-card,
.ap-dashboard-board > .ap-side-card {
    grid-column: auto;
}

.ap-dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.ap-dashboard-table th,
.ap-dashboard-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #edf3f6;
    text-align: left;
    font-size: 0.9rem;
}

.ap-dashboard-table th {
    color: #7a909d;
    font-size: 0.83rem;
    font-weight: 600;
}

.ap-dashboard-table tr:last-child td {
    border-bottom: 0;
}

.ap-dashboard-table tr.ap-row-link {
    cursor: pointer;
    transition: background-color .12s ease;
}

.ap-dashboard-table tr.ap-row-link:hover {
    background: rgba(109, 132, 88, 0.09);
}

.ap-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff3d7;
    color: #c48b00;
    font-size: 0.78rem;
    font-weight: 700;
}

.ap-status-pill--approved,
.ap-status-pill--active,
.ap-status-pill--paid {
    background: #e6f7ef;
    color: #158454;
}

.ap-status-pill--rejected,
.ap-status-pill--cancelled,
.ap-status-pill--overdue {
    background: #fde8e8;
    color: #b44d4d;
}

.ap-table-footer,
.ap-page-link {
    margin-top: 16px;
}

.ap-kpi-grid,
.ap-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.ap-list-table {
    width: 100%;
    border-collapse: collapse;
}

.ap-list-table th,
.ap-list-table td {
    padding: 14px 0;
    border-bottom: 1px solid #edf3f6;
}

.ap-list-table tr:last-child td {
    border-bottom: 0;
}

.ap-data-stack {
    display: grid;
    gap: 6px;
}

.ap-empty-state {
    padding: 18px;
    border-radius: 18px;
    background: #f7fbfd;
    border: 1px dashed #d8e7ee;
    color: #6d8593;
}

.ap-form-inline {
    display: inline;
}

.ap-form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ap-toolbar-card {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ap-filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.ap-filter-form__grow {
    flex: 1 1 260px;
}

.ap-table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ap-stack-gap {
    display: grid;
    gap: 18px;
}

.ap-booking-group {
    display: grid;
    gap: 14px;
}

.ap-booking-group__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #173345;
}

.ap-booking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ap-appointment-card {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.ap-appointment-card__header,
.ap-appointment-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ap-appointment-card__time {
    font-weight: 700;
    color: #183546;
}

.ap-appointment-card__title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #173345;
}

.ap-appointment-card__meta {
    color: #6e8594;
    font-size: 0.92rem;
}

.appointment-block {
    background: linear-gradient(135deg, #8D9C84 0%, #6D8458 100%);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 22px rgba(109, 132, 88, 0.26);
}

.buffer-block {
    border-radius: 14px;
    background: #f2f7fa;
    border: 1px dashed #d5e5ec;
}

.ap-calendar-layout {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 20px;
}

.ap-calendar-hours {
    display: grid;
}

.ap-calendar-hour {
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 4px;
    color: #7a909d;
    font-size: 0.82rem;
}

.ap-calendar-column {
    display: grid;
    gap: 18px;
}

.ap-calendar-surface {
    position: relative;
    height: 660px;
    border-radius: 20px;
    border: 1px solid #e5eef2;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    overflow: hidden;
}

.ap-calendar-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to bottom, rgba(114, 141, 157, 0.12) 1px, transparent 1px);
    background-size: 100% 60px;
    pointer-events: none;
}

.ap-calendar-section {
    display: grid;
    gap: 12px;
}

.ap-modal-surface .modal-content {
    border: 0;
    border-radius: 22px;
    box-shadow: 0 24px 50px rgba(15, 52, 74, 0.18);
}

.ap-modal-surface .modal-header,
.ap-modal-surface .modal-footer {
    border-color: #edf3f6;
}

.ap-onboarding-wrap {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.ap-onboarding-card {
    width: min(100%, 760px);
    padding: 30px;
}

.ap-onboarding-card__lead {
    color: #69808f;
    max-width: 560px;
}

.ap-form-shell {
    width: min(100%, 940px);
}

.ap-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ap-detail-item {
    padding: 18px;
    border-radius: 18px;
    background: #f8fbfd;
    border: 1px solid #e5eef2;
}

.ap-detail-item__label {
    color: #7a909d;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.ap-detail-item__value {
    color: #183546;
    font-weight: 600;
}

.ap-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ap-toggle-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.ap-input,
.ap-select,
.ap-textarea {
    width: 100%;
    border: 1px solid #d9e6ec;
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: #284253;
    box-shadow: inset 0 1px 2px rgba(15, 52, 74, 0.03);
}

.ap-input:focus,
.ap-select:focus,
.ap-textarea:focus {
    outline: none;
    border-color: #8D9C84;
    box-shadow: 0 0 0 4px rgba(141, 156, 132, 0.18);
}

.ap-field {
    display: grid;
    gap: 8px;
}

.ap-field label {
    font-weight: 600;
    color: #284253;
}

.ap-textarea {
    min-height: 140px;
    resize: vertical;
}

/* ─── Compact dashboard layout ─────────────────────────────────── */
.ap-page-header--compact {
    margin-bottom: 14px;
}
.ap-page-header--compact h1 {
    margin: 0 0 4px 0;
    font-size: 1.6rem;
}
.ap-page-header--compact p {
    margin: 0;
    color: #6e8594;
    font-size: 0.92rem;
}

.ap-stats-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}
.ap-stats-grid--3 .ap-stat-card {
    padding: 16px 18px;
}
.ap-stats-grid--3 .ap-stat-card__value {
    font-size: 1.6rem;
}
.ap-stats-grid--3 .ap-stat-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.ap-board-2col {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
    align-items: stretch;
}
.ap-board-2col > * {
    padding: 18px;
    margin: 0;
}

.ap-chart-host--compact {
    height: 220px;
}

.ap-table-card--inline {
    grid-column: auto;
}
.ap-table-card--inline .ap-dashboard-table th,
.ap-table-card--inline .ap-dashboard-table td {
    padding: 10px 8px;
    font-size: 0.9rem;
}

@media (max-width: 1400px) {
    .ap-stats-grid:not(.ap-stats-grid--3) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-dashboard-board {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.92fr);
    }

    .ap-table-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1100px) {
    .ap-board-2col,
    .ap-stats-grid--3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1080px) {
    .ap-dashboard-shell {
        grid-template-columns: 1fr;
    }

    .ap-dashboard-sidebar {
        border-right: 0;
        border-bottom: 1px solid #e4edf1;
    }

    .ap-dashboard-topbar,
    .ap-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ap-dashboard-search {
        width: 100%;
    }

    .ap-dashboard-board,
    .ap-stats-grid,
    .ap-form-grid {
        grid-template-columns: 1fr;
    }

    .ap-toolbar-card,
    .ap-filter-form,
    .ap-appointment-card__header,
    .ap-appointment-card__footer,
    .ap-calendar-layout {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .ap-table-card {
        grid-column: auto;
    }

    /* on mobile the sidebar is no longer sticky/scrollable - let it flow naturally */
    .ap-dashboard-sidebar {
        position: static;
        height: auto;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid #e4edf1;
    }
}

/* ─── Avatar / user-chip dropdown ─────────────────────────────────── */
.ap-user-chip {
    position: relative;
    cursor: pointer;
}

.ap-user-chip-btn {
    all: unset;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 14px;
    padding: 6px 10px 6px 6px;
    transition: background .2s;
    min-width: 0;
    width: 100%;
}
.ap-user-chip-btn > div {
    min-width: 0;
    flex: 1;
}
.ap-user-chip-btn > div > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ap-user-chip-btn:hover {
    background: rgba(141, 156, 132, 0.12);
}

.ap-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e0ecf0;
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(15, 52, 74, 0.14);
    z-index: 200;
    padding: 8px;
    overflow: hidden;
}
.ap-user-chip.open .ap-user-dropdown {
    display: block;
}

.ap-user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #284253;
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 500;
    transition: background .15s;
    cursor: pointer;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}
.ap-user-dropdown__item:hover {
    background: #f3f6f0;
    color: #5c6e51;
}
.ap-user-dropdown__item--danger,
.ap-user-dropdown__item--danger:hover {
    color: #c0392b;
    background: #fdf2f2;
}
.ap-user-dropdown__divider {
    height: 1px;
    background: #edf3f6;
    margin: 6px 0;
}

/* profile card in sidebar is also clickable */
.ap-profile-card {
    cursor: pointer;
    transition: background .2s;
}
.ap-profile-card:hover {
    background: #f0f8fa;
}

/* --- Tabs --- */
.ap-tabs { display:flex; gap:6px; border-bottom:1px solid #e3eaee; flex-wrap:wrap; }
.ap-tab { padding:10px 16px; border-bottom:2px solid transparent; color:#5e7588; text-decoration:none; font-weight:500; }
.ap-tab:hover { color:#6D8458; }
.ap-tab--active { color:#5c6e51; border-bottom-color:#8D9C84; font-weight:600; }

