/* ═══════════════════════════════════════
   TASKFLOW — CSS PRINCIPAL
   Estética: Dark Industrial / Minimalista
═══════════════════════════════════════ */

:root {
    --bg:        #0b0f1a;
    --surface:   #131929;
    --surface2:  #1a2235;
    --border:    #1e2d47;
    --border2:   #243450;
    --text:      #e2e8f0;
    --text-base: #e2e8f0;
    --text-muted:#6b7fa8;
    --text-dim:  #3d5070;
    --accent:    #3b82f6;
    --accent-h:  #2563eb;
    --accent-glow: rgba(59,130,246,0.25);
    --green:     #10b981;
    --yellow:    #f59e0b;
    --red:       #ef4444;
    --admin-clr: #f43f5e;
    --colab-clr: #10b981;
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 8px 32px rgba(0,0,0,0.4);
    --trans:     0.18s ease;
}

/* ── LIGHT MODE ── */
body.light-mode {
    --bg:        #f0f4f8;
    --surface:   #ffffff;
    --surface2:  #e8edf5;
    --border:    #d0d9e8;
    --border2:   #b8c5d9;
    --text:      #1a2235;
    --text-base: #1a2235;
    --text-muted:#5a6a85;
    --text-dim:  #8a9ab5;
    --accent:    #2563eb;
    --accent-h:  #1d4ed8;
    --accent-glow: rgba(37,99,235,0.2);
    --shadow:    0 4px 20px rgba(0,0,0,0.1);
}
.senha-strength { margin-top: 8px; margin-bottom: 4px; }
.strength-bar-wrap { display: flex; gap: 4px; margin-bottom: 6px; }
.strength-bar-wrap .bar { flex: 1; height: 4px; border-radius: 99px; background: var(--border); transition: background 0.3s; }
.strength-bar-wrap .bar.active-1 { background: #ef4444; }
.strength-bar-wrap .bar.active-2 { background: #f97316; }
.strength-bar-wrap .bar.active-3 { background: #eab308; }
.strength-bar-wrap .bar.active-4 { background: #22c55e; }
.strength-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; }
.strength-label.s1 { color: #ef4444; } .strength-label.s2 { color: #f97316; }
.strength-label.s3 { color: #eab308; } .strength-label.s4 { color: #22c55e; }
.senha-checklist { list-style: none; padding: 0; margin: 0 0 8px 0; display: flex; flex-direction: column; gap: 4px; }
.senha-checklist li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); transition: color 0.2s; }
.senha-checklist li.ok { color: #22c55e; }
.senha-checklist li .chk-icon { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 9px; }
.senha-checklist li.ok .chk-icon { background: #22c55e; border-color: #22c55e; color: #fff; }
.toggle-wrap { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; user-select: none; }
.toggle-wrap input[type=checkbox] { display: none; }
.toggle-track { width: 40px; height: 22px; background: var(--border2); border-radius: 11px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: transform 0.2s; }
.toggle-wrap.on .toggle-track { background: var(--accent); }
.toggle-wrap.on .toggle-track::after { transform: translateX(18px); }
.toggle-label { font-size: 14px; color: var(--text); line-height: 1.3; }
.toggle-sublabel { font-size: 12px; color: var(--text-muted); }

body.light-mode .app-header {
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
}
body.light-mode .sidebar {
    background: #ffffff;
}
body.light-mode .task-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.light-mode .task-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
body.light-mode .modal-box {
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
body.light-mode .tasks-table thead tr {
    background: #f0f4f8;
}
body.light-mode .task-row:hover td {
    background: #f8fafc;
}
body.light-mode .field-input,
body.light-mode .field-select,
body.light-mode .task-status-select {
    background: #f8fafc;
    color: var(--text);
    border-color: var(--border);
}
body.light-mode .field-select option,
body.light-mode .task-status-select option {
    background: #ffffff;
    color: #1a2235;
}
body.light-mode .screen-login-inner {
    background: #ffffff;
}
body.light-mode .perfil-badge.master { background: rgba(124,58,237,0.12); color: #7c3aed; }
body.light-mode .perfil-badge.admin  { background: rgba(244,63,94,0.12);  color: #e11d48; }
body.light-mode .perfil-badge.colab  { background: rgba(16,185,129,0.12); color: #059669; }
body.light-mode .comment-item { background: #f8fafc; }
body.light-mode .historico-item { background: #f0f4f8; }
body.light-mode .usuario-card  { background: #f8fafc; }
body.light-mode .relatorio-pessoa { background: #ffffff; }
body.light-mode .relatorio-pessoa-header { background: #f0f4f8; }
body.light-mode .relatorio-table th { background: #f8fafc; }

/* Suave transição ao trocar tema */
body, body * {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Botão tema */
.btn-theme {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.btn-theme:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scroll horizontal apenas para elementos específicos */
.tasks-table-wrap,
.resp-filter-bar,
#dash-grafico {
    overflow-x: auto;
}

/* ── SCREENS ── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
#screen-login {
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.login-bg { position: absolute; inset: 0; pointer-events: none; }

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
}
.orb1 { width: 400px; height: 400px; background: #3b82f6; top: -100px; left: -100px; }
.orb2 { width: 300px; height: 300px; background: #8b5cf6; bottom: -80px; right: -80px; }
.orb3 { width: 200px; height: 200px; background: #06b6d4; top: 40%; left: 60%; }

.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 40px 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 20px;
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from { opacity:0; transform: translateY(24px); }
    to   { opacity:1; transform: translateY(0); }
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
}

.logo-mark {
    width: 52px; height: 52px;
    background: var(--accent);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.logo-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--text);
    line-height: 1;
}

.logo-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }

.login-hint { text-align: center; }
.login-hint p { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

.hint-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.chip {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 12px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: var(--trans);
    background: transparent;
}
.chip-admin { border-color: var(--admin-clr); color: var(--admin-clr); }
.chip-admin:hover { background: rgba(244,63,94,0.12); }
.chip-colab { border-color: var(--colab-clr); color: var(--colab-clr); }
.chip-colab:hover { background: rgba(16,185,129,0.12); }

/* ══════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════ */
.field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.field-input, .field-textarea, .field-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    transition: border-color var(--trans), box-shadow var(--trans);
    outline: none;
    appearance: none;
}

.field-input:focus, .field-textarea:focus, .field-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-textarea { resize: vertical; min-height: 80px; }
.field-select { cursor: pointer; }
.field-select option { background: var(--surface2); }

.error-msg {
    font-size: 13px;
    color: var(--red);
    padding: 8px 12px;
    background: rgba(239,68,68,0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239,68,68,0.2);
}

/* ══════════════════════════════════════
   BOTÕES
══════════════════════════════════════ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
    white-space: nowrap;
}
.btn-primary:hover {
    background: var(--accent-h);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.full { width: 100%; justify-content: center; }

.btn-ghost {
    padding: 12px 20px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: var(--trans);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
    padding: 8px 14px;
    background: transparent;
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: var(--trans);
}
.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--red); }

.btn-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--trans);
}
.btn-icon:hover { background: var(--surface2); color: var(--text); }

/* ══════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════ */
#screen-app {
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    background: rgba(11,15,26,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-left { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 12px; position: relative; }

.menu-btn {
    background: none; border: none;
    display: flex; flex-direction: column; gap: 5px;
    cursor: pointer; padding: 4px;
}
.menu-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: var(--trans);
}
.menu-btn:hover span { background: var(--text); }

.header-brand { display: flex; align-items: center; gap: 8px; }

.header-logo {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 800; font-size: 12px; color: white;
}

.header-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700; font-size: 16px;
}

.perfil-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.perfil-badge.admin  { background: rgba(244,63,94,0.15);  color: var(--admin-clr); border: 1px solid rgba(244,63,94,0.3); }
.perfil-badge.colab  { background: rgba(16,185,129,0.12); color: var(--colab-clr); border: 1px solid rgba(16,185,129,0.25); }
.perfil-badge.master { background: rgba(139,92,246,0.18); color: #a78bfa;           border: 1px solid rgba(139,92,246,0.4); }
.comment-author.master { color: #a78bfa; }

.avatar-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface2);
    border: 2px solid var(--border);
    color: var(--text);
    font-family: 'Syne', sans-serif;
    font-weight: 700; font-size: 13px;
    cursor: pointer;
    transition: border-color var(--trans);
    display: flex; align-items: center; justify-content: center;
}
.avatar-btn:hover { border-color: var(--accent); }

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 200px;
    z-index: 200;
    animation: fadeDown 0.15s ease;
}

@keyframes fadeDown {
    from { opacity:0; transform: translateY(-8px); }
    to   { opacity:1; transform: translateY(0); }
}

.user-menu-info { padding: 14px 16px; }
.menu-nome { font-weight: 600; font-size: 14px; }
.menu-funcao { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.menu-divider { border: none; border-top: 1px solid var(--border); }
.menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 12px 16px;
    background: none; border: none;
    color: var(--text-muted); font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer; text-align: left;
    transition: var(--trans);
}
.menu-item:hover { background: var(--surface2); color: var(--text); }
.menu-logout { color: var(--red); }
.menu-logout:hover { background: rgba(239,68,68,0.08); }

/* ── SIDEBAR ── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
    backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

.sidebar {
    position: fixed;
    left: -280px;
    top: 0; bottom: 0;
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 160;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    padding-bottom: 20px;
}
.sidebar.open { left: 0; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; }
.close-sidebar {
    background: none; border: none;
    color: var(--text-muted); font-size: 18px;
    cursor: pointer; padding: 4px;
    transition: color var(--trans);
}
.close-sidebar:hover { color: var(--text); }

.sidebar-nav { list-style: none; padding: 12px 12px 0; flex: 1; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: var(--trans);
    text-decoration: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(59,130,246,0.12); color: var(--accent); }

.sidebar-install { padding: 0 12px; margin-top: auto; }
.btn-install {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 12px 14px;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: var(--trans);
}
.btn-install:hover { background: rgba(59,130,246,0.15); }

/* ── MAIN CONTENT ── */
.app-main {
    flex: 1;
    padding: 24px 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.page { display: none; }
.page.active { display: block; animation: fadeUp 0.3s ease; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.page-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 22px; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── FILTERS ── */
.filters-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.filter-chip {
    padding: 6px 16px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: var(--trans);
}
.filter-chip:hover { border-color: var(--border2); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── TASK GRID ── */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans);
    position: relative;
    overflow: hidden;
}
.task-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--text-dim);
    transition: background var(--trans);
}
.task-card:hover {
    transform: translateY(-2px);
    border-color: var(--border2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.task-card:hover::before { background: var(--accent); }

.task-card.status-nao::before { background: var(--text-dim); }
.task-card.status-andamento::before { background: var(--yellow); }
.task-card.status-finalizado::before { background: var(--green); }

.task-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.task-code {
    font-family: 'Syne', sans-serif;
    font-size: 12px; font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
}
.task-date { font-size: 11px; color: var(--text-dim); }

.task-desc {
    font-size: 15px; font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 16px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}

.task-colab {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-muted);
}
.colab-dot {
    width: 24px; height: 24px;
    background: var(--surface2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
    border: 1px solid var(--border);
}

.task-status-select {
    padding: 5px 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: var(--trans);
}
.task-status-select:focus { border-color: var(--accent); }

.task-actions {
    display: flex; gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.dblclick-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-dim);
    margin-top: 8px;
}

/* ── STATUS BADGE ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.status-badge.nao { background: rgba(107,127,168,0.12); color: var(--text-muted); }
.status-badge.andamento { background: rgba(245,158,11,0.12); color: var(--yellow); }
.status-badge.finalizado { background: rgba(16,185,129,0.12); color: var(--green); }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }

/* ── USUARIOS ── */
.usuarios-list { display: flex; flex-direction: column; gap: 10px; }

.usuario-card {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: var(--trans);
    gap: 12px;
}
.usuario-card:hover { border-color: var(--border2); }

.usuario-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.usuario-info > div { min-width: 0; }
.usuario-nome  { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-funcao { font-size: 12px; color: var(--text-dim); }

.usuario-acoes {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end;
}

@media (max-width: 600px) {
    .usuario-card {
        flex-wrap: wrap;
        padding: 14px 16px;
        gap: 10px;
    }
    .usuario-info { flex: 1 1 100%; }
    .usuario-acoes {
        flex: 1 1 100%;
        justify-content: flex-start;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        gap: 6px;
    }
    .usuario-acoes .perfil-badge { display: none; }
}

.usuario-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   MODAIS
══════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
    animation: slideUp 0.25s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-box.task-editing {
    border-color: var(--yellow);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), var(--shadow);
}

.modal-box.task-editing .modal-header h3 {
    color: var(--yellow);
}

.modal-task-badge {
    align-self: center;
    margin-top: 2px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--yellow);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.modal-large { max-width: 560px; }

@keyframes slideUp {
    from { opacity:0; transform: translateY(20px); }
    to   { opacity:1; transform: translateY(0); }
}

.modal-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 24px 24px 0;
    gap: 16px;
}
.modal-header h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

.modal-close {
    background: none; border: none;
    color: var(--text-muted); font-size: 20px;
    cursor: pointer; padding: 2px;
    transition: color var(--trans);
    flex-shrink: 0;
    margin-top: -2px;
}
.modal-close:hover { color: var(--text); }

.modal-body {
    padding: 20px 24px;
    display: flex; flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 0 24px 24px;
}

/* ── COMMENTS ── */
.comments-area {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    min-height: 120px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comments-empty { font-size: 13px; color: var(--text-dim); text-align: center; margin: auto; }

.comment-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    animation: fadeUp 0.2s ease;
}
.comment-text { font-size: 14px; line-height: 1.5; margin-bottom: 6px; }
.comment-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--text-dim);
}
.comment-author {
    font-weight: 600;
    color: var(--text-muted);
}
.comment-author.admin { color: var(--admin-clr); }
.comment-author.colab { color: var(--colab-clr); }

.comment-input-area { display: flex; flex-direction: column; gap: 10px; }

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 14px;
    box-shadow: var(--shadow);
    z-index: 500;
    animation: toastIn 0.25s ease;
    white-space: nowrap;
    display: flex; align-items: center; gap: 8px;
}

@keyframes toastIn {
    from { opacity:0; transform: translateX(-50%) translateY(12px); }
    to   { opacity:1; transform: translateX(-50%) translateY(0); }
}

.toast.success { border-color: rgba(16,185,129,0.4); color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,0.4); color: var(--red); }

/* ── CAMPO SENHA com botão olho ── */
.input-password-wrap {
    position: relative;
    width: 100%;
}
.input-password-wrap .field-input {
    padding-right: 44px;
}
.btn-toggle-pw {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex; align-items: center;
    transition: color var(--trans);
}
.btn-toggle-pw:hover { color: var(--text-muted); }

/* ── Badge troca pendente ── */
.badge-senha {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(245,158,11,0.12);
    color: var(--yellow);
    border: 1px solid rgba(245,158,11,0.25);
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ══════════════════════════════════════
   RESPONSÁVEIS — AVATARES NO CARD
══════════════════════════════════════ */
.task-responsaveis {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.resp-group { display: flex; align-items: center; }

.resp-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: 2px solid var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-size: 10px; font-weight: 700;
    color: var(--text-muted);
    margin-left: -6px;
    transition: var(--trans);
}
.resp-avatar:first-child { margin-left: 0; }
.resp-avatar:hover { z-index: 2; transform: scale(1.1); }

/* ── Wrap para posicionar o ponto online ── */
.resp-avatar-wrap {
    position: relative;
    display: inline-flex;
    margin-left: -6px;
    flex-shrink: 0;
}
.resp-avatar-wrap:first-child { margin-left: 0; }
.resp-avatar-wrap .resp-avatar { margin-left: 0; }

/* ── Ponto online ── */
.online-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
    transition: background 0.3s ease;
    z-index: 3;
}
.online-dot-active {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,.25);
    animation: pulse-online 2s infinite;
}
@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
    50%       { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

/* Dot maior nos cards de usuário */
.usuario-avatar ~ .online-dot,
.resp-avatar-wrap:has(.usuario-avatar) .online-dot {
    width: 12px; height: 12px;
    bottom: 1px; right: 1px;
}

.resp-extra { background: var(--border2); color: var(--text-dim); font-size: 9px; }

.sem-responsavel { font-size: 12px; color: var(--text-dim); font-style: italic; }

.btn-edit-resp {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: transparent;
    border: 1px dashed var(--border2);
    color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--trans);
    margin-left: 4px;
    flex-shrink: 0;
}
.btn-edit-resp:hover { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,0.08); }

/* ── SELETOR DE RESPONSÁVEIS (modal) ── */
.resp-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.resp-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--trans);
}
.resp-checkbox input[type=checkbox] { display: none; }
.resp-checkbox:hover { border-color: var(--border2); background: var(--surface2); }
.resp-checkbox.checked { border-color: var(--accent); background: rgba(59,130,246,0.06); }

.resp-check-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
    transition: var(--trans);
}
.resp-checkbox.checked .resp-check-avatar { background: var(--accent); color: white; border-color: var(--accent); }

.resp-check-info { flex: 1; }
.resp-check-nome   { font-size: 14px; font-weight: 500; display: block; }
.resp-check-funcao { font-size: 12px; color: var(--text-muted); }

.resp-check-mark {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: white; font-size: 11px;
    display: none;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}
.resp-checkbox.checked .resp-check-mark { display: flex; }

/* Admin colaborador — cor roxa */
.resp-check-avatar-admin {
    background: rgba(124,58,237,0.15);
    color: #a78bfa;
    border-color: rgba(124,58,237,0.3);
}
.resp-checkbox-admin.checked {
    border-color: #7c3aed;
    background: rgba(124,58,237,0.08);
}
.resp-checkbox-admin.checked .resp-check-avatar-admin {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}
.resp-checkbox-admin.checked .resp-check-mark {
    background: #7c3aed;
}
.resp-checkbox-admin:hover {
    border-color: rgba(124,58,237,0.5);
}

/* ══════════════════════════════════════
   HISTÓRICO NO MODAL DE COMENTÁRIOS
══════════════════════════════════════ */
.historico-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(59,130,246,0.04);
    border: 1px solid rgba(59,130,246,0.1);
    border-radius: var(--radius-sm);
    animation: fadeUp 0.2s ease;
}
.historico-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.historico-body { flex: 1; }
.historico-texto { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 3px; }
.comment-date { font-size: 11px; color: var(--text-dim); }

/* ══════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 640px) {
    .tasks-filter-top {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .tasks-filter-top .search-wrap {
        max-width: 100% !important;
        width: 100%;
        order: 1;
    }
    .resp-filter-bar {
        order: 2;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    #btn-limpar-filtros {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .resp-chip-nome {
        max-width: 70px;
    }
}

/* ══════════════════════════════════════
   BUSCA
══════════════════════════════════════ */
.search-filter-bar {
    margin-bottom: 12px;
}

/* Nova área de filtros reorganizada */
.tasks-filter-area { margin-bottom: 4px; }

.tasks-filter-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* Barra de chips de responsável */
.resp-filter-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.resp-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 5px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--trans);
    white-space: nowrap;
}
.resp-chip:hover { border-color: var(--accent); color: var(--text-base); }
.resp-chip.active {
    border-color: var(--accent);
    background: rgba(59,130,246,.12);
    color: var(--accent);
    font-weight: 600;
}
.resp-chip-av {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--surface2);
    font-size: 8px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    flex-shrink: 0;
}
.resp-chip.active .resp-chip-av {
    background: var(--accent);
    color: #fff;
}
.resp-chip-nome { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }

.search-wrap {
    position: relative;
    max-width: 420px;
}

.search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder { color: var(--text-dim); }

/* ══════════════════════════════════════
   TABELA DE TAREFAS (desktop)
══════════════════════════════════════ */
.tasks-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tasks-table thead tr {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
}

.tasks-table th {
    padding: 12px 16px;
    text-align: left;
    font-family: 'Syne', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.task-row {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: background var(--trans);
}

.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface2); }

.tasks-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.td-resp { width: 90px; }
.td-desc { max-width: 240px; }
.td-date { width: 130px; color: var(--text-muted); font-size: 13px; }
.td-prio { width: 100px; }
.td-status { width: 170px; }
.td-actions { width: 160px; min-width: 140px; }

/* Overflow actions menu (agrupa botões quando necessário) */
.td-actions { position: relative; }
.actions-more { display: inline-flex; align-items: center; position: relative; }
.actions-more-btn {
    width: 32px; height: 32px; border-radius: 8px; display:inline-flex; align-items:center; justify-content:center;
    background: var(--surface2); border: 1.5px solid transparent; cursor:pointer; color:var(--text-dim);
}
.actions-more-btn:hover { background: var(--surface); color:var(--text); }
.actions-menu {
    position: absolute;
    right: 0;
    top: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 8px;
    display: none;
    z-index: 500;
    min-width: 140px;
}
.actions-menu.open { display: block; }
.actions-menu .action-btn { display: inline-flex; margin: 4px; }

.table-desc {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    margin-right: 6px;
}

.table-resp-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-family: 'Syne', sans-serif;
    font-size: 10px; font-weight: 700;
    color: var(--text-muted);
    margin-right: 2px;
}

/* ─── COLUNA DE AÇÕES REDESENHADA ─── */
.td-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 6px;
    overflow: visible;
}

/* Botão de ação base */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: var(--surface2);
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    flex-shrink: 0;
    font-size: 15px;
    line-height: 1;
}
.action-btn:hover { transform: translateY(-1px); }

/* Checklist — verde */
.action-btn.action-checklist {
    color: #22c55e;
    border-color: rgba(34,197,94,0.25);
    background: rgba(34,197,94,0.08);
}
.action-btn.action-checklist:hover {
    background: rgba(34,197,94,0.18);
    border-color: #22c55e;
    box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}

/* Anexos — azul */
.action-btn.action-anexos {
    color: #60a5fa;
    border-color: rgba(96,165,250,0.25);
    background: rgba(96,165,250,0.08);
}
.action-btn.action-anexos:hover {
    background: rgba(96,165,250,0.18);
    border-color: #60a5fa;
    box-shadow: 0 2px 8px rgba(96,165,250,0.2);
}

/* Responsáveis — roxo */
.action-btn.action-resp {
    color: #a78bfa;
    border-color: rgba(167,139,250,0.25);
    background: rgba(167,139,250,0.08);
}
.action-btn.action-resp:hover {
    background: rgba(167,139,250,0.18);
    border-color: #a78bfa;
    box-shadow: 0 2px 8px rgba(167,139,250,0.2);
}

/* Excluir — vermelho */
.action-btn.action-delete {
    color: #f87171;
    border-color: rgba(248,113,113,0.25);
    background: rgba(248,113,113,0.08);
}
.action-btn.action-delete:hover {
    background: rgba(248,113,113,0.18);
    border-color: #f87171;
    box-shadow: 0 2px 8px rgba(248,113,113,0.2);
}

/* Badge contador dentro do botão de ação */
.action-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #3b82f6;
    color: #fff;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg);
    line-height: 1;
}
.action-badge.green  { background: #22c55e; }
.action-badge.blue   { background: #3b82f6; }

.btn-icon-danger {
    color: var(--red) !important;
    border-color: rgba(239,68,68,0.3) !important;
}
.btn-icon-danger:hover {
    background: rgba(239,68,68,0.1) !important;
    border-color: var(--red) !important;
}

/* Compact select na tabela */
.task-status-select.compact {
    font-size: 12px;
    padding: 4px 8px;
    width: 100%;
}

/* ══════════════════════════════════════
   BADGES — PRIORIDADE
══════════════════════════════════════ */
.badge-prio {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.prio-baixa  { background: rgba(107,127,168,0.12); color: var(--text-muted); border: 1px solid rgba(107,127,168,0.2); }
.prio-media  { background: rgba(245,158,11,0.12);  color: var(--yellow);     border: 1px solid rgba(245,158,11,0.2); }
.prio-alta   { background: rgba(239,68,68,0.12);   color: var(--red);        border: 1px solid rgba(239,68,68,0.2); }

/* ══════════════════════════════════════
   BADGE — TAREFA PESSOAL
══════════════════════════════════════ */
.badge-pessoal {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(139,92,246,0.12);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,0.2);
    margin-left: 4px;
    white-space: nowrap;
}

/* ── Badges de perspectiva: Delegada / Comigo ── */
.task-perspectiva {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.badge-perspectiva {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-transform: uppercase;
}
.badge-delegada {
    background: rgba(34,197,94,0.12);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,0.3);
}
.badge-comigo {
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}

/* ══════════════════════════════════════
   NOVOS STATUS — cores na barra lateral do card
══════════════════════════════════════ */
.task-card.status-iniciado::before  { background: #3b82f6; }
.task-card.status-pausado::before   { background: #f59e0b; }
.task-card.status-aguardo::before   { background: #8b5cf6; }

/* ══════════════════════════════════════
   RESPONSIVE — esconde tabela no mobile
══════════════════════════════════════ */
@media (max-width: 768px) {
    .tasks-table-wrap { display: none !important; }
    .tasks-grid { display: grid !important; }
    .search-wrap { max-width: 100%; }
}

/* ══════════════════════════════════════
   BADGE ANEXO
══════════════════════════════════════ */
.badge-anexo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 2px;
    vertical-align: middle;
}

/* ══════════════════════════════════════
   MODAL ANEXOS — lista de arquivos
══════════════════════════════════════ */
.anexo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface2);
    border-radius: 8px;
    margin-bottom: 8px;
}
.anexo-icon { font-size: 22px; flex-shrink: 0; }
.anexo-info { flex: 1; min-width: 0; }
.anexo-nome {
    display: block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.anexo-nome:hover { text-decoration: underline; }
.anexo-meta { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ══════════════════════════════════════
   RELATÓRIO DE PENDÊNCIAS
══════════════════════════════════════ */
.relatorio-header-info {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.relatorio-pessoa {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: visible;
}
.relatorio-pessoa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
}
.badge-relatorio-total {
    margin-left: auto;
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    white-space: nowrap;
}
.relatorio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    display: table;
}
.relatorio-table th {
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.relatorio-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-base);
    vertical-align: middle;
}
.relatorio-table tbody tr:last-child td { border-bottom: none; }
.relatorio-table tbody tr:last-child td:first-child { border-radius: 0 0 0 10px; }
.relatorio-table tbody tr:last-child td:last-child  { border-radius: 0 0 10px 0; }
.relatorio-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Cards mobile do relatório ───────── */
.rel-card {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.rel-card:last-child { border-bottom: none; }
.rel-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.rel-card-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.03em;
}
.rel-card-data {
    font-size: 11px;
    color: var(--text-dim);
}
.rel-card-desc {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
}
.rel-card-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Modal relatório mobile ──────────── */
@media (max-width: 600px) {
    #modal-relatorio .modal-box {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 18px 18px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        max-height: 93vh !important;
        transform: none !important;
    }
    #modal-relatorio .modal-header {
        padding: 14px 14px 10px !important;
    }
    #modal-relatorio .modal-body {
        max-height: calc(93vh - 110px) !important;
        padding: 0 !important;
    }
    .relatorio-header-info {
        padding: 10px 16px 8px !important;
        margin-bottom: 8px !important;
        font-size: 12px !important;
        gap: 12px !important;
    }
    .relatorio-pessoa-header {
        padding: 10px 14px !important;
    }
    .relatorio-pessoa {
        margin-bottom: 14px !important;
    }
    .rel-btn-label { display: none; }
    .rel-btn-acao  { padding: 6px 8px !important; min-width: 32px; justify-content: center; }
    .rel-filtro-label { display: none; }
}

@media print {
    body > *:not(#modal-relatorio) { display: none !important; }

    #modal-relatorio {
        position: static !important;
        display: block !important;
        background: white !important;
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
        width: 100% !important;
    }
    #modal-relatorio .modal-box {
        box-shadow: none !important;
        border: none !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }
    #modal-relatorio .modal-body {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        padding: 0 !important;
    }
    .modal-header button,
    .modal-close,
    #btn-relatorio,
    .modal-footer,
    #relatorio-filtro-usuario,
    #modal-relatorio .modal-header div > button { display: none !important; }

    .modal-header { border-bottom: 1px solid #ddd !important; padding-bottom: 8px !important; }

    .relatorio-pessoa {
        page-break-inside: avoid;
        break-inside: avoid;
        overflow: visible !important;
    }

    .relatorio-table { page-break-inside: auto; }
    .relatorio-table tr { page-break-inside: avoid; break-inside: avoid; }

    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body { background: white !important; }
}

/* ══════════════════════════════════════
   DASHBOARD
══════════════════════════════════════ */
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--trans), transform var(--trans), box-shadow var(--trans);
    user-select: none;
}
.dash-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59,130,246,.15);
}
.dash-card-active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,.3) !important;
}
.dash-card-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.dash-card-num {
    font-size: 30px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.dash-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.dash-panel-full { grid-column: 1 / -1; }
.dash-panel-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.dash-barra-row, .dash-ranking-row {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--trans);
    margin-bottom: 4px;
}
.dash-barra-row:hover, .dash-ranking-row:hover { background: var(--surface2); }
.dash-barra-ativa { background: var(--surface2) !important; outline: 1px solid var(--accent); }
.dash-recente-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--trans);
    border-bottom: 1px solid var(--border);
    min-width: 0;
    overflow: hidden;
}
.dash-recente-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-recente-row:last-child { border-bottom: none; }
.dash-recente-row:hover { background: var(--surface2); }
.dash-filtro-tag {
    font-size: 11px;
    background: var(--accent);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: opacity var(--trans);
}
.dash-filtro-tag:hover { opacity: .8; }
.dash-periodo-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--trans);
}
.dash-periodo-btn:hover { border-color: var(--accent); color: var(--accent); }
.dash-periodo-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 640px) {
    .dash-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .dash-panel-full { grid-column: 1 !important; }
    .dash-panel { padding: 14px 12px !important; }
    .dash-panel-title { font-size: 10px !important; margin-bottom: 10px !important; }

    #page-dashboard .page-header { gap: 8px; }
    #page-dashboard > div:nth-child(2) {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: stretch !important;
    }
    #page-dashboard > div:nth-child(2) > div:first-child { order: 2; }
    #dash-filtro-usuario {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 13px !important;
    }
    #page-dashboard > div:nth-child(2) > div:nth-child(2) { order: 1; }
    .dash-periodo-btn { padding: 5px 10px !important; font-size: 11px !important; flex: 1; text-align: center; }
    #page-dashboard > div:nth-child(2) > div:nth-child(2) { width: 100%; }

    #page-dashboard > div:nth-child(3) {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .dash-card { padding: 12px 8px !important; }
    .dash-card-num { font-size: 24px !important; }
    .dash-card-label { font-size: 10px !important; }

    .dash-barra-row { padding: 5px 4px !important; margin-bottom: 2px !important; }

    .dash-ranking-row > div:last-child { display: none !important; }
    .dash-ranking-row { padding: 6px 4px !important; margin-bottom: 0 !important; }
    .dash-ranking-row > div:first-child { margin-bottom: 0 !important; }
    .dash-ranking-row .resp-avatar { width: 20px !important; height: 20px !important; font-size: 8px !important; }

    .dash-recente-pessoa { display: none !important; }
    .dash-recente-status { display: none !important; }
    .dash-recente-row { padding: 8px 6px !important; gap: 8px !important; }
    .dash-recente-row > span:last-child { min-width: 0 !important; }

    .dash-filtro-tag { font-size: 10px !important; padding: 2px 8px !important; }

    #dash-grafico {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 4px !important;
    }
    #dash-grafico > div { min-width: max-content; }
}

/* ══════════════════════════════════════
   CHECKLIST — mini barra no card
══════════════════════════════════════ */
.checklist-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 4px;
    cursor: pointer;
}
.checklist-mini-bar-wrap {
    flex: 1;
    height: 5px;
    background: var(--surface2);
    border-radius: 999px;
    overflow: hidden;
}
.checklist-mini-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.checklist-mini-label {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
}

/* ══════════════════════════════════════
   CHECKLIST — modal lista de itens
══════════════════════════════════════ */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item.concluido .ci-texto {
    text-decoration: line-through;
    color: var(--text-dim);
}

.ci-check-wrap { cursor: pointer; padding-top: 2px; flex-shrink: 0; }
.ci-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.ci-checkbox.checked {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.ci-body { flex: 1; min-width: 0; }
.ci-texto { font-size: 14px; color: var(--text-base); line-height: 1.4; display: block; }
.ci-obs {
    font-size: 12px;
    color: var(--text-dim);
    margin: 4px 0 0;
    background: var(--surface2);
    border-left: 3px solid #22c55e;
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
}
.ci-meta {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 3px;
}

.ci-del {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.checklist-item:hover .ci-del { opacity: 1; }

/* Força que a lista de checklist fique empilhada e permita que textos longos quebrem linha */
#checklist-lista { display: flex; flex-direction: column; gap: 8px; }
.checklist-item { width: 100%; box-sizing: border-box; }
.ci-body { word-break: break-word; }

/* Preserva quebras de linha no texto da descrição exibida no modal de checklist */
#checklist-desc { white-space: pre-wrap; }

/* Lista de checklist como UL com marcadores e espaçamento adequado */
.checklist-ul {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
    display: block;
}
.checklist-ul .checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.checklist-ul .checklist-item:last-child { border-bottom: none; }
.checklist-ul .ci-body { flex: 1; }
.checklist-ul .ci-texto { display: block; }

/* Comentar — amarelo */
.action-btn.action-comentar {
    color: #fbbf24;
    border-color: rgba(251,191,36,0.25);
    background: rgba(251,191,36,0.08);
}
.action-btn.action-comentar:hover {
    background: rgba(251,191,36,0.18);
    border-color: #fbbf24;
    box-shadow: 0 2px 8px rgba(251,191,36,0.2);
}

/* Avatar roxo para admins colaboradores na coluna de responsável */
.resp-avatar-admin {
    background: rgba(124,58,237,0.2) !important;
    color: #a78bfa !important;
    border: 1.5px solid rgba(124,58,237,0.4) !important;
}
.table-resp-chip-admin {
    background: rgba(124,58,237,0.15);
    color: #a78bfa;
    border: 1px solid rgba(124,58,237,0.3);
}

/* ══════════════════════════════════════
   CHANGELOG
══════════════════════════════════════ */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 720px;
}

.changelog-grupo {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.changelog-dia {
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.changelog-entry {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: border-color var(--trans);
    position: relative;
}
.changelog-entry:hover { border-color: var(--border2); }

.changelog-entry-left {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: var(--surface2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

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

.changelog-entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.changelog-cat-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.cat-feature    { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.cat-fix        { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.cat-improvement{ background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.cat-removed    { background: rgba(107,114,128,0.12);color: #9ca3af; border: 1px solid rgba(107,114,128,0.2); }

.changelog-hora {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: auto;
}

.changelog-titulo {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.changelog-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 4px;
}

.changelog-del {
    position: absolute;
    top: 12px; right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: var(--trans);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
}
.changelog-entry:hover .changelog-del { opacity: 1; }
.changelog-del:hover { color: var(--red); background: rgba(239,68,68,0.1); }

/* ── Seletor de categoria no modal ── */
.changelog-cat-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-option { cursor: pointer; }
.cat-option input[type=radio] { display: none; }

.cat-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 2px solid transparent;
    transition: var(--trans);
    cursor: pointer;
    opacity: 0.6;
}

.cat-option input:checked + .cat-pill {
    opacity: 1;
    border-color: currentColor;
}

.cat-pill.cat-feature     { background: rgba(59,130,246,0.12); color: #60a5fa; }
.cat-pill.cat-fix         { background: rgba(239,68,68,0.12);  color: #f87171; }
.cat-pill.cat-improvement { background: rgba(245,158,11,0.12); color: #fbbf24; }
.cat-pill.cat-removed     { background: rgba(107,114,128,0.12);color: #9ca3af; }

.changelog-emoji { font-size: 20px; line-height: 1; }

/* ══════════════════════════════════════
   TICKETS — FEEDBACK
══════════════════════════════════════ */

/* Botão flutuante */
#btn-feedback {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(59,130,246,.45);
    transition: transform 0.2s, box-shadow 0.2s;
}
#btn-feedback:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(59,130,246,.6);
}

/* Botões de tipo no modal de feedback */
.ticket-tipo-btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--trans);
    text-align: center;
}
.ticket-tipo-btn:hover { border-color: var(--accent); color: var(--text-base); }
.ticket-tipo-btn.active {
    border-color: var(--accent);
    background: rgba(59,130,246,.12);
    color: var(--accent);
    font-weight: 600;
}

/* Cards de ticket na página admin */
.ticket-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--trans);
}
.ticket-card:hover { border-color: var(--accent); background: var(--surface2); }

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ticket-tipo-badge {
    font-size: 13px;
    font-weight: 600;
}
.ticket-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid;
}
.ticket-status-aberto     { color: #ef4444; border-color: rgba(239,68,68,.3);   background: rgba(239,68,68,.08); }
.ticket-status-em_analise { color: #f59e0b; border-color: rgba(245,158,11,.3);  background: rgba(245,158,11,.08); }
.ticket-status-resolvido  { color: #22c55e; border-color: rgba(34,197,94,.3);   background: rgba(34,197,94,.08); }

.ticket-desc {
    font-size: 14px;
    color: var(--text-base);
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ticket-card-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-dim);
}
.ticket-resposta {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--surface2);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
}
/* ── Botão demo na tela de login ── */
.btn-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 20px;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px dashed var(--border2);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--trans);
    margin-top: -4px;
}
.btn-demo:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245,158,11,0.06);
}
.btn-demo:disabled { opacity: 0.5; cursor: not-allowed; }