/* ===================================================================
   MyTeam — stylesheet
   Light/dark theming via CSS variables. Australian green + gold.
   Top navigation bar.
   =================================================================== */

:root {
    --primary-color: #00843d;     /* Australian green */
    --primary-hover: #006b31;
    --accent-color: #ffcd00;      /* Australian gold */
    --accent-hover: #e0b400;
    --secondary-color: #5b7066;
    --danger-color: #dc2626;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --success-bg: #d8f3e2;
    --success-text: #136c3a;
    --info-bg: #d9f0e4;
    --info-text: #00843d;

    /* Soft-gold tint used for "question"/highlight badges (readable on light) */
    --gold-soft-bg: rgba(255, 205, 0, 0.22);
    --gold-soft-text: #7a5d00;

    --bg-color: #ffffff;
    --text-color: #1d2b23;
    --heading-color: #0a2114;
    --muted-color: #5b7066;
    --card-bg: #ffffff;
    --border-color: #e1ece6;
    --input-border: #aebfb4;
    --hover-bg: #f0f7f3;
    --focus-glow: rgba(0, 132, 61, 0.15);

    /* Top nav (green bar, gold accents) */
    --topnav-bg: #00843d;
    --topnav-text: rgba(255, 255, 255, 0.82);
    --topnav-hover: rgba(255, 255, 255, 0.14);
    --topnav-active-bg: rgba(255, 255, 255, 0.16);
    --topnav-active-text: #ffffff;
    --topnav-active-border: #ffcd00;

    /* Auth/brand panel */
    --brand-bg: #00843d;
    --brand-bg-2: #006b31;

    /* Contained view: overall container width (L 75% / R 25%, R min 350px) */
    --content-max: 1600px;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 3px rgba(10, 33, 20, 0.08);
    --shadow-md: 0 4px 16px rgba(10, 33, 20, 0.12);
}

[data-theme='dark'] {
    --primary-color: #2faa5f;     /* brighter green for dark surfaces */
    --primary-hover: #259152;
    --accent-color: #ffd21a;
    --accent-hover: #e6bd00;
    --secondary-color: #8fab9c;
    --danger-color: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.15);
    --danger-text: #fca5a5;
    --success-bg: rgba(74, 222, 128, 0.15);
    --success-text: #86efac;
    --info-bg: rgba(47, 170, 95, 0.16);
    --info-text: #86efac;

    --gold-soft-bg: rgba(255, 210, 26, 0.16);
    --gold-soft-text: #ffd21a;

    --bg-color: #0a1f14;          /* dark green */
    --text-color: #e6f0ea;
    --heading-color: #f3f9f5;
    --muted-color: #8fab9c;
    --card-bg: #102a1c;
    --border-color: #1d3a29;
    --input-border: #3c5d49;
    --hover-bg: #163522;
    --focus-glow: rgba(47, 170, 95, 0.28);

    --topnav-bg: #061509;
    --topnav-text: rgba(255, 255, 255, 0.78);
    --topnav-hover: rgba(255, 255, 255, 0.08);
    --topnav-active-bg: rgba(255, 255, 255, 0.10);
    --topnav-active-text: #ffffff;
    --topnav-active-border: #ffd21a;

    --brand-bg: #07180f;
    --brand-bg-2: #0d2b1b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-color); }
img { max-width: 100%; display: block; }
.muted { color: var(--muted-color); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, filter 0.15s, transform 0.05s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border-color); color: var(--text-color); }
.btn-secondary:hover { filter: brightness(0.96); }
.btn-ghost { background: transparent; color: var(--secondary-color); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--text-color); }
.btn-ghost-danger:hover { color: var(--danger-color); border-color: var(--danger-color); background: var(--danger-bg); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.875rem; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-xs { padding: 0.35rem; font-size: 0.8rem; border-radius: 0.4rem; }
.btn-xs svg { width: 15px; height: 15px; }
.btn-icon {
    width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--secondary-color);
    border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--hover-bg); color: var(--text-color); }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 500; color: var(--text-color); }
input:not([type=checkbox]):not([type=radio]):not([type=file]),
select, textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-color);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-glow);
}
.form-hint { display: block; margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted-color); }
.stack-form .btn { margin-top: 0.25rem; }

/* ---------- Alerts ---------- */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.card-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1rem; color: var(--heading-color); margin-bottom: 1rem;
}
.card-title svg { width: 18px; height: 18px; color: var(--primary-color); }
.card-title .muted { font-weight: 400; }

/* ---------- Auth pages ---------- */
.auth-main { min-height: 100vh; }
.auth-split { display: flex; min-height: 100vh; }
.auth-brand {
    width: 45%;
    background: linear-gradient(160deg, var(--brand-bg), var(--brand-bg-2));
    display: flex; align-items: center; justify-content: center; padding: 2rem; color: #fff;
}
.auth-brand-content { text-align: center; }
.auth-brand-logo {
    width: 84px; height: 84px; margin: 0 auto 1.25rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-color); border-radius: 1.25rem; box-shadow: 0 10px 30px rgba(255,205,0,0.4);
}
.auth-brand-logo svg { width: 44px; height: 44px; color: #0a2114; }
.auth-brand-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand-tagline { margin-top: 0.5rem; color: rgba(255,255,255,0.7); font-size: 1rem; }
.auth-side { width: 55%; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-container { width: 100%; max-width: 380px; }
.auth-container h2 { color: var(--heading-color); margin-bottom: 1.25rem; }
.auth-footer { margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted-color); text-align: center; }
.auth-footer a { font-weight: 600; text-decoration: none; }
.theme-toggle-link {
    display: inline-flex; align-items: center; gap: 0.4rem; margin: 1.5rem auto 0;
    background: none; border: none; color: var(--muted-color); cursor: pointer; font: inherit; font-size: 0.85rem;
}
.theme-toggle-link svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
    .auth-split { flex-direction: column; }
    .auth-brand { width: 100%; min-height: 30vh; }
    .auth-side { width: 100%; align-items: flex-start; }
    .auth-brand-title { font-size: 1.5rem; }
}

/* ===================================================================
   App layout (top nav + main)
   =================================================================== */
.app-layout { min-height: 100vh; }

.topnav {
    position: sticky; top: 0; z-index: 1100;
    background: var(--topnav-bg); color: var(--topnav-text);
    box-shadow: var(--shadow-md);
}
.topnav-inner {
    display: flex; align-items: center; gap: 0.5rem;
    max-width: var(--content-max); margin: 0 auto; padding: 0 1.25rem; height: 60px;
}
.topnav-logo {
    display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
    color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em;
    margin-right: auto;
}
.topnav-logo svg { width: 24px; height: 24px; color: var(--accent-color); }

.topnav-menu { display: flex; align-items: center; gap: 0.15rem; }
.topnav-item {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.7rem;
    color: var(--topnav-text); text-decoration: none; font-size: 0.9rem; font-weight: 500;
    border-radius: var(--radius-sm); border-bottom: 2px solid transparent;
    transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.topnav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.topnav-item:hover { background: var(--topnav-hover); color: #fff; }
.topnav-item.active {
    background: var(--topnav-active-bg); color: var(--topnav-active-text);
    border-bottom-color: var(--topnav-active-border); font-weight: 600;
}

.nav-badge {
    min-width: 20px; height: 20px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-color); color: #14241b; font-size: 0.72rem; font-weight: 700; border-radius: 999px;
}
.nav-badge[hidden] { display: none; }

/* User menu (right of the bar) */
.topnav-right { position: relative; flex-shrink: 0; }
.topnav-user-toggle {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border: none; cursor: pointer;
    background: var(--topnav-hover); color: #fff; border-radius: 999px;
    font: inherit; text-align: left; transition: background 0.15s;
}
.topnav-user-toggle:hover { background: var(--topnav-active-bg); }
.topnav-user-name { font-size: 0.875rem; font-weight: 600; color: #fff; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav-user-toggle .chevron { width: 16px; height: 16px; transition: transform 0.2s; }
.topnav-user-toggle.open .chevron { transform: rotate(180deg); }

.topnav-user-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 1200;
    min-width: 200px; background: var(--card-bg); color: var(--text-color);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); padding: 0.35rem;
}
.topnav-user-menu.open { display: block; }
.topnav-user-menu form { margin: 0; }
.topnav-user-menu-item {
    display: flex; align-items: center; gap: 0.6rem; width: 100%;
    padding: 0.55rem 0.65rem; border: none; background: none; cursor: pointer;
    color: var(--text-color); text-decoration: none; font: inherit; font-size: 0.875rem;
    border-radius: var(--radius-sm); transition: background 0.15s;
}
.topnav-user-menu-item:hover { background: var(--hover-bg); }
.topnav-user-menu-item svg { width: 17px; height: 17px; color: var(--muted-color); }
.topnav-user-menu-item-danger { color: var(--danger-color); }
.topnav-user-menu-item-danger svg { color: var(--danger-color); }
.topnav-user-menu-divider { height: 1px; background: var(--border-color); margin: 0.35rem 0.25rem; }
.topnav-user-menu-heading {
    display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--muted-color); font-weight: 700; padding: 0.35rem 0.65rem 0.2rem;
}

.app-main { padding: 1.5rem 1.25rem; }
.content-wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(350px, 1fr); gap: 1.5rem; max-width: var(--content-max); margin: 0 auto; align-items: start; }
.content-middle { min-width: 0; }
.content-right { position: sticky; top: 76px; }

@media (max-width: 1023px) {
    /* Icon-only nav: hide the text labels, keep items inline in the same order. */
    .topnav-label { display: none; }
    .topnav-item { padding: 0.5rem 0.55rem; gap: 0.3rem; }
    .content-wrap { grid-template-columns: 1fr; max-width: 640px; }
    .content-right { position: static; order: -1; }
}
@media (max-width: 600px) {
    .topnav-inner { padding: 0 0.85rem; gap: 0.25rem; }
    .topnav-user-name { display: none; }
    .topnav-menu { gap: 0; }
    .app-main { padding: 1rem 0.85rem; }
    .card { padding: 1rem; }
}

/* ---------- Page chrome ---------- */
.page-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; color: var(--heading-color); }
.page-head .btn { margin-left: auto; }
.section-title { font-size: 1.1rem; color: var(--heading-color); margin: 1.5rem 0 1rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted-color); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.back-link:hover { color: var(--primary-color); }
.back-link svg { width: 16px; height: 16px; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted-color); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 0.75rem; opacity: 0.6; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; }
.page-indicator { font-size: 0.875rem; color: var(--muted-color); }

/* ---------- Avatars & role badges ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--hover-bg); }
.avatar-initials {
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; border-radius: 50%; line-height: 1;
}
.role-badge {
    display: inline-block; padding: 0.05rem 0.4rem; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; vertical-align: middle;
}
.role-admin { background: var(--accent-color); color: #3d2f00; }
.role-coach { background: var(--primary-color); color: #fff; }
.role-student { background: var(--hover-bg); color: var(--muted-color); }

/* ---------- Composer ---------- */
.composer-type { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.composer-type-opt {
    display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color); border-radius: 999px; cursor: pointer;
    font-size: 0.85rem; font-weight: 500; color: var(--secondary-color); user-select: none;
}
.composer-type-opt svg { width: 15px; height: 15px; }
.composer-type-opt input { display: none; }
.composer-type-opt:has(input:checked) { border-color: var(--primary-color); color: var(--primary-color); background: var(--focus-glow); }
.composer-input { border: 1px solid var(--input-border); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; font-size: 1rem; }
.composer-extra { margin-top: 0.5rem; }
.composer-video { font-size: 0.85rem; }
.composer-previews { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.composer-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.composer-bar { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border-color); }
.composer-hint { font-size: 0.78rem; color: var(--muted-color); }
.composer-submit { margin-left: auto; }
.btn-ghost input[type=file] { display: none; }

/* ---------- Post cards ---------- */
.post-list { display: flex; flex-direction: column; gap: 1.25rem; }
.post-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 1.1rem 1.25rem;
}
.post-question { border-left: 3px solid var(--accent-color); }
.post-head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.post-author { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: inherit; }
.post-author-meta { display: flex; flex-direction: column; }
.post-author-name { font-weight: 600; color: var(--heading-color); font-size: 0.95rem; }
.post-time { font-size: 0.78rem; color: var(--muted-color); }
.post-head-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.pin-flag { color: var(--accent-color); display: inline-flex; }
.pin-flag svg { width: 16px; height: 16px; }
.type-badge {
    display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.type-question { background: var(--gold-soft-bg); color: var(--gold-soft-text); }
.type-question svg { width: 13px; height: 13px; }

.post-menu { position: relative; }
.post-menu-list {
    display: none; position: absolute; right: 0; top: 100%; margin-top: 0.25rem; z-index: 50;
    min-width: 140px; background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 0.25rem; overflow: hidden;
}
.post-menu.open .post-menu-list { display: block; }
.post-menu-list form { margin: 0; }
.post-menu-item {
    display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.6rem;
    border: none; background: none; cursor: pointer; color: var(--text-color); font: inherit; font-size: 0.85rem;
    border-radius: var(--radius-sm); text-align: left;
}
.post-menu-item:hover { background: var(--hover-bg); }
.post-menu-item svg { width: 15px; height: 15px; }
.post-menu-item-danger { color: var(--danger-color); }

.post-body { color: var(--text-color); white-space: pre-wrap; word-wrap: break-word; margin-bottom: 0.75rem; }
.post-body:last-child { margin-bottom: 0; }

.post-images { display: grid; gap: 4px; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.75rem; }
.post-images.count-1 { grid-template-columns: 1fr; }
.post-images.count-2 { grid-template-columns: 1fr 1fr; }
.post-images.count-3, .post-images.count-4 { grid-template-columns: 1fr 1fr; }
.post-image { display: block; overflow: hidden; }
.post-image img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; }
.post-images.count-1 .post-image img { max-height: 520px; }

.post-video { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.75rem; background: #000; }
.post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.post-actions { display: flex; gap: 0.5rem; padding-top: 0.65rem; border-top: 1px solid var(--border-color); }
.post-action {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.6rem;
    border: none; background: none; cursor: pointer; color: var(--muted-color); font: inherit; font-size: 0.85rem;
    border-radius: var(--radius-sm); text-decoration: none; transition: background 0.15s, color 0.15s;
}
.post-action:hover { background: var(--hover-bg); color: var(--text-color); }
.post-action svg { width: 18px; height: 18px; }
.like-btn.liked { color: var(--danger-color); }
.like-btn.liked svg { fill: var(--danger-color); }

/* ---------- Comments ---------- */
.comments-card { margin-top: 1.25rem; }
.comment-form { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.25rem; }
.comment-form .avatar { flex-shrink: 0; }
.comment-input { flex: 1; }
.comment-list { display: flex; flex-direction: column; gap: 1rem; }
.empty-comments { text-align: center; padding: 0.5rem 0; }
.comment { display: flex; gap: 0.6rem; }
.comment-avatar { flex-shrink: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-bubble { background: var(--hover-bg); border-radius: var(--radius-md); padding: 0.6rem 0.85rem; }
.comment-meta { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: 0.875rem; color: var(--heading-color); text-decoration: none; }
.comment-time { font-size: 0.75rem; color: var(--muted-color); }
.comment-body { font-size: 0.9rem; white-space: pre-wrap; word-wrap: break-word; }
.comment-tools { display: flex; gap: 0.75rem; margin: 0.3rem 0 0 0.85rem; }
.comment-tools form { margin: 0; }
.comment-tool { background: none; border: none; cursor: pointer; color: var(--muted-color); font: inherit; font-size: 0.78rem; font-weight: 600; padding: 0; }
.comment-tool:hover { color: var(--primary-color); }
.comment-tool-danger:hover { color: var(--danger-color); }
.comment-reply { margin-top: 0.75rem; }
.reply-form { display: flex; gap: 0.5rem; margin: 0.6rem 0 0 0.85rem; }
.reply-input { flex: 1; }

/* ---------- Profile ---------- */
.profile-header { display: flex; gap: 1.25rem; align-items: center; }
.profile-id h1 { font-size: 1.4rem; color: var(--heading-color); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.profile-bio { margin-top: 0.4rem; color: var(--text-color); }
.profile-since { margin-top: 0.4rem; font-size: 0.8rem; color: var(--muted-color); }
.profile-id .btn { margin-top: 0.75rem; }

@media (max-width: 600px) {
    .profile-header { flex-direction: column; text-align: center; }
    .profile-id h1 { justify-content: center; }
}

/* ---------- Avatar edit / dropzone ---------- */
.avatar-edit { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.avatar-preview .avatar { width: 96px; height: 96px; }
.avatar-dropzone {
    flex: 1; min-width: 240px; border: 2px dashed var(--border-color); border-radius: var(--radius-md);
    padding: 1.25rem; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.avatar-dropzone.dragover { border-color: var(--primary-color); background: var(--focus-glow); }
.dropzone-inner svg { width: 28px; height: 28px; color: var(--muted-color); margin-bottom: 0.5rem; }
.dropzone-inner p { font-size: 0.9rem; }
.avatar-status { margin-top: 0.75rem; font-size: 0.85rem; min-height: 1.2em; }
.avatar-status.is-ok { color: var(--success-text); }
.avatar-status.is-error { color: var(--danger-color); }

/* ---------- Members (right column) ---------- */
.members-card { padding: 1rem 1.1rem; }
.member-list { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.member-list a {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text-color); transition: background 0.15s;
}
.member-list a:hover { background: var(--hover-bg); }
.member-name { flex: 1; font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Notifications ---------- */
.notif-card { padding: 0.5rem; }
.notif-list { list-style: none; }
.notif-item a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-color); transition: background 0.15s; }
.notif-item a:hover { background: var(--hover-bg); }
.notif-item.unread a { background: var(--focus-glow); }
.notif-item + .notif-item { border-top: 1px solid var(--border-color); }
.notif-icon { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.notif-icon svg { width: 18px; height: 18px; }
.notif-comment { background: var(--info-bg); color: var(--info-text); }
.notif-reply { background: var(--success-bg); color: var(--success-text); }
.notif-question { background: var(--gold-soft-bg); color: var(--gold-soft-text); }
.notif-text { font-size: 0.9rem; }
.notif-time { display: block; font-size: 0.75rem; color: var(--muted-color); margin-top: 0.1rem; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.data-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-color); font-weight: 700; }
.data-table .num { text-align: right; }
.data-table tbody tr:hover { background: var(--hover-bg); }
.cell-user { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.cell-user-name { display: block; font-weight: 600; color: var(--heading-color); font-size: 0.9rem; }
.cell-user-email { display: block; font-size: 0.78rem; color: var(--muted-color); }
.inline-form { margin: 0; }
.role-select { width: auto; padding: 0.35rem 1.75rem 0.35rem 0.6rem; font-size: 0.85rem; }
.row-actions { display: flex; gap: 0.25rem; }
.row-actions form { margin: 0; }
.actions-col { width: 1%; }
.status-pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.status-active { background: var(--success-bg); color: var(--success-text); }
.status-off { background: var(--danger-bg); color: var(--danger-text); }

/* ---------- Invite links ---------- */
.invite-link { display: flex; align-items: center; gap: 0.4rem; }
.invite-url { width: 320px; max-width: 60vw; font-size: 0.8rem; font-family: ui-monospace, monospace; padding: 0.4rem 0.6rem; }
.invite-create-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.invite-team-select { width: auto; max-width: 220px; }
.invite-team-tag {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem;
    background: var(--gold-soft-bg); color: var(--gold-soft-text); border-radius: 999px;
    font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.invite-team-tag svg { width: 13px; height: 13px; }

/* ---------- Right column: teams accordion + questions ---------- */
.teams-card, .questions-card { padding: 1rem 1.1rem; }
.rightcol-empty { font-size: 0.85rem; }
.rightcol-action { margin-top: 0.6rem; }

.team-acc-list { display: flex; flex-direction: column; gap: 0.1rem; }
.team-acc-toggle {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    padding: 0.5rem 0.5rem; border: none; background: none; cursor: pointer;
    color: var(--text-color); font: inherit; border-radius: var(--radius-sm); transition: background 0.15s;
}
.team-acc-toggle:hover { background: var(--hover-bg); }
.team-acc-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted-color); transition: transform 0.15s; }
.team-acc-toggle.open .team-acc-chevron { transform: rotate(90deg); }
.team-acc-name { flex: 1; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-acc-count {
    min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--hover-bg); color: var(--muted-color); font-size: 0.72rem; font-weight: 700; border-radius: 999px;
}
.team-acc-body { padding: 0.1rem 0 0.4rem 1.6rem; }
.team-acc-empty { font-size: 0.8rem; padding: 0.25rem 0; }

.q-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.q-item { padding-bottom: 0.6rem; border-bottom: 1px solid var(--border-color); }
.q-item:last-child { padding-bottom: 0; border-bottom: none; }
.q-link { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-color); text-decoration: none; }
.q-link:hover { color: var(--primary-color); }
.q-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.2rem; font-size: 0.75rem; color: var(--muted-color); }
.q-teams { color: var(--primary-color); font-weight: 600; }
.q-answers::before { content: '\00b7'; margin-right: 0.4rem; }
.q-item .q-meta .q-teams:only-child + .q-answers::before { content: none; }

/* ---------- Composer: team checkboxes ---------- */
.composer-teams { margin-top: 0.5rem; padding: 0.6rem 0.75rem; background: var(--hover-bg); border-radius: var(--radius-sm); }
.composer-teams-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted-color); margin-bottom: 0.4rem; }
.composer-team-opt { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0.85rem 0.3rem 0; font-size: 0.875rem; cursor: pointer; }
.composer-team-opt input { width: auto; }
.composer-teams-empty { font-size: 0.82rem; margin: 0; }

/* ---------- Feed: pending answers + answer bubbles ---------- */
.pending-item { margin-bottom: 1.25rem; }
.pending-answer-form { margin: 0.5rem 0 0; }
.feed-answer { display: flex; gap: 0.6rem; margin: -0.5rem 0 1.25rem 1.5rem; }
.feed-answer-bubble { flex: 1; min-width: 0; background: var(--hover-bg); border-radius: var(--radius-md); padding: 0.6rem 0.85rem; }

/* ---------- Teams management ---------- */
.team-create-form { display: flex; gap: 0.6rem; align-items: center; }
.team-create-form input { flex: 1; }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.team-head h1 { font-size: 1.4rem; color: var(--heading-color); }
.team-head form { margin: 0; }
.roster-list { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 0.75rem; }
.roster-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.4rem; border-radius: var(--radius-sm); }
.roster-row:hover { background: var(--hover-bg); }
.roster-user { display: flex; align-items: center; gap: 0.55rem; flex: 1; min-width: 0; text-decoration: none; color: var(--text-color); }
.roster-add { display: flex; gap: 0.5rem; align-items: center; padding-top: 0.5rem; border-top: 1px solid var(--border-color); }
.roster-add select { width: auto; flex: 1; max-width: 260px; }
.roster-none { font-size: 0.82rem; margin-top: 0.5rem; }
.profile-viewlink { margin-top: 0.5rem; }
