/* =======================================================
   Àṣẹ Haus Client Portal — v2.0
   Fonts: Libre Baskerville (serif) · Inter (sans)
   Palette: Black #0A0A0A · Cream #F5F1E8 · Gold #C9A961
   ======================================================= */

/* ── Reset & Tokens ──────────────────────────────────────── */
.ahp-portal, .ahp-fullscreen, .ahp-redirect-notice {
    --black:       #0A0A0A;
    --black-soft:  #1A1A1A;
    --charcoal:    #2A2A2A;
    --cream:       #F5F1E8;
    --cream-dark:  #EDE7D5;
    --cream-mid:   #E8DCC4;
    --gold:        #C9A961;
    --gold-dim:    rgba(201,169,97,.15);
    --gold-glow:   rgba(201,169,97,.3);
    --muted:       #7A746C;
    --border:      rgba(26,26,26,.1);
    --border-strong: rgba(26,26,26,.18);
    --white:       #FFFFFF;
    --red:         #c0392b;
    --green:       #27ae60;
    --sidebar-w:   260px;
    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   16px;
    --shadow:      0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.1);
    --ease:        cubic-bezier(.25,.46,.45,.94);
    --font-serif:  'Libre Baskerville', Georgia, serif;
    --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.ahp-portal *, .ahp-fullscreen *, .ahp-redirect-notice * {
    margin:0; padding:0; box-sizing:border-box;
}
.ahp-portal, .ahp-fullscreen {
    font-family: var(--font-sans);
    color: var(--black);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* ── Redirect notice ──────────────────────────────────────── */
.ahp-redirect-notice {
    padding: 3rem;
    text-align: center;
    font-family: var(--font-sans);
}
.ahp-redirect-notice a { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES — Login / Register
   ═══════════════════════════════════════════════════════════ */
.ahp-fullscreen {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   AUTH — LOGIN / REGISTER  (complete redesign)
   ═══════════════════════════════════════════════════════════ */

/* Mobile logo bar — only visible on small screens */
.ahp-login-mobile-bar {
    display: none;
    background: var(--black);
    padding: 16px 24px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.ahp-login-mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--cream);
    font-family: var(--font-serif);
    font-size: .95rem;
    font-weight: 700;
}

/* Tab switcher */
.ahp-login-tabs {
    position: relative;
    display: flex;
    background: var(--cream-dark);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 0;
}
.ahp-login-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: .84rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s;
    position: relative;
    z-index: 1;
}
.ahp-login-tab--active { color: var(--black); }
.ahp-login-tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: var(--white);
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    transition: left .22s cubic-bezier(.25,.46,.45,.94), width .22s cubic-bezier(.25,.46,.45,.94);
    z-index: 0;
    pointer-events: none;
}

/* Brand link on left panel */
.ahp-login-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 48px;
}
.ahp-brand-name {
    font-family: var(--font-serif);
    color: var(--cream);
    font-size: 1rem;
    font-weight: 700;
}

/* Magic link form styling — override plugin defaults */
.ahp-magic-wrap { margin-top: 4px; }
.ahp-magic-wrap form { display: flex; flex-direction: column; gap: 16px; }
.ahp-magic-wrap input[type="email"],
.ahp-magic-wrap input[type="text"] {
    width: 100%;
    padding: 13px 16px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .9rem;
    color: var(--black);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    box-sizing: border-box;
}
.ahp-magic-wrap input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}
.ahp-magic-wrap input[type="submit"],
.ahp-magic-wrap button[type="submit"] {
    width: 100%;
    padding: 14px 28px;
    background: var(--black);
    color: var(--cream);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.ahp-magic-wrap input[type="submit"]:hover,
.ahp-magic-wrap button[type="submit"]:hover { background: var(--charcoal); }
.ahp-magic-wrap p,
.ahp-magic-wrap .ml-notice,
.ahp-magic-wrap .ml-success { font-size: .875rem; color: var(--muted); line-height: 1.6; }
.ahp-magic-wrap label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--charcoal);
    display: block;
    margin-bottom: 6px;
}
.ahp-magic-wrap .ml-field { display: flex; flex-direction: column; }
    background: var(--black);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 56px 48px;
}
.ahp-login-left-inner { position: relative; z-index: 2; }
.ahp-login-noise {
    position: absolute; inset: 0; z-index: 1; opacity: .04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}
.ahp-brand-mark {
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: 400;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 32px;
    opacity: .9;
}
.ahp-brand-quote {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--cream);
    line-height: 1.4;
    margin-bottom: 16px;
    border-left: 2px solid var(--gold);
    padding-left: 20px;
}
.ahp-brand-sub {
    color: rgba(245,241,232,.5);
    font-size: .875rem;
    line-height: 1.6;
    max-width: 280px;
}

/* Right panel */
.ahp-login-right {
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    overflow-y: auto;
}
.ahp-login-form-wrap {
    width: 100%;
    max-width: 400px;
}
.ahp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: .82rem;
    margin-bottom: 40px;
    transition: color .2s;
}
.ahp-back-link:hover { color: var(--black); }
.ahp-form-header { margin-bottom: 32px; }
.ahp-form-header h1 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 8px;
}
.ahp-form-header p { color: var(--muted); font-size: .9rem; }
.ahp-form-footer { margin-top: 24px; text-align: center; font-size: .82rem; color: var(--muted); }
.ahp-form-footer a { color: var(--black); font-weight: 600; text-decoration: none; }
.ahp-form-footer a:hover { color: var(--gold); }

/* ── Form Fields ─────────────────────────────────────────── */
.ahp-form { display: flex; flex-direction: column; gap: 20px; }
.ahp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ahp-field-group { display: flex; flex-direction: column; gap: 7px; }
.ahp-field-group label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--charcoal);
}
.ahp-field-label-row {
    display: flex; justify-content: space-between; align-items: center;
}
.ahp-label-link { font-size: .75rem; color: var(--muted); text-decoration: none; }
.ahp-label-link:hover { color: var(--gold); }

.ahp-field-group input,
.ahp-field-group textarea,
.ahp-field-group select,
.ahp-form input,
.ahp-form textarea,
.ahp-form select {
    width: 100%;
    padding: 13px 16px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .9rem;
    color: var(--black);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.ahp-field-group input:focus,
.ahp-field-group textarea:focus,
.ahp-field-group select:focus,
.ahp-form input:focus,
.ahp-form textarea:focus,
.ahp-form select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}
.ahp-input-disabled { background: var(--cream-dark) !important; color: var(--muted) !important; cursor: not-allowed; }
.ahp-input-wrap { position: relative; }
.ahp-input-wrap input { padding-right: 44px; }
.ahp-toggle-pass {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--muted);
    padding: 4px; line-height: 1;
}
.ahp-toggle-pass:hover { color: var(--black); }
.ahp-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.ahp-checkbox-label input { width: auto; }
.ahp-field-inline { flex-direction: row; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────── */
.ahp-btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--black);
    color: var(--cream);
    padding: 14px 28px;
    border: none; border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .15s, box-shadow .2s;
    width: 100%;
}
.ahp-btn-primary:hover { background: var(--charcoal); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.ahp-btn-primary:active { transform: scale(.99); }
.ahp-btn-sm { padding: 10px 20px; font-size: .82rem; width: auto; }

.ahp-btn-outline {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--black);
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
    white-space: nowrap;
}
.ahp-btn-outline:hover { border-color: var(--black); background: var(--black); color: var(--cream); }

.ahp-btn-pay {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    background: var(--gold);
    border: none; border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .82rem;
    font-weight: 700;
    color: var(--black);
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
    white-space: nowrap;
}
.ahp-btn-pay:hover { box-shadow: 0 4px 12px var(--gold-glow); transform: translateY(-1px); }

.ahp-btn-ghost {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
}

/* ── Alert / Notice ──────────────────────────────────────── */
.ahp-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    line-height: 1.5;
    margin-bottom: 16px;
    background: #fef2f2;
    color: var(--red);
    border: 1px solid rgba(192,57,43,.2);
}
.ahp-alert.success { background: #f0fdf4; color: var(--green); border-color: rgba(39,174,96,.2); }
.ahp-alert.ahp-alert-info { background: var(--cream-dark); color: var(--charcoal); border-color: var(--border-strong); }
.ahp-alert a { color: inherit; font-weight: 600; }
.ahp-alert--inline { margin: 0; }

/* ── Spinner ─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.ahp-spin { animation: spin 0.8s linear infinite; }

/* ═══════════════════════════════════════════════════════════
   PORTAL LAYOUT
   ═══════════════════════════════════════════════════════════ */
.ahp-portal {
    display: flex;
    min-height: 100vh;
    background: var(--cream);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.ahp-sidebar {
    width: var(--sidebar-w);
    background: var(--black);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform .35s var(--ease);
    overflow: hidden;
}
.ahp-sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: 8px;
    flex-shrink: 0; /* never shrink — always visible at top */
}
.ahp-sidebar-logo a {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
    color: var(--cream);
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.ahp-sidebar-logo a:hover { color: var(--gold); }

.ahp-nav { padding: 8px 16px; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ahp-nav-label {
    display: block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(245,241,232,.25);
    padding: 8px 8px 6px;
}
.ahp-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    color: rgba(245,241,232,.6);
    transition: background .15s, color .15s;
    position: relative;
    cursor: pointer;
}
.ahp-nav-item svg { flex-shrink: 0; opacity: .7; }
.ahp-nav-item:hover { background: rgba(255,255,255,.06); color: var(--cream); }
.ahp-nav-item:hover svg { opacity: 1; }
.ahp-nav-item--active { background: rgba(201,169,97,.12); color: var(--gold); }
.ahp-nav-item--active svg { opacity: 1; color: var(--gold); }
.ahp-nav-badge {
    margin-left: auto;
    background: var(--gold);
    color: var(--black);
    font-size: .65rem;
    font-weight: 800;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.ahp-sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0; /* never shrink — always visible at bottom */
}
.ahp-user-chip {
    display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.ahp-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: var(--gold);
    color: var(--black);
    font-family: var(--font-serif);
    font-size: 1rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.ahp-user-info { min-width: 0; }
.ahp-user-info strong { display: block; font-size: .82rem; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ahp-user-info small { font-size: .73rem; color: rgba(245,241,232,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ahp-logout-btn {
    background: none; border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius-sm);
    color: rgba(245,241,232,.4);
    cursor: pointer; padding: 6px 9px; flex-shrink: 0;
    transition: color .15s, border-color .15s;
    display: flex;
}
.ahp-logout-btn:hover { color: var(--cream); border-color: rgba(255,255,255,.3); }

/* ── Main area ───────────────────────────────────────────── */
.ahp-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.ahp-topbar {
    display: none; /* hidden on desktop */
}
.ahp-content {
    padding: 44px 48px;
    max-width: 1100px;
    width: 100%;
}

/* ── Page header ─────────────────────────────────────────── */
.ahp-page-hero {
    margin-bottom: 36px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.ahp-page-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 4px;
}
.ahp-page-sub { color: var(--muted); font-size: .9rem; }
.ahp-overview-date { font-size: .8rem; color: var(--muted); white-space: nowrap; margin-top: 6px; }

/* ── Sections ────────────────────────────────────────────── */
.ahp-section { margin-bottom: 44px; }
.ahp-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.ahp-section-heading {
    font-family: var(--font-serif);
    font-size: 1.15rem; font-weight: 400;
    margin-bottom: 16px;
}
.ahp-section-heading--sm { font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.ahp-section-link { font-size: .82rem; color: var(--muted); text-decoration: none; }
.ahp-section-link:hover { color: var(--gold); }

/* ── Stat row ────────────────────────────────────────────── */
.ahp-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 44px;
}
.ahp-stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-decoration: none;
    color: var(--black);
    transition: border-color .2s, box-shadow .2s, transform .15s;
    display: flex; flex-direction: column; gap: 4px;
}
.ahp-stat-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.ahp-stat-value { font-family: var(--font-serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.ahp-stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }

/* ── Action items ────────────────────────────────────────── */
.ahp-action-list { display: flex; flex-direction: column; gap: 10px; }
.ahp-action-item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border-left: 3px solid var(--border);
}
.ahp-action-item--urgent  { border-left-color: var(--red); }
.ahp-action-item--info    { border-left-color: var(--gold); }
.ahp-action-item--approval{ border-left-color: #8b5cf6; }
.ahp-action-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ahp-action-item--urgent  .ahp-action-dot { color: var(--red); }
.ahp-action-item--info    .ahp-action-dot { color: var(--gold); }
.ahp-action-item--approval .ahp-action-dot { color: #8b5cf6; }
.ahp-action-item p { font-size: .875rem; margin: 0; }
.ahp-action-cta { font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--black); white-space: nowrap; }
.ahp-action-cta:hover { color: var(--gold); }

/* ── Project cards ───────────────────────────────────────── */
.ahp-project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.ahp-project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ahp-project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ahp-project-card-head h3 { font-family: var(--font-serif); font-size: 1rem; font-weight: 400; margin: 0; }
.ahp-project-phase { font-size: .8rem; color: var(--muted); margin: 0; }

/* Full project cards on Projects tab */
.ahp-project-grid { display: flex; flex-direction: column; gap: 20px; }
.ahp-project-full-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ahp-pfc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ahp-pfc-title { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 400; margin: 0; }
.ahp-pfc-phase { font-size: .875rem; color: var(--muted); margin-top: 4px; }
.ahp-pfc-dates { display: flex; gap: 24px; font-size: .8rem; color: var(--muted); }
.ahp-pfc-description { font-size: .875rem; line-height: 1.7; color: var(--charcoal); border-top: 1px solid var(--border); padding-top: 16px; }
.ahp-pfc-related { display: flex; gap: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.ahp-pfc-related-group { display: flex; align-items: center; gap: 16px; font-size: .82rem; color: var(--muted); }
.ahp-pfc-related-group svg { opacity: .5; }
.ahp-pfc-related-group a { color: var(--black); font-weight: 600; text-decoration: none; }
.ahp-pfc-related-group a:hover { color: var(--gold); }

/* ── Progress ────────────────────────────────────────────── */
.ahp-progress-track {
    background: var(--cream-dark);
    border-radius: 100px;
    height: 4px; overflow: hidden;
}
.ahp-progress-track--lg { height: 6px; }
.ahp-progress-fill {
    height: 100%; border-radius: 100px;
    background: linear-gradient(90deg, var(--gold), #e8c77a);
    transition: width .5s var(--ease);
}
.ahp-progress-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }

/* ── Next step ───────────────────────────────────────────── */
.ahp-next-step {
    display: flex; align-items: center; gap: 8px;
    font-size: .8rem; color: var(--muted);
    background: var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}
.ahp-next-step svg { flex-shrink: 0; color: var(--gold); }
.ahp-next-step--prominent { background: rgba(201,169,97,.1); border: 1px solid var(--gold-dim); font-size: .85rem; color: var(--charcoal); }
.ahp-next-step--prominent strong { color: var(--black); margin-right: 4px; }

/* ── Pills / Status badges ───────────────────────────────── */
.ahp-pill {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
}
.ahp-pill--active    { background: rgba(39,174,96,.12); color: #1a7a45; }
.ahp-pill--complete  { background: rgba(59,130,246,.12); color: #1d4ed8; }
.ahp-pill--paused    { background: rgba(245,158,11,.12); color: #b45309; }
.ahp-pill--cancelled { background: rgba(107,114,128,.12); color: #4b5563; }
.ahp-pill--paid      { background: rgba(39,174,96,.12); color: #1a7a45; }
.ahp-pill--unpaid    { background: rgba(192,57,43,.1);  color: var(--red); }
.ahp-pill--overdue   { background: rgba(192,57,43,.15); color: var(--red); }
.ahp-pill--partial   { background: rgba(245,158,11,.12); color: #b45309; }

/* ── Updates feed ────────────────────────────────────────── */
.ahp-update-feed { display: flex; flex-direction: column; gap: 14px; }
.ahp-update-item { display: flex; gap: 14px; align-items: flex-start; }
.ahp-update-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    margin-top: 4px; background: var(--border-strong);
}
.ahp-update-dot--milestone   { background: var(--gold); }
.ahp-update-dot--approval_needed { background: #8b5cf6; }
.ahp-update-dot--revision    { background: #f59e0b; }
.ahp-update-body { flex: 1; }
.ahp-update-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
.ahp-update-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ahp-update-project { font-size: .78rem; color: var(--muted); }
.ahp-update-time { font-size: .75rem; color: var(--muted); margin-left: auto; }
.ahp-update-title { font-size: .9rem; font-weight: 600; }
.ahp-update-excerpt { font-size: .82rem; color: var(--muted); margin-top: 2px; }

/* ── Documents ───────────────────────────────────────────── */
.ahp-doc-table { display: flex; flex-direction: column; gap: 8px; }
.ahp-doc-row {
    display: grid;
    grid-template-columns: 40px 1fr auto auto auto;
    align-items: center;
    gap: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    transition: border-color .15s;
}
.ahp-doc-row:hover { border-color: var(--border-strong); }
.ahp-doc-icon {
    width: 38px; height: 38px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ahp-doc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ahp-doc-info strong { font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ahp-doc-size { font-size: .75rem; color: var(--muted); }
.ahp-doc-type-badge {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.ahp-doc-date { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.ahp-doc-action { flex-shrink: 0; }

/* ── Invoice summary ─────────────────────────────────────── */
.ahp-invoice-summary {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin-bottom: 32px;
}
.ahp-inv-sum-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 24px; display: flex; flex-direction: column; gap: 4px;
}
.ahp-inv-sum-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ahp-inv-sum-value { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 400; color: var(--black); }
.ahp-sum-green { color: var(--green); }
.ahp-sum-red   { color: var(--red);   }

/* Invoice cards */
.ahp-invoice-list { display: flex; flex-direction: column; gap: 12px; }
.ahp-invoice-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; border-left: 4px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.ahp-invoice-card--paid    { border-left-color: var(--green); }
.ahp-invoice-card--unpaid  { border-left-color: var(--gold); }
.ahp-invoice-card--overdue { border-left-color: var(--red); }
.ahp-invoice-card--partial { border-left-color: #f59e0b; }
.ahp-invoice-card:hover { box-shadow: var(--shadow); }
.ahp-invoice-card-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px 0; gap: 12px;
}
.ahp-invoice-id { display: flex; align-items: center; gap: 12px; }
.ahp-inv-number { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ahp-inv-project { font-size: .8rem; color: var(--muted); }
.ahp-invoice-card-body { padding: 12px 24px; }
.ahp-invoice-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.ahp-invoice-title-row h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.ahp-inv-amount { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 400; white-space: nowrap; }
.ahp-invoice-meta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ahp-invoice-meta-row span { font-size: .8rem; color: var(--muted); }
.ahp-inv-paid { color: var(--green) !important; font-weight: 600; }
.ahp-inv-notes { font-style: italic; }
.ahp-invoice-card-actions {
    padding: 12px 24px 18px;
    display: flex; gap: 10px; align-items: center;
}

/* ── Timeline (Updates) ──────────────────────────────────── */
.ahp-updates-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.ahp-updates-timeline::before {
    content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px;
    width: 2px; background: var(--border); border-radius: 2px;
}
.ahp-timeline-item { display: flex; gap: 20px; align-items: flex-start; padding-bottom: 28px; }
.ahp-timeline-dot {
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    background: var(--cream-dark); border: 3px solid var(--border-strong);
    position: relative; z-index: 1; margin-top: 3px;
}
.ahp-timeline-item--milestone .ahp-timeline-dot { background: var(--gold); border-color: var(--gold); }
.ahp-timeline-item--approval_needed .ahp-timeline-dot { background: #8b5cf6; border-color: #8b5cf6; }
.ahp-timeline-card {
    flex: 1;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 22px;
}
.ahp-timeline-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ahp-timeline-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ahp-timeline-project { font-size: .78rem; color: var(--muted); }
.ahp-timeline-date { font-size: .75rem; color: var(--muted); margin-left: auto; }
.ahp-timeline-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 400; margin-bottom: 8px; }
.ahp-timeline-content { font-size: .875rem; line-height: 1.7; color: var(--charcoal); }
.ahp-approval-prompt {
    margin-top: 12px; padding: 10px 14px;
    background: rgba(139,92,246,.06); border-radius: var(--radius-sm);
    border: 1px solid rgba(139,92,246,.2); font-size: .82rem;
}
.ahp-approval-prompt a { color: #7c3aed; font-weight: 600; text-decoration: none; }

/* ── Messages ────────────────────────────────────────────── */
.ahp-messenger { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.ahp-thread-select { display: flex; align-items: center; gap: 12px; }
.ahp-thread-select label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.ahp-thread-select select { max-width: 280px; }
.ahp-thread {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px; min-height: 300px; max-height: 480px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
    scroll-behavior: smooth;
}
.ahp-thread-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .875rem; margin: auto; }
.ahp-thread-empty { color: var(--muted); font-size: .875rem; text-align: center; margin: auto; }
.ahp-msg { display: flex; flex-direction: column; gap: 4px; }
.ahp-msg--client { align-items: flex-end; }
.ahp-msg--admin  { align-items: flex-start; }
.ahp-msg-bubble {
    max-width: 75%;
    padding: 11px 16px; border-radius: 14px;
    font-size: .875rem; line-height: 1.55;
}
.ahp-msg--client .ahp-msg-bubble {
    background: var(--black); color: var(--cream);
    border-bottom-right-radius: 4px;
}
.ahp-msg--admin .ahp-msg-bubble {
    background: var(--cream-dark); color: var(--black);
    border-bottom-left-radius: 4px;
}
.ahp-msg-time { font-size: .7rem; color: var(--muted); padding: 0 4px; }
.ahp-compose {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.ahp-compose textarea {
    border: none; outline: none; resize: none;
    font-family: var(--font-sans); font-size: .9rem;
    background: transparent; width: 100%; line-height: 1.5;
    color: var(--black);
}
.ahp-compose textarea::placeholder { color: var(--muted); }
.ahp-compose-footer { display: flex; justify-content: space-between; align-items: center; }
.ahp-compose-footer small { font-size: .75rem; color: var(--muted); }

/* ── Profile form ────────────────────────────────────────── */
.ahp-form-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 32px; max-width: 600px;
}
.ahp-form-section { margin-bottom: 32px; }
.ahp-form-section-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 400; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.ahp-form-section-note { font-size: .82rem; color: var(--muted); margin-bottom: 16px; margin-top: -10px; }
.ahp-form-card .ahp-field-group small { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.ahp-form-card .ahp-btn-primary { width: auto; min-width: 160px; }

/* ── Empty states ────────────────────────────────────────── */
.ahp-empty-state {
    text-align: center; padding: 60px 20px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ahp-empty-state svg { opacity: .25; width: 40px; height: 40px; }
.ahp-empty-state h3 { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 400; color: var(--charcoal); }
.ahp-empty-state p { font-size: .875rem; max-width: 320px; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ahp-stat-row { grid-template-columns: repeat(2, 1fr); }
    .ahp-content  { padding: 32px 32px; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE BREAKOUT — escape WordPress theme container
   Forces the portal to fill the full viewport width on mobile,
   overriding any theme padding/max-width on the page content area.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Break the portal out of the WP theme's content wrapper */
    .ahp-portal {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        position: relative;
        left: 0;
        right: 0;
    }

    /* Also break out the fullscreen auth pages */
    .ahp-fullscreen {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }

    /* Ensure the body/html don't clip the breakout */
    body:has(.ahp-portal),
    body:has(.ahp-fullscreen) {
        overflow-x: hidden;
    }

    /* Remove any theme-injected padding on the content area */
    body:has(.ahp-portal) .entry-content,
    body:has(.ahp-portal) .page-content,
    body:has(.ahp-portal) .wp-block-post-content,
    body:has(.ahp-portal) .site-main,
    body:has(.ahp-fullscreen) .entry-content,
    body:has(.ahp-fullscreen) .page-content,
    body:has(.ahp-fullscreen) .wp-block-post-content,
    body:has(.ahp-fullscreen) .site-main {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
    }
}

@media (max-width: 768px) {

    /* ── Auth: mobile login ───────────────────────────────── */
    .ahp-fullscreen {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        grid-template-columns: none;
    }
    .ahp-login-mobile-bar { display: flex; }
    .ahp-login-left       { display: none; }
    .ahp-login-right {
        flex: 1;
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
        background: var(--cream);
    }
    .ahp-login-form-wrap {
        max-width: 100%;
        width: 100%;
        padding: 32px 24px 48px;
    }
    .ahp-back-link { margin-bottom: 28px; }
    .ahp-form-header { margin-bottom: 24px; }
    .ahp-form-header h1 { font-size: 1.9rem; }
    .ahp-login-tabs { margin-bottom: 24px; }
    .ahp-btn-primary { min-height: 52px; font-size: 1rem; }
    .ahp-field-group input,
    .ahp-field-group select { min-height: 52px; font-size: 1rem; }

    /* ── Portal: full-screen layout ──────────────────────── */
    .ahp-portal {
        display: flex;
        flex-direction: column;
    }

    /* Sidebar becomes off-canvas drawer */
    .ahp-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        z-index: 200;
    }
    .ahp-sidebar.ahp-sidebar--open {
        transform: translateX(0);
        box-shadow: 0 0 0 100vw rgba(0,0,0,.45);
    }

    /* Sticky topbar */
    .ahp-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--black);
        padding: 14px 16px;
        position: sticky;
        top: 0;
        z-index: 150;
        min-height: 56px;
    }
    .ahp-topbar-brand {
        font-family: var(--font-serif);
        color: var(--cream);
        font-size: .95rem;
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .ahp-menu-toggle {
        background: none;
        border: none;
        color: var(--cream);
        cursor: pointer;
        padding: 6px;
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }
    .ahp-topbar-badge {
        background: var(--gold);
        color: var(--black);
        width: 22px; height: 22px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .68rem;
        font-weight: 800;
        text-decoration: none;
        flex-shrink: 0;
    }

    /* Main content: full width, no left margin */
    .ahp-main {
        margin-left: 0;
        flex: 1;
        width: 100%;
        min-width: 0;
    }
    .ahp-content {
        padding: 20px 20px 40px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* Page hero */
    .ahp-page-hero {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 20px;
    }
    .ahp-page-title { font-size: 1.75rem; }
    .ahp-overview-date { font-size: .8rem; margin-top: 2px; }

    /* Stats grid: 2 col */
    .ahp-stat-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }
    .ahp-stat-card { padding: 20px 18px; }
    .ahp-stat-value { font-size: 2rem; }
    .ahp-stat-val   { font-size: 2rem; }

    /* Overview quick actions */
    .ahp-quick-actions { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* Documents */
    .ahp-doc-row { grid-template-columns: 36px 1fr auto; gap: 10px; }
    .ahp-doc-type-badge, .ahp-doc-date { display: none; }

    /* Invoices */
    .ahp-invoice-card-head,
    .ahp-invoice-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ahp-invoice-summary { grid-template-columns: 1fr; gap: 8px; }

    /* Projects */
    .ahp-project-cards { grid-template-columns: 1fr; }
    .ahp-pfc-related   { flex-direction: column; }

    /* Field rows */
    .ahp-field-row { grid-template-columns: 1fr; }

    /* Forms */
    .ahp-form-card { flex-wrap: wrap; gap: 12px; }
    .ahp-form-card-action { width: 100%; }
    .ahp-form-card-action a { width: 100%; justify-content: center; }
    .ahp-pf-check-group { grid-template-columns: 1fr; }
    .ahp-pf-nav {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
    }
    .ahp-pf-nav-left  { grid-column: 1; }
    .ahp-pf-nav-right { grid-column: 2; }
    .ahp-pf-nav-center { grid-column: 1 / -1; order: -1; justify-content: center; }
    .ahp-pf-save-btn { width: 100%; justify-content: center; }

    /* Schedule / booking */
    .ahp-booking-card {
        grid-template-columns: 44px 1fr;
        padding: 18px 16px;
        gap: 12px;
    }
    .ahp-booking-arrow { display: none; }
    .ahp-booking-deadline { align-items: flex-start; margin-top: 4px; grid-column: 2; }
    .ahp-form-deadline-card {
        grid-template-columns: 44px 1fr;
        padding: 16px;
        gap: 12px;
    }
    .ahp-fdc-due { grid-column: 2; text-align: left; }
    .ahp-booking-icon { width: 44px; height: 44px; }

    /* Messages */
    .ahp-msg-thread-list { max-height: none; }

    /* Section headings */
    .ahp-section-title { font-size: 1rem; }

    /* Profile tab */
    .ahp-profile-grid { grid-template-columns: 1fr; }

    /* Action items */
    .ahp-ai-card { padding: 14px; }
    .ahp-ai-complete-btn { width: 32px; height: 32px; }
}

/* Sidebar overlay backdrop */
.ahp-sidebar-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 190;
}
.ahp-sidebar-overlay.active { display: block; }

/* Smooth tab transitions */
.ahp-content > * { animation: ahp-in .2s ease; }
@keyframes ahp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ═══════════════════════════════════════════════════════════
   FORMS TAB
   ═══════════════════════════════════════════════════════════ */

/* ── Forms list ──────────────────────────────────────────── */
.ahp-forms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ahp-form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: border-color .2s, box-shadow .15s;
}
.ahp-form-card:hover { border-color: var(--gold-glow); box-shadow: var(--shadow); }
.ahp-form-card--done { border-left: 3px solid var(--green); }

.ahp-form-card-icon {
    font-size: 1.5rem;
    width: 48px; height: 48px;
    background: var(--cream-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--gold);
}

.ahp-form-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.ahp-form-card-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ahp-form-card-head h3 {
    font-family: var(--font-serif);
    font-size: 1rem; font-weight: 400; margin: 0;
}
.ahp-form-card-sub { font-size: .8rem; color: var(--muted); margin: 0; }

.ahp-form-prog-wrap {
    display: flex; align-items: center; gap: 10px;
}
.ahp-form-prog-wrap .ahp-progress-track { flex: 1; max-width: 180px; }
.ahp-form-prog-pct { font-size: .75rem; color: var(--muted); white-space: nowrap; }

.ahp-form-card-action { flex-shrink: 0; }

/* ── Portal form ─────────────────────────────────────────── */
.ahp-form-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--muted); text-decoration: none; font-size: .82rem;
    margin-bottom: 24px; transition: color .15s;
}
.ahp-form-back:hover { color: var(--black); }

.ahp-portal-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: visible; /* allow progress dots + autosave to breathe */
}
/* Keep header corners rounded even without overflow:hidden on wrapper */
.ahp-portal-form > .ahp-pf-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ahp-pf-header {
    display: flex; align-items: flex-start; gap: 18px;
    padding: 28px 32px;
    background: var(--black);
    color: var(--cream);
}
.ahp-pf-icon {
    font-size: 1.8rem; color: var(--gold);
    flex-shrink: 0; margin-top: 2px;
}
.ahp-pf-title {
    font-family: var(--font-serif);
    font-size: 1.4rem; font-weight: 400;
    color: var(--cream); margin: 0 0 4px;
}
.ahp-pf-subtitle { font-size: .875rem; color: rgba(245,241,232,.55); margin: 0; }

.ahp-pf-submitted-notice {
    margin: 20px 32px 0;
    padding: 12px 16px;
    background: rgba(39,174,96,.08);
    border: 1px solid rgba(39,174,96,.2);
    border-radius: var(--radius-sm);
    font-size: .875rem; color: #1a7a45;
}

/* Section */
.ahp-pf-section { padding: 28px 32px; }
.ahp-pf-section--hidden { display: none; }
.ahp-pf-section-head { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.ahp-pf-section-num {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .12em; color: var(--gold); display: block; margin-bottom: 6px;
}
.ahp-pf-section-title {
    font-family: var(--font-serif); font-size: 1.15rem; font-weight: 400; margin: 0 0 6px;
}
.ahp-pf-section-desc { font-size: .875rem; color: var(--muted); margin: 0; }

/* Fields */
.ahp-pf-fields { display: flex; flex-direction: column; gap: 22px; }
.ahp-pf-field { display: flex; flex-direction: column; gap: 8px; }
.ahp-pf-label {
    font-size: .8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--charcoal); line-height: 1.4;
}
.ahp-pf-req { color: var(--gold); margin-left: 3px; }

.ahp-pf-input {
    width: 100%; padding: 13px 16px;
    background: var(--cream);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans); font-size: .9rem;
    color: var(--black); transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.ahp-pf-input:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
    background: var(--white);
}
.ahp-pf-input[readonly], .ahp-pf-input[disabled] {
    background: var(--cream-dark); color: var(--muted); cursor: default;
}
.ahp-pf-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

/* Radio */
.ahp-pf-radio-group { display: flex; flex-direction: column; gap: 8px; }
.ahp-pf-radio-label {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--cream);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color .15s, background .15s;
    font-size: .875rem;
}
.ahp-pf-radio-label:hover { border-color: var(--gold); background: var(--white); }
.ahp-pf-radio-label input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.ahp-pf-radio-check {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    transition: border-color .15s;
}
.ahp-pf-radio-label:has(input:checked) {
    border-color: var(--gold);
    background: rgba(201,169,97,.07);
}
.ahp-pf-radio-label:has(input:checked) .ahp-pf-radio-check {
    border-color: var(--gold);
    background: var(--gold);
    box-shadow: inset 0 0 0 3px var(--white);
}
.ahp-pf-radio-label--readonly { cursor: default; }
.ahp-pf-radio-label--readonly:hover { border-color: var(--border-strong); background: var(--cream); }

/* Checkboxes */
.ahp-pf-check-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.ahp-pf-check-label {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--cream);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color .15s, background .15s;
    font-size: .84rem;
}
.ahp-pf-check-label:hover { border-color: var(--gold); background: var(--white); }
.ahp-pf-check-label input { position: absolute; opacity: 0; pointer-events: none; }
.ahp-pf-check-box {
    width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
    border: 2px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
}
.ahp-pf-check-label:has(input:checked) { border-color: var(--gold); background: rgba(201,169,97,.07); }
.ahp-pf-check-label:has(input:checked) .ahp-pf-check-box {
    background: var(--gold); border-color: var(--gold);
}
.ahp-pf-check-label:has(input:checked) .ahp-pf-check-box::after {
    content: ''; width: 5px; height: 9px;
    border: 2px solid var(--black); border-top: none; border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}
.ahp-pf-check-label--readonly { cursor: default; }

/* Tag input */
.ahp-pf-tag-wrap {
    min-height: 48px; padding: 8px 12px;
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--cream); display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center; cursor: text;
    transition: border-color .2s;
}
.ahp-pf-tag-wrap:focus-within { border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px var(--gold-dim); }
.ahp-pf-tag-wrap--readonly { cursor: default; }
.ahp-pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ahp-pf-tag {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--gold-dim); color: var(--black);
    border-radius: 20px; padding: 4px 10px;
    font-size: .78rem; font-weight: 600;
}
.ahp-pf-tag-x {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1rem; line-height: 1;
    padding: 0; display: flex;
}
.ahp-pf-tag-entry {
    border: none; outline: none; background: transparent;
    font-family: var(--font-sans); font-size: .875rem;
    color: var(--black); min-width: 140px; flex: 1;
}

/* Color picker */
.ahp-pf-color-row { display: flex; align-items: center; gap: 10px; }
.ahp-pf-color-native {
    width: 44px; height: 44px; border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm); cursor: pointer; padding: 2px;
    background: transparent;
}
.ahp-pf-color-text { max-width: 120px; font-family: monospace; }

/* File drop */
.ahp-pf-file-drop {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}
.ahp-pf-file-drop:hover, .ahp-pf-file-drop.drag-over {
    border-color: var(--gold); background: rgba(201,169,97,.04);
}
.ahp-pf-file-input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.ahp-pf-file-prompt { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.ahp-pf-file-prompt svg { opacity: .35; }
.ahp-pf-file-prompt span { font-size: .875rem; }
.ahp-pf-file-prompt strong { color: var(--gold); }
.ahp-pf-file-prompt small { font-size: .75rem; }
.ahp-pf-file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ahp-pf-file-item { display: flex; justify-content: space-between; font-size: .8rem; color: var(--charcoal); padding: 6px 10px; background: var(--cream-dark); border-radius: var(--radius-sm); }
.ahp-pf-file-submitted { display: flex; gap: 8px; flex-wrap: wrap; }

/* Navigation */
.ahp-pf-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.ahp-pf-nav-left  { display: flex; justify-content: flex-start; }
.ahp-pf-nav-center { display: flex; justify-content: center; }
.ahp-pf-nav-right { display: flex; justify-content: flex-end; }

/* Save Progress button */
.ahp-pf-save-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-family: var(--font-sans); font-size: .8rem; font-weight: 500;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
    white-space: nowrap;
}
.ahp-pf-save-btn svg { flex-shrink: 0; opacity: .7; }
.ahp-pf-save-btn:hover:not(:disabled) {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(201, 169, 97, .06);
}
.ahp-pf-save-btn.saving,
.ahp-pf-save-btn:disabled {
    opacity: .6; cursor: default;
}
.ahp-pf-save-btn.saving .btn-text { color: var(--gold); }

/* Progress dots */
.ahp-pf-progress {
    display: flex; justify-content: center; gap: 8px;
    padding: 20px 32px 8px;
}
.ahp-pf-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border-strong); border: none; cursor: pointer;
    transition: background .2s, transform .2s;
}
.ahp-pf-dot.active { background: var(--gold); transform: scale(1.3); cursor: default; }
.ahp-pf-dot.done   { background: var(--green); }

.ahp-pf-autosave {
    text-align: center; font-size: .75rem; color: var(--muted);
    padding: 6px 32px 24px; margin: 0;
}

/* Mobile forms responsive — see main @media (max-width: 768px) block */

/* Validation error state */
.ahp-pf-invalid,
.ahp-pf-invalid.ahp-pf-radio-group .ahp-pf-radio-label:first-child,
.ahp-pf-invalid.ahp-pf-check-group {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 2px rgba(192,57,43,.15) !important;
}

/* ═══════════════════════════════════════════════════════════
   v3.0 ADDITIONS & FIXES
   ═══════════════════════════════════════════════════════════ */

/* Fix: hide the WP page title that was peeking behind the sidebar */
.page-id-<?php echo (int)get_option('ahp_page_portal'); ?> .entry-title,
body.page-template-default .entry-title { display: none !important; }

/* Generic: hide common theme titles on portal page */
.ahp-main .ahp-page-hero ~ h1.entry-title,
.ahp-content ~ .entry-title { display: none; }

/* Sidebar tagline */
.ahp-sidebar-logo {
    padding: 28px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: 8px;
}
.ahp-sidebar-logo a {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--cream);
    font-family: var(--font-serif); font-size: 1rem; font-weight: 700;
    letter-spacing: .02em;
}
.ahp-sidebar-logo a:hover { color: var(--gold); }
.ahp-sidebar-tagline {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .2em;
    color: rgba(201,169,97,.5);
    margin-top: 5px;
    padding-left: 46px; /* aligns under brand name text, after 36px icon + 10px gap */
    display: block;
    line-height: 1;
}

/* Rich messages — admin bubbles support HTML */
.ahp-msg--admin .ahp-msg-bubble a { color: var(--gold); }
.ahp-msg--admin .ahp-msg-bubble strong { font-weight: 700; }
.ahp-msg--admin .ahp-msg-bubble em { font-style: italic; }
.ahp-msg--admin .ahp-msg-bubble u  { text-decoration: underline; }

/* Message: sender name + avatar row */
.ahp-msg-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ahp-msg-sender-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.ahp-msg--client .ahp-msg-sender-row { flex-direction: row-reverse; }
.ahp-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    background: var(--gold); color: var(--black);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700;
    font-family: var(--font-serif);
}
.ahp-msg-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ahp-msg-sender-name { font-size: .72rem; color: var(--muted); font-weight: 600; }
.ahp-msg-title-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--gold);
    margin-bottom: 3px;
}

/* Admin delete button in thread (client-side) */
.ahp-msg-delete {
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,.3); font-size: .75rem;
    padding: 0; margin-left: 6px; transition: color .15s;
    display: inline-block;
}
.ahp-msg-delete:hover { color: var(--red); }

/* Project logo in cards */
.ahp-project-card-logo {
    width: 100%; height: 60px;
    object-fit: contain; object-position: left center;
    margin-bottom: 4px;
}
.ahp-pfc-logo {
    width: 56px; height: 56px;
    object-fit: contain; border-radius: 8px;
    border: 1px solid var(--border); flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   SCHEDULE TAB — Redesigned v4.0
   ═══════════════════════════════════════════════════════════ */

/* Hero header for schedule */
.ahp-schedule-hero {
    margin-bottom: 40px;
}
.ahp-schedule-hero h1 {
    font-family: var(--font-serif);
    font-size: 2rem; font-weight: 400; line-height: 1.1;
    margin-bottom: 6px;
}
.ahp-schedule-hero p { color: var(--muted); font-size: .9rem; }

/* Booking grid layout */
.ahp-booking-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Card */
.ahp-booking-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    text-decoration: none;
    color: var(--black);
    transition: border-color .25s, box-shadow .25s, transform .2s;
    position: relative;
    overflow: hidden;
}
.ahp-booking-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gold);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform .25s var(--ease);
    border-radius: 0 2px 2px 0;
}
.ahp-booking-card:hover {
    border-color: rgba(201,169,97,.4);
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    transform: translateY(-2px);
    color: var(--black);
}
.ahp-booking-card:hover::before { transform: scaleY(1); }

/* Icon */
.ahp-booking-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    background: var(--cream-dark);
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.ahp-booking-card:hover .ahp-booking-icon {
    background: rgba(201,169,97,.15);
}

/* Body */
.ahp-booking-body { min-width: 0; }
.ahp-booking-body h3 {
    font-family: var(--font-serif);
    font-size: 1.05rem; font-weight: 400;
    margin: 0 0 4px; line-height: 1.2;
}
.ahp-booking-desc {
    font-size: .8rem; color: var(--muted); margin: 0;
    line-height: 1.5;
}

/* Deadline badge */
.ahp-booking-deadline {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 4px; flex-shrink: 0;
}
.ahp-deadline-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--muted);
}
.ahp-deadline-date {
    font-size: .8rem; font-weight: 600; color: var(--charcoal);
    white-space: nowrap;
}
.ahp-deadline-date--urgent { color: var(--red); }
.ahp-deadline-date--soon   { color: #b45309; }

/* CTA arrow */
.ahp-booking-arrow {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--cream-dark);
    color: var(--muted);
    flex-shrink: 0;
    transition: background .2s, color .2s, transform .2s;
}
.ahp-booking-card:hover .ahp-booking-arrow {
    background: var(--gold);
    color: var(--black);
    transform: translateX(2px);
}

/* Action items section on schedule */
.ahp-schedule-section-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .12em; color: var(--muted);
    margin: 0 0 14px; padding: 0;
}

/* Form deadline card */
.ahp-form-deadline-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    text-decoration: none;
    color: var(--black);
    transition: box-shadow .2s;
}
.ahp-form-deadline-card:hover { box-shadow: var(--shadow); color: var(--black); }
.ahp-form-deadline-card--urgent { border-left-color: var(--red); }
.ahp-fdc-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    background: rgba(201,169,97,.1);
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ahp-form-deadline-card--urgent .ahp-fdc-icon {
    background: rgba(192,57,43,.07);
    color: var(--red);
}
.ahp-fdc-body h4 {
    font-family: var(--font-serif);
    font-size: .95rem; font-weight: 400;
    margin: 0 0 3px;
}
.ahp-fdc-sub { font-size: .78rem; color: var(--muted); margin: 0; }
.ahp-fdc-due {
    text-align: right; flex-shrink: 0;
}
.ahp-fdc-due-label {
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--muted); display: block; margin-bottom: 2px;
}
.ahp-fdc-due-date {
    font-size: .82rem; font-weight: 700; color: var(--charcoal);
    white-space: nowrap;
}
.ahp-fdc-due-date--urgent { color: var(--red); }

/* Mobile schedule — handled in main @media block above */

/* Validation error */
.ahp-pf-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(192,57,43,.15) !important; }

/* Forms tab CSS (keep from previous) */
.ahp-forms-list { display: flex; flex-direction: column; gap: 12px; }
.ahp-form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; align-items: center; gap: 18px; transition: border-color .2s, box-shadow .15s; }
.ahp-form-card:hover { border-color: var(--gold-glow); box-shadow: var(--shadow); }
.ahp-form-card--done { border-left: 3px solid var(--green); }
.ahp-form-card-icon { font-size: 1.5rem; width: 48px; height: 48px; background: var(--cream-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--gold); }
.ahp-form-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ahp-form-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ahp-form-card-head h3 { font-family: var(--font-serif); font-size: 1rem; font-weight: 400; margin: 0; }
.ahp-form-card-sub { font-size: .8rem; color: var(--muted); margin: 0; }
.ahp-form-prog-wrap { display: flex; align-items: center; gap: 10px; }
.ahp-form-prog-wrap .ahp-progress-track { flex: 1; max-width: 180px; }
.ahp-form-prog-pct { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.ahp-form-card-action { flex-shrink: 0; }
.ahp-form-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .82rem; margin-bottom: 24px; transition: color .15s; }
.ahp-form-back:hover { color: var(--black); }
.ahp-portal-form { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: visible; }
.ahp-pf-header { display: flex; align-items: flex-start; gap: 18px; padding: 28px 32px; background: var(--black); color: var(--cream); }
.ahp-pf-icon { font-size: 1.8rem; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.ahp-pf-title { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 400; color: var(--cream); margin: 0 0 4px; }
.ahp-pf-subtitle { font-size: .875rem; color: rgba(245,241,232,.55); margin: 0; }
.ahp-pf-submitted-notice { margin: 20px 32px 0; padding: 12px 16px; background: rgba(39,174,96,.08); border: 1px solid rgba(39,174,96,.2); border-radius: var(--radius-sm); font-size: .875rem; color: #1a7a45; }
.ahp-pf-section { padding: 28px 32px; }
.ahp-pf-section--hidden { display: none; }
.ahp-pf-section-head { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.ahp-pf-section-num { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); display: block; margin-bottom: 6px; }
.ahp-pf-section-title { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 400; margin: 0 0 6px; }
.ahp-pf-section-desc { font-size: .875rem; color: var(--muted); margin: 0; }
.ahp-pf-fields { display: flex; flex-direction: column; gap: 22px; }
.ahp-pf-field { display: flex; flex-direction: column; gap: 8px; }
.ahp-pf-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--charcoal); line-height: 1.4; }
.ahp-pf-req { color: var(--gold); margin-left: 3px; }
.ahp-pf-input { width: 100%; padding: 13px 16px; background: var(--cream); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: .9rem; color: var(--black); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; }
.ahp-pf-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); background: var(--white); }
.ahp-pf-input[readonly], .ahp-pf-input[disabled] { background: var(--cream-dark); color: var(--muted); cursor: default; }
.ahp-pf-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.ahp-pf-radio-group { display: flex; flex-direction: column; gap: 8px; }
.ahp-pf-radio-label { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--cream); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; font-size: .875rem; }
.ahp-pf-radio-label:hover { border-color: var(--gold); background: var(--white); }
.ahp-pf-radio-label input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.ahp-pf-radio-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color .15s; }
.ahp-pf-radio-label:has(input:checked) { border-color: var(--gold); background: rgba(201,169,97,.07); }
.ahp-pf-radio-label:has(input:checked) .ahp-pf-radio-check { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 3px var(--white); }
.ahp-pf-radio-label--readonly { cursor: default; }
.ahp-pf-check-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ahp-pf-check-label { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--cream); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; font-size: .84rem; }
.ahp-pf-check-label:hover { border-color: var(--gold); background: var(--white); }
.ahp-pf-check-label input { position: absolute; opacity: 0; pointer-events: none; }
.ahp-pf-check-box { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; }
.ahp-pf-check-label:has(input:checked) { border-color: var(--gold); background: rgba(201,169,97,.07); }
.ahp-pf-check-label:has(input:checked) .ahp-pf-check-box { background: var(--gold); border-color: var(--gold); }
.ahp-pf-check-label:has(input:checked) .ahp-pf-check-box::after { content: ''; width: 5px; height: 9px; border: 2px solid var(--black); border-top: none; border-left: none; transform: rotate(45deg) translate(-1px,-1px); }
.ahp-pf-tag-wrap { min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--cream); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; cursor: text; transition: border-color .2s; }
.ahp-pf-tag-wrap:focus-within { border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px var(--gold-dim); }
.ahp-pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ahp-pf-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--gold-dim); color: var(--black); border-radius: 20px; padding: 4px 10px; font-size: .78rem; font-weight: 600; }
.ahp-pf-tag-x { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0; display: flex; }
.ahp-pf-tag-entry { border: none; outline: none; background: transparent; font-family: var(--font-sans); font-size: .875rem; color: var(--black); min-width: 140px; flex: 1; }
.ahp-pf-color-row { display: flex; align-items: center; gap: 10px; }
.ahp-pf-color-native { width: 44px; height: 44px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; background: transparent; }
.ahp-pf-color-text { max-width: 120px; font-family: monospace; }
.ahp-pf-file-drop { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.ahp-pf-file-drop:hover, .ahp-pf-file-drop.drag-over { border-color: var(--gold); background: rgba(201,169,97,.04); }
.ahp-pf-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ahp-pf-file-prompt { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.ahp-pf-file-prompt svg { opacity: .35; }
.ahp-pf-file-prompt strong { color: var(--gold); }
.ahp-pf-file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ahp-pf-file-item { display: flex; justify-content: space-between; font-size: .8rem; color: var(--charcoal); padding: 6px 10px; background: var(--cream-dark); border-radius: var(--radius-sm); }
.ahp-pf-file-submitted { display: flex; gap: 8px; flex-wrap: wrap; }
.ahp-pf-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.ahp-pf-progress { display: flex; justify-content: center; gap: 8px; padding: 20px 32px 8px; }
.ahp-pf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); border: none; cursor: pointer; transition: background .2s, transform .2s; }
.ahp-pf-dot.active { background: var(--gold); transform: scale(1.3); cursor: default; }
.ahp-pf-dot.done { background: var(--green); }
.ahp-pf-autosave { text-align: center; font-size: .75rem; color: var(--muted); padding: 8px 32px 20px; margin: 0; }

/* Mobile forms — handled in main @media block above */

/* ═══════════════════════════════════════════════════════════
   FIX: Page title / "Client Portal" text bleeding behind sidebar
   This hides ANY text the WordPress theme injects before the
   .ahp-portal wrapper on wide screens.
   ═══════════════════════════════════════════════════════════ */

/* Hide WP theme-injected titles inside the portal wrapper */
.ahp-portal .entry-title,
.ahp-portal .page-title,
.ahp-portal h1.entry-title,
.ahp-portal .wp-block-post-title { display: none !important; }

/* Hide title elements that appear OUTSIDE the portal wrapper
   but inside the same page content area — covers most themes */
.page-template-default .entry-header,
.page-template-default .entry-title,
body:has(.ahp-portal) .site-main > article > .entry-header,
body:has(.ahp-portal) .site-main > article > header { display: none !important; }

/* Prevent any overflow from leaking around the fixed sidebar */
body:has(.ahp-portal) {
    overflow-x: hidden;
}
.ahp-portal {
    position: relative;
    overflow-x: hidden;
}

/* Topbar mobile brand — clean up duplicate "Client Portal" label */
.ahp-topbar-brand span.ahp-topbar-tagline { display: none; }

/* ═══════════════════════════════════════════════════════════
   FIX: Remove the dead space above the portal on mobile.
   WordPress themes inject page padding, hero areas, and
   breadcrumbs above the content area. Strip them all out
   when the portal or auth pages are present.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Zero out padding/margin on every common WP wrapper */
    body:has(.ahp-portal) .site-main,
    body:has(.ahp-portal) .site-content,
    body:has(.ahp-portal) #content,
    body:has(.ahp-portal) #primary,
    body:has(.ahp-portal) .entry-content,
    body:has(.ahp-portal) .page-content,
    body:has(.ahp-portal) article.page,
    body:has(.ahp-portal) .wp-block-post-content,
    body:has(.ahp-fullscreen) .site-main,
    body:has(.ahp-fullscreen) .site-content,
    body:has(.ahp-fullscreen) #content,
    body:has(.ahp-fullscreen) #primary,
    body:has(.ahp-fullscreen) .entry-content,
    body:has(.ahp-fullscreen) .page-content,
    body:has(.ahp-fullscreen) article.page,
    body:has(.ahp-fullscreen) .wp-block-post-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Hide theme hero / page-header areas entirely */
    body:has(.ahp-portal) .page-header,
    body:has(.ahp-portal) .hero-section,
    body:has(.ahp-portal) .entry-header,
    body:has(.ahp-portal) .wp-block-template-part[data-slug="header"],
    body:has(.ahp-fullscreen) .page-header,
    body:has(.ahp-fullscreen) .hero-section,
    body:has(.ahp-fullscreen) .entry-header {
        display: none !important;
    }

    /* Also remove top padding from body itself if the theme adds it for the admin bar */
    body:has(.ahp-portal):not(.admin-bar),
    body:has(.ahp-fullscreen):not(.admin-bar) {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   DRIVE TAB
   ═══════════════════════════════════════════════════════════════════════ */

/* Email cards ---------------------------------------------------------- */
.ahp-drive-email-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.ahp-drive-email-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: border-color .15s;
}
.ahp-drive-email-card:hover { border-color: var(--border-strong); }
.ahp-drive-email-card__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--gold-dim);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}
.ahp-drive-email-card__addr {
    flex: 1;
    font-size: .875rem;
    font-weight: 600;
    color: var(--black-soft);
    word-break: break-all;
}

/* Info hint ------------------------------------------------------------ */
.ahp-drive-hint {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    font-size: .8rem;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.5;
}
.ahp-drive-hint svg { flex-shrink: 0; color: var(--gold); margin-top: 1px; }

/* Steps ---------------------------------------------------------------- */
.ahp-drive-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ahp-drive-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.ahp-drive-step:last-child { border-bottom: none; padding-bottom: 0; }
.ahp-drive-step__badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 1px solid rgba(201,169,97,.3);
    color: var(--gold);
    font-size: .75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.ahp-drive-step__body { flex: 1; }
.ahp-drive-step__body strong {
    display: block;
    font-size: .875rem;
    font-weight: 700;
    color: var(--black-soft);
    margin-bottom: 3px;
}
.ahp-drive-step__body p {
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}
.ahp-drive-step__body a  { color: var(--gold); text-decoration: underline; }
.ahp-drive-step__body strong + strong { color: var(--black-soft); }

/* CTA button ----------------------------------------------------------- */
.ahp-drive-cta-btn {
    width: auto;
    display: inline-flex;
}

/* ═══════════════════════════════════════════════════════════════
   ACTION ITEMS
   ═══════════════════════════════════════════════════════════════ */
.ahp-action-items-section {
    margin-bottom: 32px;
}
.ahp-action-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ahp-ai-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: opacity .25s, transform .25s;
}
.ahp-ai-card--overdue {
    border-color: rgba(192,57,43,.35);
    background: rgba(192,57,43,.03);
}
.ahp-ai-card--soon {
    border-color: rgba(201,169,97,.5);
    background: rgba(201,169,97,.04);
}
.ahp-ai-card--completing {
    opacity: .5;
    transform: scale(.98);
}
.ahp-ai-complete-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s, color .15s;
    margin-top: 1px;
}
.ahp-ai-complete-btn:hover {
    border-color: #27ae60;
    background: rgba(39,174,96,.1);
    color: #27ae60;
}
.ahp-ai-body {
    flex: 1;
    min-width: 0;
}
.ahp-ai-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--black-soft);
    line-height: 1.4;
}
.ahp-ai-desc {
    font-size: .82rem;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.55;
}
.ahp-ai-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    color: var(--muted);
    margin-top: 6px;
    font-weight: 500;
}
.ahp-ai-due--overdue {
    color: #c0392b;
    font-weight: 700;
}
.ahp-ai-due--soon {
    color: #b45309;
    font-weight: 600;
}
/* Action item — link and attachments */
.ahp-ai-link {
    margin-top: 8px;
}
.ahp-ai-link a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ahp-gold, #c9a84c);
    text-decoration: none;
    font-weight: 500;
    transition: opacity .15s;
}
.ahp-ai-link a:hover { opacity: .75; }

.ahp-ai-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.ahp-ai-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    background: var(--ahp-surface-2, #f5f0e8);
    border: 1px solid var(--ahp-border, #e2ddd6);
    border-radius: 4px;
    color: var(--ahp-text-muted, #666);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.ahp-ai-attachment:hover {
    background: var(--ahp-border, #e2ddd6);
    color: var(--ahp-text, #1a1a1a);
}

