﻿:root {
    --bg: #F5F7FB;
    --card: #FFFFFF;
    --text: #1F2A37;
    --muted: #6B7280;
    --primary: #2563EB;
    --line: #E5E7EB;
    --shadow: 0 10px 26px rgba(17,24,39,.08);
    --radius: 14px;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter","Segoe UI",system-ui,-apple-system,Arial,sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #0B1220;
    color: #E5E7EB;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(37,99,235,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37,99,235,.35);
    color: #93C5FD;
    font-weight: 800;
}

.brand-title {
    font-weight: 800;
}

.brand-sub {
    font-size: .85rem;
    color: #9CA3AF;
}

.sidebar .nav-link {
    color: #D1D5DB;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 4px 0;
    text-decoration: none;
}

    .sidebar .nav-link:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

    .sidebar .nav-link.active {
        background: rgba(37,99,235,.22);
        border: 1px solid rgba(37,99,235,.35);
        color: #fff;
    }

.sidebar-footer {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.who .muted {
    font-size: .85rem;
    color: #9CA3AF;
}

.who .strong {
    font-weight: 700;
    color: #fff;
}

/* Content */
.content {
    flex: 1;
    padding: 22px;
}

.layout-row {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.layout-main {
    flex: 1;
}

.topbar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.top-title {
    font-weight: 800;
    font-size: 1.05rem;
}

.top-sub {
    color: var(--muted);
    font-size: .9rem;
}

/* Card + buttons */
.cardx {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.btnx {
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
}

.btn-outline.btnx {
    border: 1px solid var(--line);
    background: #fff;
}

.btn-primary.btnx {
    background: var(--primary);
    border-color: var(--primary);
}

/* badges */
.badgex {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
    font-size: .85rem;
    border: 1px solid var(--line);
    background: #F9FAFB;
    color: var(--muted);
}

    .badgex.blue {
        background: rgba(37,99,235,.12);
        border-color: rgba(37,99,235,.25);
        color: #1D4ED8;
    }

    .badgex.gray {
        background: #F3F4F6;
    }

    .badgex.green {
        background: rgba(16,185,129,.12);
        border-color: rgba(16,185,129,.25);
        color: #047857;
    }

    .badgex.red {
        background: rgba(239,68,68,.12);
        border-color: rgba(239,68,68,.25);
        color: #B91C1C;
    }

/* table modern */
.table-modern {
    border-collapse: separate;
    border-spacing: 0 10px;
}

    .table-modern tbody tr {
        background: #fff;
        border: 1px solid var(--line);
        box-shadow: 0 6px 18px rgba(17,24,39,.04);
    }

    .table-modern td, .table-modern th {
        padding: 12px 12px;
        border: none !important;
    }

    .table-modern tbody tr td:first-child {
        border-top-left-radius: 12px;
        border-bottom-left-radius: 12px;
    }

    .table-modern tbody tr td:last-child {
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
    }

/* Admin Users column */
.admin-users {
    width: 280px;
}

.user-pill {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    margin-bottom: 10px;
}

    .user-pill:hover {
        box-shadow: var(--shadow);
    }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #E5E7EB;
    overflow: hidden;
}

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.user-meta {
    line-height: 1.1;
}

    .user-meta .name {
        font-weight: 700;
    }

    .user-meta .sub {
        font-size: .85rem;
        color: var(--muted);
    }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #9CA3AF;
}

a.text-decoration-none {
    color: inherit;
}

/* Linha por situação (kanban soft) */
.row-late {
    border: 1px solid rgba(239,68,68,.25) !important;
    background: rgba(239,68,68,.06) !important;
}

.row-urgent {
    border: 1px solid rgba(245,158,11,.25) !important;
    background: rgba(245,158,11,.08) !important;
}

.row-medium {
    border: 1px solid rgba(37,99,235,.18) !important;
    background: rgba(37,99,235,.06) !important;
}
/* Login page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #F5F7FB 0%, #EEF2FF 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.login-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-foot {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.dot {
    background: #9CA3AF;
}

.dot.online {
        background: #22C55E;
}

/* ===== Chat Widget (Facebook style) ===== */
.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 18px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 9999;
}

.chat-closed {
    display: none;
}

.chat-header {
    background: #0B1220;
    color: #E5E7EB;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.chat-badge {
    background: #EF4444;
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .85rem;
}

.chat-icon-btn {
    border: 0;
    background: rgba(255,255,255,.08);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-weight: 900;
}

.chat-body {
    display: flex;
    flex-direction: column;
    height: 420px;
}

.chat-minimized .chat-body {
    display: none;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow: auto;
    background: #F9FAFB;
}

.msg-bubble {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 10px;
    margin-bottom: 10px;
    max-width: 85%;
    box-shadow: 0 6px 18px rgba(17,24,39,.04);
}

    .msg-bubble.mine {
        margin-left: auto;
        background: rgba(37,99,235,.08);
        border-color: rgba(37,99,235,.18);
    }

.chat-input {
    padding: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
    display: flex;
    gap: 10px;
}

    .chat-input input {
        flex: 1;
    }

/* online dots */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dot-off {
    background: #9CA3AF;
}

.dot-on {
    background: #22C55E;
}

/* CHAT - FAB */
.chat-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-badge {
    background: #ef4444;
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .85rem;
}

/* CHAT - WIDGET */
.chat-widget {
    position: fixed;
    right: 18px;
    bottom: 72px;
    width: 380px;
    max-width: calc(100vw - 36px);
    height: 520px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,.20);
    overflow: hidden;
    z-index: 9999;
    border: 1px solid rgba(0,0,0,.08);
}

.chat-header {
    background: #0b2a5b;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-sub {
    font-size: .85rem;
    opacity: .8;
}

.chat-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-icon-btn {
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px;
}

.chat-body {
    display: flex;
    height: calc(100% - 58px);
}

.chat-users {
    width: 140px;
    border-right: 1px solid rgba(0,0,0,.06);
    overflow: auto;
}

.chat-user-item {
    padding: 10px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .chat-user-item:hover {
        background: rgba(37,99,235,.06);
    }

.chat-user-name {
    font-weight: 700;
    font-size: .95rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dot-on {
    background: #22c55e;
}

.dot-off {
    background: #9ca3af;
}

.chat-conv {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow: auto;
    padding: 12px;
    background: #f7f9fc;
}

.msg-bubble {
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 10px;
    max-width: 85%;
}

    .msg-bubble.mine {
        margin-left: auto;
        background: #e8f0ff;
        border-color: rgba(37,99,235,.15);
    }

.chat-input {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid rgba(0,0,0,.06);
    background: #fff;
}

.chat-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    height: 360px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.chat-header {
    background: #2563eb;
    color: #fff;
    padding: 10px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.chat-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
}

    .chat-footer input {
        width: 100%;
        padding: 6px;
    }

.unread-badge {
    background: #e11d48; /* vermelho */
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}
