/* ── Tokens ────────────────────────────────────────────── */
:root {
    --bg: #f5f3ef;
    --bg-card: #ffffff;
    --bg-soft: #f7f7f5;
    --text: #1f1f1f;
    --text-muted: #888;
    --border: #e3ddd6;
    --border-strong: #333;
    --accent: #1f1f1f;
    --accent-text: #ffffff;
    --danger: #c0392b;
    --danger-bg: #fdecea;
    --warn: #c05c2a;
    --warn-bg: #fff8f4;

    --idea: #aaa;
    --idea-bg: #f5f5f5;
    --idea-border: #ccc;
    --todo: #1a6fb5;
    --todo-bg: #e8f3fd;
    --todo-border: #a3c8f0;
    --prog: #a06b00;
    --prog-bg: #fef6e4;
    --prog-border: #f0d090;
    --done: #1a7a45;
    --done-bg: #e6f7ee;
    --done-border: #90d4a8;
    --conf: #6b3fa0;
    --conf-bg: #f3edfb;
    --conf-border: #c4a0e8;

    --radius: 4px;
    --radius-lg: 6px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;

    --color-slate:  #5c7db5;
    --color-green:  #3d9e6e;
    --color-purple: #a05cb5;
    --color-orange: #e06b3a;
    --color-gold:   #b5a43d;
    --color-teal:   #5cb5b0;
}

[data-theme="dark"] {
    --bg: #1a1a1c;
    --bg-card: #232327;
    --bg-soft: #2a2a2e;
    --text: #ececea;
    --text-muted: #888;
    --border: #34343a;
    --border-strong: #5a5a60;
    --accent: #ececea;
    --accent-text: #1a1a1c;
    --danger: #e87060;
    --danger-bg: #3a1f1c;
    --warn: #e8906a;
    --warn-bg: #2a1f18;

    --idea-bg: #2a2a2e;
    --idea-border: #44444a;
    --todo-bg: #1a2a3a;
    --todo-border: #2a4a6a;
    --prog-bg: #2e2418;
    --prog-border: #5a4a20;
    --done-bg: #1a2e22;
    --done-border: #2e5a3a;
    --conf-bg: #2a1f3a;
    --conf-border: #5a3a8a;
}

/* ── Reset ────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Georgian', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ── Utility ─────────────────────────────────────────── */
.muted { color: var(--text-muted); }
.spacer { flex: 1; }
.bold { font-weight: 700; }
.red { color: var(--danger); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ── Buttons / pills / chips ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger  { border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    color: var(--text);
    line-height: 1;
}
.icon-btn:hover { background: var(--bg-soft); }

.pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    font-size: 11px;
    cursor: pointer;
    background: transparent;
    color: var(--text);
    white-space: nowrap;
}
.pill.on { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
}
.chip.idea { color: var(--idea); background: var(--idea-bg); border-color: var(--idea-border); }
.chip.todo { color: var(--todo); background: var(--todo-bg); border-color: var(--todo-border); }
.chip.prog { color: var(--prog); background: var(--prog-bg); border-color: var(--prog-border); }
.chip.done { color: var(--done); background: var(--done-bg); border-color: var(--done-border); }
.chip.conf { color: var(--conf); background: var(--conf-bg); border-color: var(--conf-border); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.idea { background: var(--idea); }
.dot.todo { background: var(--todo); }
.dot.prog { background: var(--prog); }
.dot.done { background: var(--done); }
.dot.conf { background: var(--conf); }

.swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }

.avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #6b8aad;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg-card);
    flex-shrink: 0;
}

/* ── Inputs ──────────────────────────────────────────── */
.field { display: block; margin-bottom: var(--space-3); }
.field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.input {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 14px;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
textarea.input { min-height: 80px; resize: vertical; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ── Header (app + public) ───────────────────────────── */
.app-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.brand {
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.brand-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: block;
    flex-shrink: 0;
}
.brand-name { line-height: 1; }
.app-search-wrap {
    flex: 1;
    max-width: 480px;
    margin: 0;
}
@media (min-width: 640px) {
    .app-search-wrap {
        flex: none;
        width: 260px;
        margin-left: auto;
    }
}
.app-search {
    width: 100%;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    color: var(--text-muted);
    background: transparent;
    cursor: text;
}
.bell {
    position: relative;
    font-size: 16px;
}
.bell .badge {
    position: absolute;
    top: -3px; right: -3px;
    width: 8px; height: 8px;
    background: #e05;
    border-radius: 50%;
}
.user-menu { position: relative; }
.lang-toggle, .theme-toggle { background: transparent; border: 0; cursor: pointer; padding: 4px 6px; border-radius: var(--radius); color: var(--text-muted); }
.lang-toggle:hover, .theme-toggle:hover { background: var(--bg-soft); color: var(--text); }
.lang-toggle form, .theme-toggle form { display: inline; }

.hamburger { display: none; }

/* ── Notification dropdown ───────────────────────────── */
.notif-wrap { position: relative; }

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 320px;
    max-height: 480px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 200;
}

.notif-head {
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.notif-section-title {
    padding: 8px 14px 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.notif-item {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.notif-item:last-child { border-bottom: none; }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-title a { color: var(--text); }
.notif-item-title a:hover { text-decoration: underline; }
.notif-item-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.notif-actions { display: flex; gap: 4px; flex-shrink: 0; }

.notif-empty {
    padding: 20px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-loading {
    padding: 16px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Public landing ─────────────────────────────────── */
.public-page { max-width: 720px; margin: 0 auto; padding: 24px; }
.hero-bar { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 64px; }
.hero-title { font-size: 32px; font-weight: 700; margin: var(--space-5) 0; }
.hero-features { list-style: none; padding: 0; display: flex; gap: var(--space-5); flex-wrap: wrap; color: var(--text-muted); }
.hero-footer { margin-top: 64px; color: var(--text-muted); font-size: 12px; }

/* ── Auth pages ─────────────────────────────────────── */
.auth-card {
    max-width: 380px;
    margin: 64px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}
.auth-card h1 { font-size: 20px; margin: 0 0 var(--space-4); }
.auth-card .actions { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-4); gap: var(--space-2); }
.auth-card .secondary { font-size: 12px; color: var(--text-muted); }
.auth-card .field.checkbox { font-size: 13px; }
.auth-card .field.checkbox label { display: flex; align-items: center; gap: 6px; }

.form-error {
    border: 1px solid var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    font-size: 13px;
}
.info-banner {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    font-size: 13px;
}

/* ── Page shell + cards ─────────────────────────────── */
.page { max-width: 720px; margin: 0 auto; padding: var(--space-5) var(--space-4); }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 var(--space-4); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-4);
}
.card-title { font-size: 14px; font-weight: 700; margin: 0 0 var(--space-3); }

.divider { height: 1px; background: var(--border); border: 0; margin: var(--space-4) 0; }

.form-row { display: block; }
.actions-right { display: flex; justify-content: flex-end; gap: var(--space-2); }

.input.static {
    background: var(--bg-soft);
    color: var(--text-muted);
    cursor: default;
}

.pref-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.danger-card { border-color: var(--danger); }
.danger-card .card-title { color: var(--danger); }

/* ── Section color swatches ─────────────────────────── */
.swatch-slate  { background: var(--color-slate); }
.swatch-green  { background: var(--color-green); }
.swatch-purple { background: var(--color-purple); }
.swatch-orange { background: var(--color-orange); }
.swatch-gold   { background: var(--color-gold); }
.swatch-teal   { background: var(--color-teal); }

/* ── Dashboard ───────────────────────────────────────── */
.dash-page { max-width: 800px; margin: 0 auto; padding: var(--space-5) var(--space-4); }

.dash-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}
.dash-heading { font-size: 18px; font-weight: 700; margin: 0 var(--space-2) 0 0; }
.dash-tabs { display: flex; gap: var(--space-1); }

.sort-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

/* ── Section cards ───────────────────────────────────── */
.section-list { display: flex; flex-direction: column; gap: 0; }

.section-card {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    margin-bottom: var(--space-2);
    min-width: 0;
}
.section-card-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text);
    flex-shrink: 0;
}
.section-card-name:hover { text-decoration: underline; }
.section-card-desc {
    flex: 1;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.section-card-chips { display: flex; gap: var(--space-1); flex-shrink: 0; flex-wrap: wrap; }

.avatar-stack { display: flex; flex-shrink: 0; }
.avatar-stack .avatar { margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-overflow { background: var(--bg-soft); color: var(--text-muted); border-color: var(--border); font-size: 9px; }

.section-card-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }

/* ── Card menu (⋯) ───────────────────────────────────── */
.card-menu { position: relative; flex-shrink: 0; }
.card-menu-btn { font-size: 16px; letter-spacing: 1px; padding: 2px 6px; }
.card-menu-list {
    position: fixed;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    list-style: none;
    padding: 4px 0;
    margin: 0;
    min-width: 130px;
}
.card-menu-list li { display: block; }
.card-menu-list a,
.card-menu-item {
    display: block;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    font: inherit;
    text-decoration: none;
}
.card-menu-list a:hover,
.card-menu-item:hover { background: var(--bg-soft); text-decoration: none; }
.card-menu-danger { color: var(--danger) !important; }
.card-menu-form { margin: 0; padding: 0; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px var(--space-4);
    color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: var(--space-3); opacity: 0.35; }
.empty-state p { margin: 0 0 var(--space-4); font-size: 14px; }

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 440px;
    margin: var(--space-4);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: 15px; }
.modal-body { padding: var(--space-5); }
.modal-body-flush { padding-bottom: 0; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border);
}

/* ── Color picker ────────────────────────────────────── */
.color-picker { display: flex; gap: var(--space-2); margin-top: var(--space-1); }
.color-opt {
    width: 24px; height: 24px;
    border-radius: var(--radius);
    border: 2.5px solid transparent;
    cursor: pointer;
    padding: 0;
    outline-offset: 2px;
}
.color-opt.selected { border-color: var(--text); }

/* ── Section flash banner ────────────────────────────── */
.section-flash { margin: 0; border-radius: 0; border-left: 0; border-right: 0; }

/* ── Section view ────────────────────────────────────── */
.section-page { max-width: 900px; margin: 0 auto; }

.section-header {
    padding: 14px var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.section-breadcrumb { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.section-breadcrumb a { color: var(--text-muted); }
.section-breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.section-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: var(--space-2); }
.section-desc-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.section-header-right { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* ── Filter bar ──────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-wrap: wrap;
    position: sticky;
    top: 49px;
    z-index: 5;
}
.view-toggle { display: flex; gap: var(--space-1); }
.filter-sep { width: 1px; height: 14px; background: var(--border); flex-shrink: 0; }
.filter-search { width: 140px; padding: 4px 8px; font-size: 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: transparent; color: var(--text); }
.filter-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--bg-card); }

/* ── Task list ───────────────────────────────────────── */
.task-list-wrap { padding: var(--space-3) var(--space-4); }

.task-table {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.task-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
    min-width: 0;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--bg-soft); }
.task-row.dragging { opacity: 0.4; }
.task-row.drag-over { border-top: 2px solid var(--accent); }

.task-title-wrap { flex: 1; min-width: 0; cursor: pointer; }
.task-title {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-title.is-done { color: var(--text-muted); text-decoration: line-through; }
.task-title.is-conf { color: var(--text-muted); }

.task-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.task-date.is-overdue { color: var(--danger); font-weight: 600; }
.task-date.is-soon    { color: var(--warn); }
.task-avatar { flex-shrink: 0; }
.task-creator-name { margin-left: 6px; font-size: 13px; }

/* ── Status dot / dropdown ───────────────────────────── */
.status-wrap { position: relative; flex-shrink: 0; }
.status-btn { background: transparent; border: 0; cursor: pointer; padding: 3px; border-radius: var(--radius); display: flex; align-items: center; }
.status-btn:hover { background: var(--bg-soft); }
.status-dropdown {
    position: absolute;
    left: 0; top: calc(100% + 4px);
    z-index: 30;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 148px;
    padding: 4px 0;
}
.status-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    border: 0;
    width: 100%;
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--text);
}
.status-option:hover { background: var(--bg-soft); }
.status-option.is-active { background: var(--bg-soft); font-weight: 700; }

/* ── Grouped view ────────────────────────────────────── */
.group-block {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--space-2);
}
.group-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    background: var(--bg-soft);
    cursor: pointer;
    user-select: none;
}
.group-head:hover { background: var(--bg-card); }
.group-head-count { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.group-head-chevron { font-size: 10px; color: var(--text-muted); transition: transform 0.15s; }
.group-head-chevron.open { transform: rotate(90deg); }
.group-add-row {
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    background: var(--bg-soft);
    cursor: pointer;
}
.group-add-row:hover { color: var(--text); background: var(--bg-card); }
.group-empty { padding: 10px 12px; font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ── Task empty state ────────────────────────────────── */
.task-empty { text-align: center; padding: 48px var(--space-4); color: var(--text-muted); }
.task-empty p { margin: 0 0 var(--space-4); }

/* ── Task modal ──────────────────────────────────────── */
.task-modal-inner { max-width: 480px; }
.task-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

.status-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.status-chip { cursor: pointer; opacity: 0.45; }
.status-chip.selected { opacity: 1; border-width: 2px; }

/* ── View toggle (list/grouped visibility) ───────────── */
#task-content[data-view="list"] #grouped-view { display: none; }
#task-content[data-view="grouped"] #list-view  { display: none; }

/* ── Members page ───────────────────────────────────── */
.members-page { max-width: 760px; }
.members-page .page-title { display: flex; align-items: center; gap: var(--space-2); }

.member-list { list-style: none; padding: 0; margin: 0; }
.member-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: 0; }
.member-meta { min-width: 0; }
.member-name { font-weight: 600; font-size: 14px; }
.member-self { color: var(--text-muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.member-email, .member-joined { font-size: 12px; }
.member-role { display: flex; align-items: center; }
.member-role-form { margin: 0; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.member-form { margin: 0; padding: 0; display: inline-block; }
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    font-size: 12px;
    color: var(--text-muted);
}
.role-badge.role-owner { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.invite-grid {
    display: grid;
    grid-template-columns: 1fr 160px auto;
    gap: var(--space-3);
    align-items: end;
}
.invite-submit { margin-bottom: 0; }
.back-link { margin-top: var(--space-4); }
.back-link a { color: var(--text-muted); text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* ── Invite acceptance screens ──────────────────────── */
.invite-card { max-width: 520px; }
.invite-intro { font-size: 14px; line-height: 1.5; margin: 0 0 var(--space-4); }
.invite-mismatch-title { font-size: 16px; margin: 0 0 var(--space-2); color: var(--danger); }
.invite-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.invite-form-inline { margin: 0; display: inline-block; }

/* ── Errors ─────────────────────────────────────────── */
.error-page { max-width: 560px; margin: 80px auto; padding: var(--space-5); text-align: center; }
.error-page h1 { font-size: 64px; margin: 0 0 var(--space-4); }

/* ── Mobile nav ──────────────────────────────────────── */
.mobile-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 0;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.mobile-nav-link:last-child { border-bottom: 0; }
.mobile-nav-link:hover { text-decoration: none; }
.mobile-nav-search { margin-bottom: 0; border-bottom: 1px solid var(--border); padding-bottom: var(--space-3); }
.mobile-nav-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 0;
}

/* ── FAB ─────────────────────────────────────────────── */
.fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 26px;
    line-height: 1;
    border: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    z-index: 50;
    align-items: center;
    justify-content: center;
}

/* ── Responsive: desktop 2-col section list ─────────── */
@media (min-width: 640px) {
    .section-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }
    .section-card { margin-bottom: 0; }
}

/* ── Responsive: mobile ──────────────────────────────── */
@media (max-width: 640px) {
    /* Header */
    .app-search-wrap { display: none; }
    .user-menu       { display: none; }
    .lang-toggle     { display: none; }
    .theme-toggle    { display: none; }
    .notif-wrap      { margin-left: auto; }
    .hamburger       { display: inline-flex; }

    /* FAB */
    .fab { display: inline-flex; }

    /* Modal bottom-sheet */
    .modal-backdrop { align-items: flex-end; }
    .modal {
        margin: 0;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Hero */
    .hero-title { font-size: 24px; }

    /* Task row — hide secondary columns */
    .task-avatar { display: none; }

    /* Filter bar — horizontal scroll */
    .filter-bar { overflow-x: auto; flex-wrap: nowrap; }

    /* Dashboard toolbar */
    .dash-toolbar { gap: var(--space-1); }

    /* Member row */
    .member-row {
        grid-template-columns: auto 1fr;
        grid-template-areas: "avatar meta" "role role" "actions actions";
        row-gap: var(--space-2);
    }
    .member-row .avatar { grid-area: avatar; }
    .member-meta        { grid-area: meta; }
    .member-role        { grid-area: role; }
    .member-actions     { grid-area: actions; justify-content: flex-start; }
    .invite-grid        { grid-template-columns: 1fr; }
}
