/* =========================================================
   IMIGRAWEB ATENDIMENTO
   Frontend - Identidade visual
   ========================================================= */

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

:root {
    --black: #050505;
    --white: #ffffff;
    --background: #f6f7f8;
    --card: #ffffff;
    --border: #e8e8e8;
    --text: #111111;
    --muted: #777777;

    --blue: #159bd7;
    --green: #16a05d;
    --orange: #f5a623;
    --red: #d52b2b;
    --purple: #7856c9;

    --sidebar-width: 245px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
}

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


/* =========================================================
   ESTRUTURA
   ========================================================= */

.app {
    display: flex;
    min-height: 100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    width: var(--sidebar-width);

    background: var(--black);
    color: var(--white);

    display: flex;
    flex-direction: column;

    padding: 25px 16px;

    z-index: 10;
}


/* =========================================================
   LOGO
   ========================================================= */

.brand {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 10px 5px 30px;

    border-bottom: 1px solid #252525;
}

.brand-logo-card {
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.brand-logo-img {
    max-width: 150px;
    width: 100%;
    height: auto;
    display: block;
}

.brand-text {
    font-size: 28px;
    font-weight: 800;
    line-height: 0.75;

    letter-spacing: -2px;
}

.brand-text span {
    font-size: 34px;
}

.brand-icon {
    width: 48px;
    height: 48px;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #f5a623 0%,
            #16a05d 40%,
            #159bd7 70%,
            #d52b2b 100%
        );

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;

    font-size: 21px;
    font-weight: bold;

    box-shadow: inset 0 0 0 5px #ffffff;
}


/* =========================================================
   MENU
   ========================================================= */

.menu {
    display: flex;
    flex-direction: column;

    gap: 6px;

    margin-top: 28px;
}

.menu-item {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 13px 15px;

    border-radius: 9px;

    color: #bcbcbc;

    font-size: 14px;

    transition: 0.2s;
}

.menu-item span {
    width: 22px;

    text-align: center;

    font-size: 17px;
}

.menu-item:hover {
    background: #1b1b1b;
    color: #ffffff;
}

.menu-item.active {
    background: #ffffff;
    color: #000000;

    font-weight: 600;
}


/* =========================================================
   SIDEBAR USUÁRIO
   ========================================================= */

.sidebar-footer {
    margin-top: auto;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 15px 5px 5px;

    border-top: 1px solid #252525;
}

.user-avatar,
.profile-avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #ffffff;
    color: #000000;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: bold;
}

.sidebar-footer strong {
    display: block;

    font-size: 13px;
}

.sidebar-footer small {
    display: block;

    color: #999999;

    font-size: 11px;

    margin-top: 3px;
}

.logout {
    margin-left: auto;

    background: transparent;

    color: #aaaaaa;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border-radius: 6px;

    flex-shrink: 0;
}

.logout:hover {
    color: #ffffff;
}


/* =========================================================
   MAIN
   ========================================================= */

.main {
    margin-left: var(--sidebar-width);

    width: calc(100% - var(--sidebar-width));

    padding: 35px 40px;

    min-height: 100vh;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 32px;
}

.topbar h1 {
    font-size: 26px;

    letter-spacing: -0.5px;
}

.topbar p {
    margin-top: 6px;

    color: var(--muted);

    font-size: 14px;
}

.topbar-right {
    display: flex;
    align-items: center;

    gap: 22px;
}

.notification {
    position: relative;

    background: #ffffff;

    width: 42px;
    height: 42px;

    border-radius: 10px;

    border: 1px solid var(--border);

    font-size: 17px;
}

.notification span {
    position: absolute;

    top: -5px;
    right: -5px;

    width: 17px;
    height: 17px;

    background: #d52b2b;

    color: #ffffff;

    border-radius: 50%;

    font-size: 10px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.profile {
    display: flex;
    align-items: center;

    gap: 10px;
}

.profile strong {
    display: block;

    font-size: 13px;
}

.profile small {
    display: block;

    color: var(--green);

    font-size: 11px;

    margin-top: 3px;
}


/* =========================================================
   STATS
   ========================================================= */

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

    margin-bottom: 25px;
}

.stat-card {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 20px;

    display: flex;
    align-items: center;

    gap: 15px;
}

.stat-icon {
    width: 45px;
    height: 45px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 19px;
}

.stat-icon.blue {
    background: #e7f5fc;
}

.stat-icon.green {
    background: #e7f7ef;
}

.stat-icon.orange {
    background: #fff4df;
}

.stat-icon.purple {
    background: #f0ebff;
}

.stat-card span {
    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 6px;
}

.stat-card strong {
    font-size: 25px;
}


/* =========================================================
   GRID
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        2fr 1fr;

    gap: 20px;

    margin-bottom: 20px;
}


/* =========================================================
   PANELS
   ========================================================= */

.panel {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 12px;

    overflow: hidden;
}

.panel-header {
    padding: 20px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 16px;
}

.panel-header p {
    margin-top: 5px;

    font-size: 12px;

    color: var(--muted);
}

.button-primary {
    background: #000000;

    color: #ffffff;

    padding: 9px 15px;

    border-radius: 7px;

    font-size: 12px;
}

.button-primary:hover {
    opacity: 0.8;
}


/* =========================================================
   CONVERSAS
   ========================================================= */

.conversation {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 17px 22px;

    border-bottom: 1px solid #f0f0f0;
}

.conversation:last-child {
    border-bottom: none;
}

.client-avatar {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: #eeeeee;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;

    font-weight: bold;
}

.conversation-info {
    flex: 1;

    min-width: 0;
}

.conversation-info strong {
    display: block;

    font-size: 13px;

    margin-bottom: 5px;
}

.conversation-info span {
    display: block;

    font-size: 12px;

    color: var(--muted);

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.conversation-meta {
    display: flex;
    flex-direction: column;

    align-items: flex-end;

    gap: 5px;
}

.conversation-meta small {
    color: #888888;

    font-size: 11px;
}

.tag {
    padding: 4px 7px;

    border-radius: 5px;

    font-size: 9px;

    font-weight: bold;
}

.tag.nomade {
    background: #e8f5fc;
    color: #168bbd;
}

.tag.cue {
    background: #e8f7ee;
    color: #18804a;
}

.tag.estudos {
    background: #f0ebff;
    color: #6e50b8;
}

.status-online {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #16a05d;
}


/* =========================================================
   EQUIPE
   ========================================================= */

.team-member {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 18px 22px;

    border-bottom: 1px solid #f0f0f0;
}

.team-member:last-child {
    border-bottom: none;
}

.team-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: bold;
}

.team-avatar.mariana {
    background: #000000;
    color: #ffffff;
}

.team-avatar.ana {
    background: linear-gradient(
        135deg,
        #f5a623,
        #159bd7
    );

    color: #ffffff;
}

.team-info {
    flex: 1;
}

.team-info strong {
    display: block;

    font-size: 13px;
}

.team-info span {
    display: block;

    margin-top: 4px;

    font-size: 11px;

    color: var(--muted);
}

.team-count {
    width: 30px;
    height: 30px;

    border-radius: 8px;

    background: #f3f3f3;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;

    font-weight: bold;
}


/* =========================================================
   PROCESSOS
   ========================================================= */

.processes {
    margin-bottom: 20px;
}

.process-grid {
    display: grid;

    grid-template-columns:
        repeat(6, 1fr);

    gap: 12px;

    padding: 20px;
}

.process-card {
    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 17px;

    transition: 0.2s;
}

.process-card:hover {
    border-color: #000000;

    transform: translateY(-2px);
}

.process-card strong {
    display: block;

    font-size: 11px;

    letter-spacing: 0.3px;
}

.process-card span {
    display: block;

    margin-top: 8px;

    font-size: 11px;

    color: var(--muted);
}


/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 1100px) {

    .stats {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .process-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }

}


@media (max-width: 850px) {

    .sidebar {
        width: 70px;

        padding: 20px 10px;
    }

    .brand-text {
        display: none;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
    }

    .menu-item {
        justify-content: center;

        padding: 13px 5px;
    }

    .menu-item span {
        font-size: 18px;
    }

    .menu-item {
        font-size: 0;
    }

    .sidebar-footer {
        justify-content: center;
    }

    .sidebar-footer > div:not(.user-avatar) {
        display: none;
    }

    .logout {
        display: none;
    }

    .main {
        margin-left: 70px;

        width: calc(100% - 70px);

        padding: 25px 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .stats {
        grid-template-columns: 1fr;
    }

    .process-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar-right {
        gap: 8px;
    }

    .profile {
        display: none;
    }

    .main {
        padding: 20px 15px;
    }

}

/* =========================================================
   MOBILE
   ========================================================= */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 30;
    width: 40px;
    height: 40px;
    background: var(--black);
    color: #fff;
    border-radius: 8px;
    font-size: 18px;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9;
}

.sidebar-backdrop.open {
    display: block;
}

@media (max-width: 768px) {

    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 70px 16px 24px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .topbar-right {
        align-self: flex-end;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* =========================================================
   NOTIFICAÇÕES
   ========================================================= */

.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 40;
}

.notification-dropdown.open {
    display: flex;
    flex-direction: column;
}

.notification-dropdown-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.notification-list {
    overflow-y: auto;
}

.notification-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
}

.notification-item:hover {
    background: #f7f7f7;
}

.notification-item strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
    color: var(--text);
}

.notification-item span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item small {
    display: block;
    font-size: 10px;
    color: #bbbbbb;
    margin-top: 4px;
}

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

/* =========================================================
   MARCA WAZZKONEXA (ambiente de demonstração)
   ========================================================= */

.wzk-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0 30px;
}

.wzk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3ecf8e;
    box-shadow: 0 0 0 4px rgba(62,207,142,0.2);
    flex-shrink: 0;
}

.wzk-brand-text {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -0.01em;
}
