/*
 * TPDG Coach Portal — Phase 1 stylesheet.
 *
 * Brand palette:
 *   --tpdg-navy: #0F2A44 (primary)
 *   --tpdg-gold: #B08D3F (accent)
 *   --tpdg-stone: #5C5A55 (muted text)
 *   --tpdg-cream: #F0EBDC (panel bg)
 *   --tpdg-warm: #FBF7EE (page bg)
 *   --tpdg-rule: #DDD6C5 (borders)
 *   --tpdg-red:  #8B2E2E (errors)
 *
 * Mobile-first: design starts at narrow viewport, expands at breakpoints.
 *
 * Defensive: prefixed with .tpdg-cp wherever possible so styles don't
 * leak into the rest of the site or get overridden by theme rules.
 */

.tpdg-cp {
    --tpdg-navy: #0F2A44;
    --tpdg-gold: #B08D3F;
    --tpdg-stone: #5C5A55;
    --tpdg-cream: #F0EBDC;
    --tpdg-warm: #FBF7EE;
    --tpdg-rule: #DDD6C5;
    --tpdg-red: #8B2E2E;
    --tpdg-shadow: 0 1px 3px rgba(15, 42, 68, 0.06), 0 2px 8px rgba(15, 42, 68, 0.04);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Manrope, Arial, sans-serif;
    color: #1A1A1A;
    background: var(--tpdg-warm);
    min-height: 100vh;
    width: 100%;
}

/* Full-width wrapper injected by our custom page template — strips theme's
   .post-content constraint. When the theme renders the portal in its
   default page.php (fallback for some setups), the wrapper falls back
   to display:contents so existing layout still works. */
.tpdg-cp-fullwidth {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--tpdg-warm, #FBF7EE);
}

/* Defensive: if the theme's .post-content wrapper IS still present (e.g.
   the template_include filter was bypassed), break out of it with full-width
   styling. body class .tpdg-coach-portal-page is added by our body_class filter. */
body.tpdg-coach-portal-page .post-content,
body.tpdg-coach-portal-page article,
body.tpdg-coach-portal-page .post-hero,
body.tpdg-fullwidth .post-content,
body.tpdg-fullwidth article {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
body.tpdg-coach-portal-page .post-hero { display: none !important; }
body.tpdg-coach-portal-page main,
body.tpdg-coach-portal-page #main,
body.tpdg-coach-portal-page #content,
body.tpdg-coach-portal-page .site-main,
body.tpdg-coach-portal-page .entry-content {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* If the theme wraps the shortcode in a constrained container, undo it */
.tpdg-cp * {
    box-sizing: border-box;
}

/* Defensive: kill drop-cap selectors that might leak from the theme */
.tpdg-cp *::first-letter {
    font-size: inherit !important;
    color: inherit !important;
    font-weight: inherit !important;
    float: none !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* =====================================================================
   Header
   ===================================================================== */

.tpdg-cp__header {
    background: var(--tpdg-navy);
    color: #fff;
    border-bottom: 3px solid var(--tpdg-gold);
}

.tpdg-cp__header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tpdg-cp__brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #fff;
    line-height: 1.1;
}

.tpdg-cp__brand-mark {
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tpdg-cp__brand-sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--tpdg-gold);
    margin-top: 2px;
}

.tpdg-cp__header-right {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.tpdg-cp__scope {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tpdg-cp__scope-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background 0.1s;
}

.tpdg-cp__scope-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.tpdg-cp__scope-link.is-active {
    color: var(--tpdg-gold);
    font-weight: 600;
}

.tpdg-cp__scope-divider {
    color: rgba(255,255,255,0.3);
}

.tpdg-cp__user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.tpdg-cp__user-name {
    color: rgba(255,255,255,0.9);
}

.tpdg-cp__user-logout {
    color: var(--tpdg-gold);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--tpdg-gold);
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.1s, color 0.1s;
}

.tpdg-cp__user-logout:hover {
    background: var(--tpdg-gold);
    color: var(--tpdg-navy);
}

/* =====================================================================
   Navigation
   ===================================================================== */

.tpdg-cp__nav {
    background: #fff;
    border-bottom: 1px solid var(--tpdg-rule);
    box-shadow: var(--tpdg-shadow);
}

.tpdg-cp__nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tpdg-cp__nav-link {
    color: var(--tpdg-stone);
    text-decoration: none;
    padding: 14px 14px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.1s, border-color 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tpdg-cp__nav-link:hover {
    color: var(--tpdg-navy);
}

.tpdg-cp__nav-link.is-active {
    color: var(--tpdg-navy);
    border-bottom-color: var(--tpdg-gold);
    font-weight: 600;
}

/* =====================================================================
   Main content
   ===================================================================== */

.tpdg-cp__main {
    padding: 32px 0 64px;
}

.tpdg-cp__main-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =====================================================================
   Panels & cards
   ===================================================================== */

.tpdg-cp__panel {
    background: #fff;
    border-radius: 6px;
    padding: 32px;
    box-shadow: var(--tpdg-shadow);
    margin-bottom: 24px;
}

.tpdg-cp__panel--error {
    background: #FAEFEF;
    border-left: 3px solid var(--tpdg-red);
    color: var(--tpdg-red);
}

.tpdg-cp__panel-head {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tpdg-rule);
}

.tpdg-cp__panel-title {
    font-family: Georgia, serif;
    color: var(--tpdg-navy);
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 4px;
}

.tpdg-cp__panel-lede {
    font-size: 15px;
    color: var(--tpdg-stone);
    margin: 0;
}

.tpdg-cp__grid {
    display: grid;
    gap: 20px;
}

.tpdg-cp__grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.tpdg-cp__card {
    background: #fff;
    border: 1px solid var(--tpdg-rule);
    border-radius: 6px;
    padding: 24px;
}

.tpdg-cp__card--placeholder {
    background: var(--tpdg-cream);
    border: 1px dashed var(--tpdg-rule);
}

.tpdg-cp__card-title {
    font-family: Georgia, serif;
    color: var(--tpdg-navy);
    font-size: 18px;
    margin: 0 0 12px;
    font-weight: 700;
}

.tpdg-cp__card-body {
    font-size: 14px;
    line-height: 1.55;
    color: var(--tpdg-stone);
    margin: 0 0 12px;
}

.tpdg-cp__card-body:last-child {
    margin-bottom: 0;
}

.tpdg-cp__link {
    color: var(--tpdg-gold);
    text-decoration: none;
    font-weight: 600;
}

.tpdg-cp__link:hover {
    text-decoration: underline;
}

.tpdg-cp__note {
    margin: 24px 0 0;
    padding: 16px 18px;
    background: var(--tpdg-cream);
    border-left: 3px solid var(--tpdg-gold);
    font-size: 13px;
    color: var(--tpdg-stone);
    line-height: 1.55;
}

.tpdg-cp__note strong {
    color: var(--tpdg-navy);
}

.tpdg-cp__deflist {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    font-size: 14px;
    margin: 0 0 16px;
}

.tpdg-cp__deflist dt {
    color: var(--tpdg-stone);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    padding-top: 1px;
}

.tpdg-cp__deflist dd {
    color: #1A1A1A;
    margin: 0;
}

/* =====================================================================
   Footer
   ===================================================================== */

.tpdg-cp__footer {
    border-top: 1px solid var(--tpdg-rule);
    background: #fff;
}

.tpdg-cp__footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    font-size: 12px;
    color: var(--tpdg-stone);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tpdg-cp__footer-divider {
    color: var(--tpdg-rule);
}

.tpdg-cp__footer-link {
    color: var(--tpdg-stone);
    text-decoration: none;
}

.tpdg-cp__footer-link:hover {
    color: var(--tpdg-navy);
}

.tpdg-cp__footer-version {
    color: var(--tpdg-stone);
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Gate (access denied / sign-in required)
   ===================================================================== */

.tpdg-cp-gate {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--tpdg-warm);
    width: 100%;
}

.tpdg-cp-gate__inner {
    max-width: 480px;
    background: #fff;
    padding: 40px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(15, 42, 68, 0.08);
    text-align: center;
}

.tpdg-cp-gate__title {
    font-family: Georgia, serif;
    color: var(--tpdg-navy);
    font-size: 24px;
    margin: 0 0 12px;
}

.tpdg-cp-gate__lede {
    font-size: 14px;
    color: var(--tpdg-stone);
    line-height: 1.55;
    margin: 0 0 24px;
}

.tpdg-cp-gate__btn {
    display: inline-block;
    background: var(--tpdg-navy);
    color: #fff;
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.1s;
}

.tpdg-cp-gate__btn:hover {
    background: #1a3d5e;
    color: #fff;
}

.tpdg-cp-gate__btn--secondary {
    background: transparent;
    color: var(--tpdg-stone);
    border: 1px solid var(--tpdg-rule);
}

.tpdg-cp-gate__btn--secondary:hover {
    background: var(--tpdg-cream);
    color: var(--tpdg-navy);
}

/* =====================================================================
   Mobile breakpoints
   ===================================================================== */

@media (max-width: 900px) {
    .tpdg-cp__grid--3 {
        grid-template-columns: 1fr;
    }
    .tpdg-cp__panel {
        padding: 24px 20px;
    }
    .tpdg-cp__deflist {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
    .tpdg-cp__deflist dd {
        margin-bottom: 10px;
    }
}

@media (max-width: 640px) {
    .tpdg-cp__header-inner {
        padding: 12px 16px;
    }
    .tpdg-cp__header-right {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }
    .tpdg-cp__nav-inner {
        padding: 0 16px;
    }
    .tpdg-cp__nav-link {
        padding: 12px 12px;
        font-size: 13px;
    }
    .tpdg-cp__main {
        padding: 20px 0 40px;
    }
    .tpdg-cp__main-inner {
        padding: 0 16px;
    }
    .tpdg-cp__panel {
        padding: 20px 16px;
    }
    .tpdg-cp__panel-title {
        font-size: 22px;
    }
}

/* =====================================================================
   Phase 2 additions
   ===================================================================== */

/* Stat strip on dashboard */
.tpdg-cp__statgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.tpdg-cp__stat {
    background: var(--tpdg-cream);
    border-left: 3px solid var(--tpdg-gold);
    padding: 14px 18px;
    border-radius: 4px;
}
.tpdg-cp__stat-num {
    display: block;
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--tpdg-navy);
    line-height: 1;
    margin-bottom: 4px;
}
.tpdg-cp__stat-label {
    font-size: 12px;
    color: var(--tpdg-stone);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Grid 2-col */
.tpdg-cp__grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Card with head row (title + link) */
.tpdg-cp__card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tpdg-rule);
    gap: 12px;
}
.tpdg-cp__card-head .tpdg-cp__card-title {
    margin-bottom: 0;
}
.tpdg-cp__card-link {
    font-size: 13px;
    white-space: nowrap;
}

/* List rows (used in cards + standalone) */
.tpdg-cp__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tpdg-cp__list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tpdg-rule);
}
.tpdg-cp__list-row:last-child { border-bottom: none; }
.tpdg-cp__list-main {
    flex: 1;
    min-width: 0;
}
.tpdg-cp__list-title {
    display: block;
    font-weight: 600;
    color: var(--tpdg-navy);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tpdg-cp__list-title:hover { color: var(--tpdg-gold); }
.tpdg-cp__list-sub {
    display: block;
    font-size: 13px;
    color: var(--tpdg-stone);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tpdg-cp__list-extra {
    display: block;
    font-size: 12px;
    color: var(--tpdg-stone);
    margin-top: 4px;
}
.tpdg-cp__list-meta {
    font-size: 13px;
    color: var(--tpdg-stone);
    text-decoration: none;
    white-space: nowrap;
}
.tpdg-cp__list-meta:hover { color: var(--tpdg-navy); }
.tpdg-cp__list--cards .tpdg-cp__list-row {
    background: #fff;
    border: 1px solid var(--tpdg-rule);
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 10px;
}
.tpdg-cp__list--cards .tpdg-cp__list-row:last-child { margin-bottom: 0; }

/* Empty state */
.tpdg-cp__empty {
    padding: 24px 0;
    color: var(--tpdg-stone);
    font-style: italic;
    text-align: center;
}

/* CTA banner */
.tpdg-cp__cta {
    margin-top: 24px;
    padding: 20px 24px;
    background: var(--tpdg-navy);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.tpdg-cp__cta-text { flex: 1; min-width: 240px; }
.tpdg-cp__cta-title {
    font-family: Georgia, serif;
    font-size: 18px;
    margin: 0 0 4px;
    color: #fff;
}
.tpdg-cp__cta-body {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

/* Buttons */
.tpdg-cp__btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
    font-family: inherit;
}
.tpdg-cp__btn--primary {
    background: var(--tpdg-gold);
    color: var(--tpdg-navy);
}
.tpdg-cp__btn--primary:hover { background: #c9a04d; }
.tpdg-cp__btn--secondary {
    background: transparent;
    color: var(--tpdg-navy);
    border: 1px solid var(--tpdg-rule);
}
.tpdg-cp__btn--secondary:hover {
    background: var(--tpdg-cream);
    border-color: var(--tpdg-gold);
}

/* Search bar (used in Clients list) */
.tpdg-cp__searchbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}
.tpdg-cp__searchbar-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--tpdg-rule);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.tpdg-cp__searchbar-input:focus {
    outline: none;
    border-color: var(--tpdg-gold);
    box-shadow: 0 0 0 3px rgba(176, 141, 63, 0.15);
}

/* Filter bar (Invitations, Submissions) */
.tpdg-cp__filterbar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}
.tpdg-cp__filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tpdg-cp__filter-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--tpdg-stone);
    font-weight: 600;
}
.tpdg-cp__filter select {
    padding: 8px 10px;
    border: 1px solid var(--tpdg-rule);
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    min-width: 160px;
}

/* Tables — defensive: theme styles often override td padding and align */
.tpdg-cp__tablewrap {
    overflow-x: auto;
    margin: 0;
    padding: 0;
}
.tpdg-cp__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto;
    background: #fff;
}
.tpdg-cp__table th,
.tpdg-cp__table td {
    text-align: left;
    vertical-align: middle;
    line-height: 1.45;
    border-bottom: 1px solid var(--tpdg-rule) !important;
}
.tpdg-cp__table th {
    padding: 10px 14px !important;
    background: var(--tpdg-cream) !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--tpdg-stone) !important;
    font-weight: 600;
    white-space: nowrap;
}
.tpdg-cp__table td {
    padding: 12px 14px !important;
    color: #1A1A1A !important;
    background: #fff !important;
}
.tpdg-cp__table tr:last-child td { border-bottom: none !important; }
.tpdg-cp__table tr:hover td { background: var(--tpdg-warm) !important; }
.tpdg-cp__table-actions {
    text-align: right !important;
    white-space: nowrap;
    min-width: 140px;
}
/* Make the Sent / Coach columns hold their width so "Ken Wootton" doesn't collide with "38 minutes ago" */
.tpdg-cp__table td:nth-child(4) { white-space: nowrap; min-width: 110px; }
.tpdg-cp__table td:nth-child(5) { white-space: nowrap; min-width: 130px; }

/* Badges */
.tpdg-cp__badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tpdg-cp__badge--neutral { background: #E8E5DA; color: #5C5A55; }
.tpdg-cp__badge--success { background: #E0F0E0; color: #2A5A2D; }
.tpdg-cp__badge--warn    { background: #FAF1D7; color: #8A6A12; }
.tpdg-cp__badge--danger  { background: #FAEFEF; color: var(--tpdg-red); }

/* Forms */
.tpdg-cp__form {
    max-width: 600px;
}
.tpdg-cp__form-row {
    margin-bottom: 18px;
}
.tpdg-cp__form-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--tpdg-navy);
    font-weight: 600;
    margin-bottom: 6px;
}
.tpdg-cp__form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tpdg-rule);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    line-height: 1.4;
}
.tpdg-cp__form-input:focus {
    outline: none;
    border-color: var(--tpdg-gold);
    box-shadow: 0 0 0 3px rgba(176, 141, 63, 0.15);
}
.tpdg-cp__form-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--tpdg-rule);
}
.tpdg-cp__form-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--tpdg-stone);
    line-height: 1.5;
}

/* Flash banners */
.tpdg-cp__flash {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.55;
}
.tpdg-cp__flash--success {
    background: #E8F5E9;
    border-left: 3px solid #2A5A2D;
    color: #1B3F1D;
}
.tpdg-cp__flash--error {
    background: #FAEFEF;
    border-left: 3px solid var(--tpdg-red);
    color: var(--tpdg-red);
}
.tpdg-cp__flash--warning {
    background: #FBF3E2;
    border-left: 3px solid var(--tpdg-gold);
    color: #6A4E15;
}

/* Resources tab — library checklist */
.tpdg-cp__checklist {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--tpdg-rule);
    border-radius: 4px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
}
.tpdg-cp__check {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--tpdg-rule);
}
.tpdg-cp__check:last-child { border-bottom: 0; }
.tpdg-cp__check:hover { background: var(--tpdg-warm); }
.tpdg-cp__check input { margin: 0; flex: 0 0 auto; }
.tpdg-cp__check-title { flex: 1 1 auto; font-size: 14px; color: #1A1A1A; }
.tpdg-cp__check-type {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--tpdg-stone);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Breadcrumb */
.tpdg-cp__breadcrumb {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--tpdg-stone);
}

/* Smaller panel title for sub-sections */
.tpdg-cp__panel-title--small {
    font-size: 20px;
}

/* Timeline (client detail tool history) */
.tpdg-cp__timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tpdg-cp__timeline-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tpdg-rule);
}
.tpdg-cp__timeline-row:last-child { border-bottom: none; }
.tpdg-cp__timeline-main { flex: 1; min-width: 0; }
.tpdg-cp__timeline-title {
    display: block;
    font-weight: 600;
    color: var(--tpdg-navy);
    font-size: 14px;
}
.tpdg-cp__timeline-sub {
    display: block;
    font-size: 12px;
    color: var(--tpdg-stone);
}
.tpdg-cp__timeline-when {
    font-size: 12px;
    color: var(--tpdg-stone);
    white-space: nowrap;
}

/* Link variants */
.tpdg-cp__link--danger { color: var(--tpdg-red) !important; }
.tpdg-cp__link--danger:hover { color: #6B1F1F !important; }

/* Misc */
.tpdg-cp__mono {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
}
.tpdg-cp__muted { color: var(--tpdg-stone); }

/* Mobile breakpoint overrides */
@media (max-width: 900px) {
    .tpdg-cp__statgrid { grid-template-columns: 1fr; }
    .tpdg-cp__grid--2 { grid-template-columns: 1fr; }
    .tpdg-cp__cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .tpdg-cp__filterbar { gap: 12px; }
    .tpdg-cp__filter select { min-width: 120px; }
    .tpdg-cp__table th,
    .tpdg-cp__table td { padding: 8px 10px; font-size: 13px; }
}

/* =====================================================================
   Beta.2 — Settings tab name prominence + search bar border
   ===================================================================== */

.tpdg-cp__settings-name {
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--tpdg-navy);
    margin: 0 0 4px;
    line-height: 1.2;
}

.tpdg-cp__settings-role {
    color: var(--tpdg-gold);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin: 0 0 20px;
}

.tpdg-cp__deflist--secondary {
    grid-template-columns: 100px 1fr;
    margin-top: 8px;
}
.tpdg-cp__deflist--secondary dt {
    font-size: 10px;
}
.tpdg-cp__deflist--secondary dd {
    font-size: 13px;
    color: var(--tpdg-stone);
}

/* Bolder search bar border — was too faint */
.tpdg-cp__searchbar-input {
    border: 1.5px solid var(--tpdg-navy) !important;
    background: #fff;
}
.tpdg-cp__searchbar-input:focus {
    border-color: var(--tpdg-gold) !important;
    box-shadow: 0 0 0 3px rgba(176, 141, 63, 0.18) !important;
}

/* =====================================================================
   Beta.3 — Branded sign-in form on the gate
   ===================================================================== */

.tpdg-cp-gate__inner--signin {
    max-width: 420px;
    padding: 36px 32px 28px;
}

.tpdg-cp-gate__brand {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #DDD6C5;
}
.tpdg-cp-gate__brand-mark {
    display: block;
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: #0F2A44;
    letter-spacing: 0.5px;
    line-height: 1.1;
}
.tpdg-cp-gate__brand-sub {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #B08D3F;
    margin-top: 4px;
}

.tpdg-cp-gate__form {
    text-align: left;
    margin-top: 16px;
}

.tpdg-cp-gate__field {
    margin-bottom: 16px;
}

.tpdg-cp-gate__field--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 20px;
    font-size: 13px;
}

.tpdg-cp-gate__label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #0F2A44;
    font-weight: 600;
    margin-bottom: 6px;
}

.tpdg-cp-gate__input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #DDD6C5;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    line-height: 1.4;
    box-sizing: border-box;
}
.tpdg-cp-gate__input:focus {
    outline: none;
    border-color: #B08D3F;
    box-shadow: 0 0 0 3px rgba(176, 141, 63, 0.18);
}

.tpdg-cp-gate__checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #5C5A55;
    cursor: pointer;
}
.tpdg-cp-gate__checkbox input { margin: 0; }

.tpdg-cp-gate__link {
    color: #B08D3F;
    text-decoration: none;
    font-weight: 600;
}
.tpdg-cp-gate__link:hover { text-decoration: underline; }

.tpdg-cp-gate__btn--full {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    background: #0F2A44;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.tpdg-cp-gate__btn--full:hover {
    background: #1a3d5e;
}

.tpdg-cp-gate__notice {
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}
.tpdg-cp-gate__notice--error {
    background: #FAEFEF;
    border-left: 3px solid #8B2E2E;
    color: #8B2E2E;
}
.tpdg-cp-gate__notice--success {
    background: #E8F5E9;
    border-left: 3px solid #2A5A2D;
    color: #1B3F1D;
}

.tpdg-cp-gate__footnote {
    margin: 20px 0 0;
    font-size: 12px;
    color: #5C5A55;
    text-align: center;
}

/* =====================================================================
   Beta.4 — Coach profile form
   ===================================================================== */

/* Wide form spans multiple cards */
.tpdg-cp__form--wide {
    max-width: none;
}
.tpdg-cp__form--wide .tpdg-cp__card {
    margin-bottom: 16px;
}

/* Photo upload row */
.tpdg-cp__photo-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.tpdg-cp__photo-preview {
    width: 160px;
    height: 160px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--tpdg-cream);
    border: 1.5px solid var(--tpdg-rule);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tpdg-cp__photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tpdg-cp__photo-preview .tpdg-cp__photo-gravatar {
    opacity: 0.9;
}
.tpdg-cp__photo-actions {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}
.tpdg-cp__photo-actions .tpdg-cp__form-hint {
    margin: 4px 0 0;
}

/* Ghost button — for destructive secondary actions */
.tpdg-cp__btn--ghost {
    background: transparent;
    color: var(--tpdg-stone);
    border: 1px solid var(--tpdg-rule);
    padding: 9px 18px;
    font-size: 13px;
}
.tpdg-cp__btn--ghost:hover {
    color: var(--tpdg-red);
    border-color: var(--tpdg-red);
    background: #FAEFEF;
}

/* Tighten card titles in form mode */
.tpdg-cp__form--wide .tpdg-cp__card-title {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tpdg-rule);
    margin-bottom: 18px;
}

textarea.tpdg-cp__form-input {
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
}

@media (max-width: 640px) {
    .tpdg-cp__photo-row { gap: 16px; }
    .tpdg-cp__photo-preview {
        width: 120px;
        height: 120px;
    }
}

/* =====================================================================
   Beta.5 — Edit account details box
   ===================================================================== */

.tpdg-cp__settings-admin-link {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--tpdg-rule);
}
.tpdg-cp__settings-admin-link .tpdg-cp__form-hint {
    margin-top: 8px;
}

/* =====================================================================
   Beta.6 — Custom photo upload (CSP-safe)
   ===================================================================== */

.tpdg-cp__photo-preview {
    position: relative;
}

.tpdg-cp__photo-spinner {
    position: absolute;
    inset: 0;
    background: rgba(15, 42, 68, 0.78);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: inherit;
}
.tpdg-cp__photo-spinner[hidden] { display: none; }

.tpdg-cp__photo-spinner-ring {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #B08D3F;
    border-radius: 50%;
    animation: tpdg-cp-spin 0.8s linear infinite;
}
.tpdg-cp__photo-spinner-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

@keyframes tpdg-cp-spin {
    to { transform: rotate(360deg); }
}

.tpdg-cp__photo-error {
    background: #FAEFEF;
    border-left: 3px solid #8B2E2E;
    color: #8B2E2E;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.45;
    margin: 4px 0 0;
    max-width: 100%;
}
.tpdg-cp__photo-error[hidden] { display: none; }

.tpdg-cp__btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Send actions — multi-action rows (beta.39)
   --------------------------------------------------------------------------- */
.tpdg-cp__act-rows {
    margin-top: 4px;
}
.tpdg-cp__act-row {
    border: 1px solid var(--tpdg-rule);
    border-radius: 6px;
    padding: 16px 16px 2px;
    margin-bottom: 14px;
    background: var(--tpdg-cream, #faf7f1);
}
.tpdg-cp__act-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.tpdg-cp__act-row-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tpdg-gold);
    color: var(--tpdg-navy);
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 auto;
}
.tpdg-cp__act-row-remove {
    background: transparent;
    border: none;
    color: var(--tpdg-stone);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    font-family: inherit;
    text-decoration: underline;
}
.tpdg-cp__act-row-remove:hover {
    color: #b3261e;
}
.tpdg-cp__act-row-remove[hidden] {
    display: none;
}
.tpdg-cp__act-addwrap {
    margin: 2px 0 4px;
}
