/* ============================================================
   mPannel — custom.css
   Tema dark global + componentes de todas as páginas
   ============================================================ */

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
    --bg:           #0f1117;
    --sidebar:      #13151f;
    --card:         #1a1d27;
    --input-bg:     #1e2130;
    --border:       #2a2d3e;
    --border-input: #3a3d50;
    --accent:       #6c63ff;
    --accent-hover: #5a52d5;
    --text:         #f1f5f9;
    --text-soft:    #cbd5e1;
    --text-muted:   #94a3b8;
    --text-dim:     #64748b;
    --sidebar-width: 240px;
}

/* ── Reset / Base ──────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-brand span { color: var(--accent); }

.sidebar-section {
    padding: .75rem 1rem .25rem;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .875rem;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: var(--text);
    background: rgba(108,99,255,.08);
    border-left-color: var(--accent);
}

.sidebar nav a i { font-size: 1rem; width: 1.1rem; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-muted);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-input);
    color: var(--text-muted);
    border-radius: 6px;
    padding: .25rem .75rem;
    font-size: .75rem;
    cursor: pointer;
    width: 100%;
    transition: all .15s;
}

.btn-logout:hover { border-color: #ef4444; color: #f87171; }

/* ── Layout principal ──────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.has-sidebar { display: flex; }

.topbar {
    padding: .875rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-title { font-weight: 600; font-size: 1rem; color: var(--text); }
.topbar-time  { color: var(--text-muted); font-size: .8rem; }

.page-content { padding: 1.5rem; flex: 1; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.card-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

/* ── Formulários ───────────────────────────────────────────── */
.form-control,
.form-control:focus {
    background: var(--input-bg);
    border-color: var(--border-input);
    color: var(--text);
    box-shadow: none;
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:focus         { border-color: var(--accent); }
.form-label                 { color: var(--text-soft); font-size: .83rem; }

.input-group-text {
    background: var(--input-bg);
    border-color: var(--border-input);
    color: var(--text-muted);
}

.password-hint { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Botões ────────────────────────────────────────────────── */
.btn-primary             { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover       { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-delete {
    background: transparent;
    border: 1px solid #3f2a2a;
    color: #f87171;
    border-radius: 6px;
    padding: .25rem .65rem;
    font-size: .75rem;
    cursor: pointer;
    transition: all .15s;
}
.btn-delete:hover { background: rgba(239,68,68,.12); border-color: #ef4444; }

.btn-reset {
    background: transparent;
    border: 1px solid #2a3a3a;
    color: #67e8f9;
    border-radius: 6px;
    padding: .25rem .6rem;
    font-size: .75rem;
    cursor: pointer;
    transition: all .15s;
}
.btn-reset:hover { background: rgba(103,232,249,.1); border-color: #22d3ee; }

/* ── Alertas ───────────────────────────────────────────────── */
.alert-success {
    background: rgba(34,197,94,.1);
    border-color: rgba(34,197,94,.3);
    color: #86efac;
    font-size: .83rem;
}

.alert-danger {
    background: rgba(239,68,68,.1);
    border-color: rgba(239,68,68,.3);
    color: #fca5a5;
    font-size: .83rem;
}

/* ── Pulse ─────────────────────────────────────────────────── */
.pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Monitor ───────────────────────────────────────────────── */
.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.sub-info   { font-size: .82rem; color: var(--text-soft); }
.detail-text { font-size: .82rem; color: var(--text-muted); }

.progress {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
}

.progress-bar {
    border-radius: 99px;
    transition: width .6s ease;
}

.progress-bar.ok     { background: #22c55e; }
.progress-bar.warn   { background: #f59e0b; }
.progress-bar.danger { background: #ef4444; }

.load-items { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.load-items .label { font-size: .78rem; color: var(--text-muted); }

.load-badge {
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    color: var(--text);
    border-radius: 6px;
    padding: .15rem .55rem;
    font-size: .78rem;
    font-weight: 500;
}

.uptime-badge {
    background: rgba(108,99,255,.18);
    color: #a5a0ff;
    border: 1px solid rgba(108,99,255,.35);
    border-radius: 8px;
    padding: .4rem 1rem;
    font-size: .9rem;
    font-weight: 600;
}

/* ── Email — Contas ────────────────────────────────────────── */
.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.account-row:last-child { border-bottom: none; }
.account-email { font-size: .9rem; color: var(--text); font-weight: 500; }
.account-user  { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }

.empty-state { text-align: center; padding: 2rem; color: var(--text-dim); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* ── Email — Setup Outlook ─────────────────────────────────── */
.section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.config-table td {
    padding: .5rem .75rem;
    font-size: .85rem;
    border-color: var(--border) !important;
    vertical-align: middle;
}
.config-table td:first-child { color: var(--text-muted); width: 40%; }
.config-table td:last-child  { color: var(--text); font-weight: 500; }

.copy-field { display: flex; align-items: center; gap: .5rem; }

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-input);
    color: var(--text-muted);
    border-radius: 5px;
    padding: .1rem .4rem;
    font-size: .7rem;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.copy-btn:hover  { border-color: var(--accent); color: #a5a0ff; }
.copy-btn.copied { border-color: #22c55e; color: #86efac; }

.badge-port {
    background: rgba(108,99,255,.15);
    color: #a5a0ff;
    border: 1px solid rgba(108,99,255,.25);
    border-radius: 5px;
    padding: .1rem .5rem;
    font-size: .78rem;
    font-weight: 600;
}

.badge-ssl {
    background: rgba(34,197,94,.12);
    color: #86efac;
    border: 1px solid rgba(34,197,94,.25);
    border-radius: 5px;
    padding: .1rem .5rem;
    font-size: .78rem;
    font-weight: 600;
}

.step-number {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-title { font-size: .95rem; font-weight: 600; color: var(--text); }
.step-desc  { font-size: .83rem; color: var(--text-muted); margin-top: .2rem; }

.alert-info-dark {
    background: rgba(108,99,255,.08);
    border: 1px solid rgba(108,99,255,.2);
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .83rem;
    color: #c4c0ff;
}

/* ── Usuários ──────────────────────────────────────────────── */
.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.user-row:last-child { border-bottom: none; }

.user-avatar {
    width: 2.2rem; height: 2.2rem;
    border-radius: 50%;
    background: rgba(108,99,255,.2);
    border: 1px solid rgba(108,99,255,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: #a5a0ff;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name  { font-size: .9rem; color: var(--text); font-weight: 500; }
.user-login { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }

.badge-you {
    background: rgba(34,197,94,.12);
    color: #86efac;
    border: 1px solid rgba(34,197,94,.2);
    border-radius: 5px;
    padding: .1rem .5rem;
    font-size: .7rem;
    font-weight: 600;
}

.modal-content  { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.modal-header   { border-color: var(--border); }
.modal-footer   { border-color: var(--border); }
.btn-close      { filter: invert(1) opacity(.5); }

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
}

.brand { font-size: 1.6rem; font-weight: 700; text-align: center; margin-bottom: .25rem; color: var(--text); }
.brand span   { color: var(--accent); }
.brand-sub    { text-align: center; font-size: .82rem; color: var(--text-muted); margin-bottom: 2rem; }

.btn-login {
    background: var(--accent);
    border: none;
    color: #fff;
    width: 100%;
    padding: .65rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    transition: background .15s;
    margin-top: .5rem;
    cursor: pointer;
}
.btn-login:hover { background: var(--accent-hover); }

.form-check-label { font-size: .82rem; color: var(--text-muted); }
.form-check-input           { background-color: var(--input-bg); border-color: var(--border-input); }
.form-check-input:checked   { background-color: var(--accent); border-color: var(--accent); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-wrapper { margin-left: 0; }
}
