/* =====================================================================
   CIVIC THEME  —  Step 4: profile + activity tabs
   ---------------------------------------------------------------------
   Additive. Loads AFTER civic-theme-step3c-actions.css.

   Rebuilds the `activeTab === 'tab3'` screen as two stacked cards:
     .profile-card    identity + stat tiles + label : value rows + actions
     .activity-card   segmented tabs over the four dashboard lists, with
                      an inline reply box on Messages / On your posts

   Markup lives in templates/index.html; the lists are driven by the
   `activity` Alpine component in static/js/tappet.js.
   ===================================================================== */

/* ---- Shared card surface -------------------------------------------- */
.civic-card {
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 16px;
    box-shadow: 0 6px 18px -10px rgba(30, 40, 60, .22);
    overflow: hidden;
    margin: 0 auto 1.4em;
    max-width: 640px;
    width: 100%;
}

.home {
    padding-bottom: 2em;
}

/* ---- Identity header ------------------------------------------------- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px;
    border-bottom: 1px solid #eceef2;
}
.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 13px;
    object-fit: cover;
    border: 1px solid #e6e8ec;
    flex-shrink: 0;
}
.profile-id {
    flex: 1;
    min-width: 0;
}
.profile-name {
    font-size: 1.15em;
    font-weight: 600;
    color: #1b1f26;
    line-height: 1.25;
}
.profile-role {
    font-size: .8em;
    color: #6b727e;
}
.ghost-btn {
    font-size: .8em;
    font-weight: 600;
    color: #566277;
    border: 1px solid #d3d9e6;
    border-radius: 8px;
    padding: 7px 14px;
    white-space: nowrap;
    transition: background .15s ease;
}
.ghost-btn:hover {
    background: #eef1f7;
}

/* ---- Stat tiles ------------------------------------------------------ */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #eceef2;
}
.stat {
    padding: 16px;
    text-align: center;
    border-right: 1px solid #eceef2;
}
.stat:last-child {
    border-right: 0;
}
.stat-num {
    font-size: 1.55em;
    font-weight: 700;
    line-height: 1.1;
    color: #1b1f26;
    font-variant-numeric: tabular-nums;
}
.stat-num.accent {
    color: #566277;
}
.stat-key {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .65em;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8a90a0;
    margin-top: 2px;
}

/* ---- label : value rows ---------------------------------------------- */
.profile-rows {
    font-size: .87em;
}
.profile-row {
    display: flex;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px solid #f1f2f5;
}
.row-key {
    color: #8a90a0;
    width: 130px;
    flex-shrink: 0;
}
.row-val {
    color: #1b1f26;
    min-width: 0;
    overflow-wrap: anywhere;
}
.row-val.muted {
    color: #4a505b;
}

/* ---- Card footer actions --------------------------------------------- */
.profile-actions {
    display: flex;
    border-top: 1px solid #eceef2;
}
.pact {
    flex: 1;
    text-align: center;
    padding: 14px 6px;
    font-size: .8em;
    font-weight: 600;
    color: #566277;
    border-right: 1px solid #eceef2;
    text-decoration: none;
    transition: background .15s ease;
}
.pact:last-child {
    border-right: 0;
}
.pact:hover {
    background: #f5f6f8;
}

/* ---- Activity: segmented tabs ---------------------------------------- */
.act-tabs {
    display: flex;
    gap: 6px;
    padding: 14px 16px;
    border-bottom: 1px solid #eceef2;
    overflow-x: auto;
}
.act-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: .8em;
    font-weight: 600;
    color: #6b727e;
    background: #f2f3f6;
    transition: background .15s ease, color .15s ease;
}
.act-tab:hover {
    background: #e8eaef;
}
.act-tab.on {
    color: #ffffff;
    background: #566277;
}
.act-tab-count {
    color: #9aa0ab;
    font-variant-numeric: tabular-nums;
}
.act-tab.on .act-tab-count {
    color: #ffffff;
    opacity: .75;
}

/* ---- Activity rows ---------------------------------------------------- */
.act-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 15px 18px;
    border-bottom: 1px solid #f1f2f5;
    font-size: .9em;
}
.act-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e6e8ec;
    flex-shrink: 0;
}
.act-row-main {
    flex: 1;
    min-width: 0;
}
.act-row-title {
    color: #1b1f26;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.act-row-meta {
    color: #9aa0ab;
    font-size: .85em;
    font-weight: 400;
}
.act-row-on {
    font-size: .85em;
    color: #8a90a0;
    margin: 1px 0 5px;
}
.act-row-link {
    color: #566277;
    text-decoration: none;
}
.act-row-link:hover {
    text-decoration: underline;
}
.act-row-body {
    color: #3f454e;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.act-row-tools {
    margin-top: 6px;
}
.link-btn {
    font-size: .85em;
    font-weight: 600;
    color: #566277;
}
.link-btn:hover {
    text-decoration: underline;
}
.act-empty {
    padding: 26px 18px;
    text-align: center;
    color: #9aa0ab;
    font-size: .9em;
}

/* The row's delete / edit / event controls float to the right of the row. */
.act-row .delete-post,
.act-row .edit-post,
.act-row .post-event-action {
    flex-shrink: 0;
    margin: 0 0 0 8px;
    color: #9aa0ab;
    cursor: pointer;
}
.act-row .delete-post img,
.act-row .edit-post img,
.act-row .post-event-action img {
    width: 18px;
    height: 18px;
    display: block;
    opacity: .55;
    transition: opacity .15s ease;
}
.act-row .delete-post:hover img,
.act-row .edit-post:hover img,
.act-row .post-event-action:hover img {
    opacity: 1;
}
.event-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: .7em;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0f766e;
    background: #e6f4f2;
    border: 1px solid #cfe8e4;
    vertical-align: middle;
}

/* ---- Inline reply ----------------------------------------------------- */
.reply-box {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 10px;
}
.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e6e8ec;
    flex-shrink: 0;
}
.reply-input {
    flex: 1;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 8px 12px;
    font-size: .95em;
    color: #1b1f26;
    background: #f2f3f6;
    border: 1px solid #e6e8ec;
    border-radius: 9px;
}
.reply-input::placeholder {
    color: #9aa0ab;
}
.reply-send {
    display: inline-flex;
    flex-shrink: 0;
}
.reply-send img {
    width: 28px;
    height: 28px;
    display: block;
}
.reply-send.busy {
    opacity: .5;
    pointer-events: none;
}

/* ---- Pagination ------------------------------------------------------- */
.act-list .pagination-controls {
    margin: 0;
    padding: 14px;
    gap: 6px;
    align-items: center;
    border-top: 1px solid #f1f2f5;
}
.act-list .pagination-controls button {
    font-size: .8em;
    font-weight: 600;
    color: #566277;
    background: #ffffff;
    border: 1px solid #d3d9e6;
    border-radius: 8px;
    padding: 7px 14px;
    height: auto;
    margin: 0;
}
.act-list .pagination-controls button:disabled {
    color: #b9bec8;
    border-color: #eceef2;
}
.act-list .page-number {
    margin: 0 14px;
    font-size: .8em;
    color: #8a90a0;
}

/* ---- Profile edit form (existing markup, civic surface) --------------- */
.profile-wide {
    padding: 20px;
    max-width: 640px;
}
.profile-wide h3 {
    margin-top: 0;
}
.profile-controls {
    font-size: .85em;
    color: #8a90a0;
    margin-bottom: 1em;
}
.profile-wide .form-group label {
    font-weight: 600;
    font-size: .85em;
    color: #6b727e;
}
.profile-wide input[type="text"],
.profile-wide textarea {
    background: #f5f6f8;
    border: 1px solid #e6e8ec;
    border-radius: 9px;
    color: #1b1f26;
}
.profile-wide #avatar,
.profile-wide .croppr {
    width: 220px;
    height: 220px;
    border-radius: 14px;
}
.feedback {
    max-width: 640px;
    margin: 2em auto;
}
.feedback textarea {
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
}

@media (max-width: 600px) {
    .profile-row {
        flex-direction: column;
        gap: 2px;
    }
    .row-key {
        width: auto;
    }
    .pact {
        font-size: .75em;
        padding: 13px 4px;
    }
}
