/* Account settings modal (partials/account-settings-modal.blade.php).
   In its own file, not dashboard.css: public pages (public/campaign,
   public/partials/workspace-header) include the modal without ever
   loading dashboard.css. */

.acm-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    animation: acmFade 0.18s ease-out;
}
.acm-modal[hidden] { display: none; }
.acm-card {
    position: relative;
    width: 100%;
    max-width: 920px;
    height: 100vh;
    background: var(--color-surface, #fff);
    box-shadow: -16px 0 48px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: acmSlideIn 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Header bar — single divider line under title, owns the close button. */
.acm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border-light, #e5e7eb);
    flex-shrink: 0;
}
.acm-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.acm-title { font-size: 18px; font-weight: 700; color: var(--color-text, #111827); margin: 0; line-height: 1.2; }
.acm-subtitle { font-size: 13px; color: var(--color-text-secondary, #6b7280); margin: 0; }
.acm-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text-secondary, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.acm-close:hover { background: var(--color-bg, #f2f6fb); color: var(--color-text, #111827); }

/* Body fills remaining space, hosts the sidebar/content split. */
.acm-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

/* First-open spinner, and the same one when a fetch is in flight. */
.acm-loader { flex: 1; display: flex; align-items: center; justify-content: center; }
.acm-spinner {
    width: 28px; height: 28px;
    border: 2px solid var(--color-border-light, #e5e7eb);
    border-top-color: var(--color-primary, #1264FF);
    border-radius: 50%;
    animation: acmSpin 0.8s linear infinite;
}
@keyframes acmSpin { to { transform: rotate(360deg); } }
.acm-error { padding: 32px 24px; font-size: 13px; color: #ef4444; }
.acm-error button {
    display: inline; background: none; border: none; padding: 0;
    color: var(--color-primary, #1264FF); font: inherit; cursor: pointer; text-decoration: underline;
}

/* Make the inner profile blade fill the body and act as the layout root. */
.acm-body .ap-wrap {
    flex: 1;
    padding: 0;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.acm-body .ap-head { display: none; }
.acm-body .ap-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    min-height: 0;
}

/* Sidebar — full-height tinted column, no card border/radius. */
.acm-body .ap-nav {
    background: var(--color-bg, #f2f6fb);
    border: none;
    border-right: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: 0;
    padding: 18px 12px;
    margin: 0;
    position: static;
    height: 100%;
    overflow-y: auto;
    align-self: stretch;
    flex-direction: column;
    gap: 2px;
}
.acm-body .ap-nav a:hover { background: var(--color-surface, #fff); }
.acm-body .ap-nav a.is-active { background: var(--color-primary-light, #eff6ff); }

/* Content column — own scroll, white background, breathing-room padding. */
.acm-body .ap-layout > div:not(.ap-nav) {
    overflow-y: auto;
    padding: 28px 32px 40px;
    background: var(--color-surface, #fff);
    min-height: 0;
}

/* Flatten the inner .ap-card so content flows directly inside the right
   column. The right column already provides padding + bg, so the card border
   feels like a redundant nested wrap. Card head still shows the section
   title with a subtle bottom rule. */
.acm-body .ap-card {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    margin: 0 0 24px;
    box-shadow: none;
}
.acm-body .ap-card:last-child { margin-bottom: 0; }
.acm-body .ap-card__head {
    padding: 0 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border-light, #e5e7eb);
    background: transparent;
}
.acm-body .ap-card__head svg { display: none; }
.acm-body .ap-card__body {
    padding: 0;
}

/* The standalone page's own chrome must not appear inside the drawer — the
   fragment carries the topbar/donor header rules with it. */
.acm-body .ap-topbar { display: none; }

/* Workspace billing detail (account/billing.blade.php in overlay mode) drops
   its own card chrome inside the modal — the modal's content column already
   provides surface + padding, so the inner .ab-card border/radius would just
   read as a card-inside-a-card. Flatten everything to span the full width
   edge-to-edge. */
.acm-body [data-billing-detail] { padding: 0; }
.acm-body .ab-overlay-detail { padding: 0; }
.acm-body .ab-card {
    border: none;
    background: transparent;
    border-radius: 0;
    margin: 0;
    overflow: visible;
}
.acm-body .ab-card__head {
    padding: 0 0 16px;
}
.acm-body .ab-card__body {
    padding: 16px 0 0;
}
.acm-body .ab-subtabs { padding: 0 !important; }

@keyframes acmFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes acmSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* Tablet & narrow desktop — keep split layout, trim sidebar + padding so the
   panel never feels cramped on smaller laptop widths. */
@media (max-width: 1024px) {
    .acm-card { max-width: 760px; }
    .acm-body .ap-layout { grid-template-columns: 200px minmax(0, 1fr); }
    .acm-body .ap-layout > div:not(.ap-nav) { padding: 24px 24px 36px; }
    .acm-body .ap-card__head { padding-bottom: 20px; margin-bottom: 20px; }
}

/* Mobile — stack: sticky pill-style tab bar at top, then content fills. */
@media (max-width: 768px) {
    .acm-card { max-width: 100vw; }
    .acm-header { padding: 14px 18px; }
    .acm-title { font-size: 17px; }
    .acm-subtitle { font-size: 12px; }
    .acm-body .ap-layout {
        display: flex;
        flex-direction: column;
    }
    .acm-body .ap-nav {
        position: sticky;
        top: 0;
        z-index: 2;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding: 10px 14px;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border-light, #e5e7eb);
        background: var(--color-bg, #f2f6fb);
    }
    .acm-body .ap-nav a {
        padding: 8px 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .acm-body .ap-layout > div:not(.ap-nav) {
        padding: 22px 18px 32px;
    }
}

/* Small phones — tighten further. */
@media (max-width: 480px) {
    .acm-header { padding: 12px 16px; gap: 12px; }
    .acm-title { font-size: 16px; }
    .acm-close { width: 32px; height: 32px; }
    .acm-body .ap-nav { padding: 8px 10px; }
    .acm-body .ap-nav a { font-size: 13px; padding: 7px 10px; }
    .acm-body .ap-layout > div:not(.ap-nav) {
        padding: 18px 14px 28px;
    }
    .acm-body .ap-card__head { padding-bottom: 16px; margin-bottom: 16px; }
}

body.acm-open { overflow: hidden; }
