:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3e;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --text: #e2e8f0;
    --text-muted: #8892a4;
    --danger: #e53e3e;
    --danger-hover: #c53030;
    --success: #38a169;
    --radius: 8px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }

.nav-username {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: var(--font);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}

.card:hover { border-color: #3d4060; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.15s;
}

.card-title:hover { color: var(--accent); }

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.card-body {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Attachments ───────────────────────────────────────────────────────────── */
.attachments {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    color: var(--text);
    transition: border-color 0.15s, color 0.15s;
    max-width: 260px;
    overflow: hidden;
}

.attachment-chip:hover { border-color: var(--accent); color: var(--accent); }

.chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-size {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    font-family: var(--font);
    transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea { resize: vertical; min-height: 120px; }

.file-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.file-drop:hover { border-color: var(--accent); background: rgba(108, 99, 255, 0.04); }
.file-drop.drag-over { border-color: var(--accent); background: rgba(108, 99, 255, 0.08); }

.file-drop input[type="file"] { display: none; }

.file-drop-label { color: var(--text-muted); font-size: 0.9rem; }
.file-drop-hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.3rem; }

.file-list { margin-top: 0.75rem; }

.file-list-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.2rem 0;
    display: flex;
    justify-content: space-between;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    display: inline;
    margin-bottom: 0;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(229, 62, 62, 0.12);
    border: 1px solid rgba(229, 62, 62, 0.4);
    color: #fc8181;
}

.alert-success {
    background: rgba(56, 161, 105, 0.12);
    border: 1px solid rgba(56, 161, 105, 0.4);
    color: #68d391;
}

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-wrapper {
    max-width: 400px;
    margin: 6rem auto;
    padding: 0 1rem;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th {
    text-align: left;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-admin { background: rgba(108, 99, 255, 0.18); color: var(--accent); }
.badge-user  { background: rgba(139, 148, 158, 0.15); color: var(--text-muted); }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 1rem; }

/* ── Two-column form grid ──────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

@media (max-width: 540px) {
    .grid-2 { grid-template-columns: 1fr; }
    .navbar { padding: 0 1rem; }
    .container { padding: 1.5rem 1rem; }
}

/* ── Section heading ───────────────────────────────────────────────────────── */
.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

/* ── Nav active ────────────────────────────────────────────────────────────── */
.nav-active { color: var(--text) !important; font-weight: 600; }

/* ── Expiry badge ──────────────────────────────────────────────────────────── */
.expiry-badge { color: #f6ad55; font-size: 0.78rem; }

/* ── Expiry buttons (new post) ─────────────────────────────────────────────── */
.expire-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expire-btn {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.15s;
    user-select: none;
}

.expire-btn input[type="radio"] { display: none; }
.expire-btn:hover { border-color: var(--text-muted); color: var(--text); }
.expire-btn.selected { background: rgba(108,99,255,0.15); border-color: var(--accent); color: var(--accent); }

/* ── Status buttons (objectives) ───────────────────────────────────────────── */
.status-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-btn {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: all 0.15s;
    user-select: none;
}

.status-btn input[type="radio"] { display: none; }
.status-btn:hover { border-color: var(--text-muted); color: var(--text); }

.status-btn.status-pendente.selected    { background: rgba(139,148,158,0.2);  border-color: var(--text-muted); color: var(--text); }
.status-btn.status-em_andamento.selected { background: rgba(108,99,255,0.18); border-color: var(--accent);     color: var(--accent); }
.status-btn.status-concluido.selected   { background: rgba(56,161,105,0.18);  border-color: var(--success);    color: var(--success); }
.status-btn.status-abandonado.selected  { background: rgba(229,62,62,0.15);   border-color: var(--danger);     color: var(--danger); }

/* ── Objective quick action buttons ────────────────────────────────────────── */
.obj-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.obj-action-btn {
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: var(--font);
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.obj-action-done   { color: var(--success); border-color: rgba(56,161,105,0.4); }
.obj-action-done:hover { background: rgba(56,161,105,0.15); border-color: var(--success); }

.obj-action-start  { color: var(--accent); border-color: rgba(108,99,255,0.4); }
.obj-action-start:hover { background: rgba(108,99,255,0.15); border-color: var(--accent); }

.obj-action-cancel { color: var(--danger); border-color: rgba(229,62,62,0.4); }
.obj-action-cancel:hover { background: rgba(229,62,62,0.12); border-color: var(--danger); }

.obj-action-reopen { color: var(--text-muted); border-color: var(--border); }
.obj-action-reopen:hover { color: var(--text); border-color: var(--text-muted); }

.obj-action-edit   { color: var(--text-muted); border-color: var(--border); }
.obj-action-edit:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.badge-pendente    { background: rgba(139,148,158,0.15); color: var(--text-muted); }
.badge-em_andamento { background: rgba(108,99,255,0.18); color: var(--accent); }
.badge-concluido   { background: rgba(56,161,105,0.15); color: var(--success); }
.badge-abandonado  { background: rgba(229,62,62,0.12); color: var(--danger); }

/* ── Date / time / select inputs ───────────────────────────────────────────── */
input[type="date"],
input[type="time"],
select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    font-family: var(--font);
    transition: border-color 0.15s;
    appearance: none;
}

input[type="date"]:focus,
input[type="time"]:focus,
select:focus { outline: none; border-color: var(--accent); }

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* ── Task items ────────────────────────────────────────────────────────────── */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.task-item:last-child { border-bottom: none; }

.task-item.done .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-check-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1.5;
    flex-shrink: 0;
    transition: color 0.15s;
}

.task-check-btn:hover { color: var(--accent); }

.task-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.task-item:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { color: var(--danger); }

.task-content { flex: 1; min-width: 0; }

.task-title { font-size: 0.95rem; word-break: break-word; }

.task-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── Group headers (agenda) ────────────────────────────────────────────────── */
.group-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.25rem 0 0.4rem;
}

.group-overdue { color: var(--danger); }

/* ── Hub dashboard grid ────────────────────────────────────────────────────── */
.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hub-shortcut {
    text-align: center;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s;
}

.hub-shortcut:hover { border-color: var(--accent); }

.hub-shortcut-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }

.hub-shortcut-label { font-weight: 600; font-size: 1rem; color: var(--text); }

.hub-shortcut-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }

@media (max-width: 540px) {
    .hub-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   CANAIS — layout completo estilo Discord
   ══════════════════════════════════════════════════════════════════════════════ */

main.canais-outer {
    padding: 0;
    max-width: none;
    margin: 0;
}

.canais-wrap {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    overflow: hidden;
    z-index: 1;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.canais-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #111216;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Server/hub name bar */
.sidebar-top {
    height: 48px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,0.4);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    cursor: default;
}

.sidebar-top-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.3rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.sidebar-top-icon:hover { color: var(--text); background: rgba(255,255,255,0.07); }

/* Scrollable channel list */
.sidebar-channels {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #2a2d3e transparent;
}
.sidebar-channels::-webkit-scrollbar { width: 4px; }
.sidebar-channels::-webkit-scrollbar-thumb { background: #2a2d3e; border-radius: 2px; }

/* Category header */
.sidebar-category { margin-top: 0.25rem; }

.cat-header {
    padding: 0.9rem 0.5rem 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8e9297;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.cat-header:hover { color: #dcddde; }

.cat-arrow {
    font-size: 0.6rem;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.cat-name { flex: 1; }

.cat-add-btn {
    background: none;
    border: none;
    color: #8e9297;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}
.sidebar-category:hover .cat-add-btn { opacity: 1; }
.cat-add-btn:hover { color: #dcddde; }

/* Channel items */
.cat-channels { padding: 0 0.5rem; }

.channel-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.5rem 0.28rem 0.75rem;
    margin: 1px 0;
    border-radius: 4px;
    color: #8e9297;
    font-size: 0.875rem;
    transition: background 0.1s, color 0.1s;
    text-decoration: none;
    position: relative;
}
.channel-item:hover {
    background: rgba(255,255,255,0.06);
    color: #dcddde;
}
.channel-active {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

.channel-hash {
    color: #5c6370;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}
.channel-item:hover .channel-hash,
.channel-active .channel-hash { color: #8e9297; }

.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.channel-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    opacity: 0;
    transition: opacity 0.1s;
}
.channel-item:hover .channel-actions,
.channel-active .channel-actions { opacity: 1; }

.ch-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: #8e9297;
    text-decoration: none;
    transition: color 0.1s, background 0.1s;
}
.ch-action:hover { color: #dcddde; background: rgba(255,255,255,0.1); }

/* Bottom user panel */
.sidebar-user-panel {
    background: #0c0d10;
    border-top: 1px solid rgba(0,0,0,0.3);
    padding: 0.5rem 0.5rem 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.user-panel-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-panel-info { flex: 1; min-width: 0; }

.user-panel-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.user-panel-status {
    font-size: 0.68rem;
    color: #8e9297;
    line-height: 1.2;
}

.user-panel-controls {
    display: flex;
    gap: 0.1rem;
    flex-shrink: 0;
}

.panel-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #8e9297;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.panel-btn:hover { color: #dcddde; background: rgba(255,255,255,0.08); }

/* ── Content area ───────────────────────────────────────────────────────────── */
.canais-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg);
}

/* Topbar */
.channel-topbar {
    height: 48px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    background: var(--bg);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.topbar-hash {
    color: #5c6370;
    font-size: 1.3rem;
    font-weight: 400;
    flex-shrink: 0;
}

.topbar-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

.topbar-desc {
    color: #8e9297;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.topbar-actions { display: flex; gap: 0.25rem; margin-left: auto; }

.topbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #8e9297;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    transition: color 0.15s, background 0.15s;
}
.topbar-btn:hover { color: #dcddde; background: rgba(255,255,255,0.06); }
.topbar-btn.danger:hover { color: var(--danger); background: rgba(229,62,62,0.1); }

/* ── Messages area ──────────────────────────────────────────────────────────── */
.canais-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #2a2d3e transparent;
}
.canais-messages::-webkit-scrollbar { width: 5px; }
.canais-messages::-webkit-scrollbar-thumb { background: #2a2d3e; border-radius: 3px; }

/* Welcome screen (empty channel) */
.channel-welcome {
    padding: 1.5rem 0.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.welcome-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #2a2d3e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #dcddde;
    margin-bottom: 1rem;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.welcome-desc {
    color: #8e9297;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Message rows */
.msg {
    display: flex;
    gap: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.08s;
    margin-bottom: 0;
    margin-top: 0.45rem;
}
.msg:hover { background: rgba(255,255,255,0.025); }
.msg:hover .msg-delete-btn { opacity: 1; }

/* Grouped message (same author < 20s) */
.msg-grouped {
    margin-top: 0.18rem;
    padding-top: 0.05rem;
    padding-bottom: 0.05rem;
}

.msg-grouped-spacer {
    width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 3px;
}

.msg-grouped-ts {
    font-size: 0.63rem;
    color: transparent;
    transition: color 0.12s;
    user-select: none;
    line-height: 1.6;
}
.msg-grouped:hover .msg-grouped-ts { color: #72767d; }

.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.msg-body { flex: 1; min-width: 0; }

.msg-meta {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-bottom: 0.1rem;
}

.msg-author {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.msg-time {
    font-size: 0.7rem;
    color: #8e9297;
}

.msg-delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #8e9297;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.2rem;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
    line-height: 1;
    border-radius: 3px;
}
.msg-delete-btn:hover { color: var(--danger); background: rgba(229,62,62,0.1); }

.msg-text {
    font-size: 0.875rem;
    color: #dcddde;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-attachment { margin-top: 0.35rem; }

.msg-image {
    max-width: min(400px, 75%);
    max-height: 300px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.msg-video {
    max-width: min(500px, 85%);
    border-radius: 6px;
    display: block;
}

.msg-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e2030;
    border: 1px solid var(--border);
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
    transition: border-color 0.15s;
}
.msg-file-chip:hover { border-color: var(--accent); }

/* Date separator */
.msg-date-sep {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0 0.5rem;
    color: #8e9297;
    font-size: 0.72rem;
    font-weight: 600;
}
.msg-date-sep::before,
.msg-date-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Input bar ──────────────────────────────────────────────────────────────── */
.canais-input-bar {
    padding: 0 1rem 1.25rem;
    flex-shrink: 0;
}

.msg-form { display: flex; flex-direction: column; gap: 0.35rem; }

.msg-input-row {
    display: flex;
    align-items: center;
    background: #2c2f3a;
    border-radius: 10px;
    overflow: hidden;
    min-height: 44px;
}

.msg-plus-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8e9297;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: color 0.15s;
    user-select: none;
}
.msg-plus-btn:hover { color: #dcddde; }

.msg-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 0.65rem 0;
    color: #dcddde;
    font-size: 0.9rem;
    font-family: var(--font);
    min-width: 0;
    resize: none;
    line-height: 1.4;
    max-height: 140px;
    overflow-y: hidden;
    scrollbar-width: thin;
    display: block;
}
.msg-input::placeholder { color: #72767d; }

.msg-right-icons {
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
    gap: 0.1rem;
    flex-shrink: 0;
}

.msg-icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: #8e9297;
    border-radius: 4px;
    font-size: 1rem;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}
.msg-icon-btn:hover { color: #dcddde; background: rgba(255,255,255,0.08); }

.file-preview-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.file-preview-chip {
    background: #2c2f3a;
    padding: 0.2rem 0.4rem 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #8e9297;
    max-width: 260px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.file-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-chip-x {
    background: none;
    border: none;
    color: #72767d;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.file-chip-x:hover { color: #fff; background: var(--danger); }

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: #1e2030;
    border-radius: 8px;
    padding: 1.5rem;
    width: 440px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.modal-hint {
    font-size: 0.78rem;
    color: #8e9297;
    margin-top: 0.25rem;
}

/* ── Context menu ───────────────────────────────────────────────────────────── */
.ctx-menu {
    position: fixed;
    background: #111216;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    padding: 0.35rem;
    z-index: 600;
    min-width: 170px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    display: none;
}
.ctx-menu.open { display: block; }

.ctx-item {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: #dcddde;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    user-select: none;
    transition: background 0.1s, color 0.1s;
}
.ctx-item:hover { background: var(--accent); color: #fff; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .canais-sidebar { width: 180px; }
    .topbar-desc { display: none; }
    .topbar-divider { display: none; }
}
