/* ===========================================
   BASE / FUNDO GLOBAL
   =========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, #00b4ff 0, transparent 55%),
        radial-gradient(circle at bottom right, #004c8c 0, transparent 55%),
        linear-gradient(135deg, #03101f, #02050a);
    background-attachment: fixed;
    color: #f5f5f5;
}

/* Dashboard com imagem + gradiente */
body.dashboard {
    background:
        linear-gradient(135deg, rgba(0, 25, 60, 0.90), rgba(0, 110, 210, 0.80)),
        url('../img/fundo.png') center center / cover no-repeat fixed;
}

/* Layout raiz (login, formulários, dashboard) */
.login-page,
.form-page,
.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===========================================
   TOPBAR / PERFIL
   =========================================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;

    padding: 12px 26px;
    background: rgba(0, 40, 90, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.topbar a {
    color: #ffffff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    transition: background 0.2s, transform 0.1s;
}

.topbar a:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-photo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.edit-photo-form input[type="file"] {
    display: none;
}

.edit-photo-btn {
    margin-top: 6px;
    padding: 3px 12px;
    font-size: 11px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #f2f2f2;
    cursor: pointer;
}

.edit-photo-btn:hover {
    background: rgba(255, 255, 255, 0.30);
}

.profile-info-top h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.profile-info-top p {
    margin: 1px 0;
    font-size: 12px;
}

/* ===========================================
   GRID PRINCIPAL DO DASHBOARD
   =========================================== */
.main-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 30px auto;
}

/* ===========================================
   CARDS GLASS (classe ms-card)
   =========================================== */
.ms-card {
    position: relative;

    background: rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.40);

    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);

    padding: 18px;
    color: #0f1925;
    overflow: hidden;
}

/* brilho suave na borda */
.ms-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.35),
        rgba(255, 255, 255, 0.02)
    );
    mix-blend-mode: soft-light;
    opacity: 0.45;
    pointer-events: none;
}

/* conteúdo do card acima do brilho */
.ms-card > * {
    position: relative;
    z-index: 1;
}

.ms-card h3,
.ms-card h4 {
    margin-top: 0;
    color: #08121f;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.35);
}

.ms-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9);
    transition: transform 0.18s, box-shadow 0.18s;
}

/* ===========================================
   BOTÕES
   =========================================== */
button,
.ms-btn {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(135deg, #00b4ff, #004c8c);
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    transition: 0.2s;
}

button:hover,
.ms-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.6);
    opacity: 0.96;
}

/* ===========================================
   INPUTS / SELECT / TEXTAREA
   =========================================== */
label {
    font-size: 13px;
    text-align: left;
    color: #0f1925;
}

input,
select,
textarea {
    padding: 9px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.8);
    color: #0b1725;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #00b4ff;
    box-shadow: 0 0 0 1px rgba(0, 180, 255, 0.6);
    background: rgba(255, 255, 255, 0.95);
}

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

/* ===========================================
   BUSCA / TABELA DE USUÁRIOS
   =========================================== */
.search-card {
    margin-top: 5px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end;
}

.search-form div {
    display: flex;
    flex-direction: column;
}

.search-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.search-table th,
.search-table td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 6px 8px;
}

.search-table th {
    background: rgba(255, 255, 255, 0.55);
    text-align: left;
}

.search-table tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.28);
}

.search-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.18);
}

/* ===========================================
   ÁRVORE DA REDE
   =========================================== */
.network-card {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.network-stats,
.network-tree {
    flex: 1 1 260px;
}

.tree-wrapper ul {
    list-style-type: none;
    padding-left: 20px;
}

.tree-wrapper li {
    margin: 4px 0;
    padding-left: 10px;
    border-left: 1px solid rgba(0, 0, 0, 0.25);
}

/* ===========================================
   MENSAGENS
   =========================================== */
.messages-card .form-row-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.messages-card .form-row-inline > div {
    flex: 1 1 220px;
}

.msg-table-wrapper {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 8px;
}

.msg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.msg-table th,
.msg-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.msg-table th {
    background: rgba(255, 255, 255, 0.55);
    position: sticky;
    top: 0;
}

.msg-table tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.30);
}

.msg-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.18);
}

.tag-scope {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(0, 180, 255, 0.18);
    border: 1px solid rgba(0, 180, 255, 0.6);
}

/* ===========================================
   LOGIN (continua funcionando)
   =========================================== */
.login-container {
    margin: auto;
    width: 100%;
    max-width: 360px;
    padding: 24px 22px;
    text-align: center;

    background: rgba(3, 16, 31, 0.55);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.logo,
.top-logo {
    max-width: 120px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.login-container input {
    padding: 8px;
}

/* Alertas */
.alert {
    background: rgba(255, 93, 93, 0.12);
    color: #ffd0d0;
    padding: 6px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 93, 93, 0.4);
}

.small-text {
    font-size: 12px;
    margin-top: 10px;
    color: #e0e0e0;
}

/* ===========================================
   RODAPÉ
   =========================================== */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
    opacity: 0.95;
    background: rgba(0, 20, 40, 0.80);
    border-top: 1px solid rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #f5f5f5;
}

.footer-founder img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

/* ===========================================
   RESPONSIVO
   =========================================== */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .network-card {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .topbar {
        justify-content: center;
        text-align: center;
    }

    .profile-header-top {
        flex-direction: column;
        text-align: center;
    }

    .profile-photo-box {
        margin-bottom: 8px;
    }
}

