@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* =============================================
   BASE
============================================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

input, select, textarea, button, .form-control, .btn, .table, th, td {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Fundo para index.php */
body.bg-index {
    background-color: #f6f8fa;
}

/* Fundo para páginas internas (reputacao, smtp, redesocial) */
body.bg-pages {
    background: #eef1f5;
    font-size: 14px;
    padding-top: 56px;
}

/* =============================================
   HEADER GLOBAL (sgiheader.php — páginas internas)
============================================= */
.sgi-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: linear-gradient(135deg, #0f2444 0%, #1a4a8a 100%);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.sgi-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sgi-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

/* =============================================
   TOPBAR (include topbar.php)
============================================= */
.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.page-title-text {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.page-title-total {
    background: #5a6268;
    color: white;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 500;
}

.topbar-icon {
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.topbar-icon:hover {
    opacity: 1;
}

/* =============================================
   INDEX — HEADER DO SISTEMA
============================================= */
.header {
    background: linear-gradient(135deg, #0f2444 0%, #1a4a8a 100%);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
}

.header-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 400;
    color: #cdd5df;
}

.header-user a {
    display: flex;
    align-items: center;
}

/* =============================================
   INDEX — CONTAINER E GRID
============================================= */
.container {
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
}

h1 {
    margin-bottom: 25px;
    font-size: 24px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
}

/* =============================================
   INDEX — CARDS DE SISTEMA
============================================= */
.card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #d0d7de;
    transition: 0.2s;
}

.card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    border-color: #b6c4d8;
}

.card a {
    text-decoration: none;
    color: #0969da;
    font-size: 17px;
    font-weight: 600;
}

.description {
    margin-top: 6px;
    color: #57606a;
    font-size: 13px;
}

/* Card com subjanelas */
.card-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.card-group-title {
    font-size: 11px;
    font-weight: 700;
    color: #8592a0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-group-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: #0969da;
    flex-shrink: 0;
}

.subcard {
    position: relative;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 7px;
    padding: 10px 14px;
    margin-bottom: 6px;
    box-shadow: inset 3px 0 0 transparent;
    transition: box-shadow 0.15s, background 0.15s, transform 0.15s;
    cursor: pointer;
}

.subcard:hover {
    box-shadow: inset 3px 0 0 #0969da;
    background: #eef4fd;
    transform: scale(1.02);
}

.subcard:last-child {
    margin-bottom: 0;
}

.subcard a {
    text-decoration: none;
    color: #0969da;
    font-size: 15px;
    font-weight: 600;
}

.subcard a:first-of-type::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 7px;
}

.subcard a:hover {
    text-decoration: none;
}

.subcard .description {
    margin-top: 3px;
    font-size: 12px;
}

/* =============================================
   INDEX — LOGIN
============================================= */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f8fa;
}

.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 32px 30px 26px;
    width: 100%;
    max-width: 360px;
}

.login-logo {
    text-align: center;
    margin-bottom: 22px;
}

.login-logo img {
    height: 48px;
}

.login-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
}

.login-sub {
    font-size: 13px;
    color: #57606a;
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 13px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 13px;
}

.form-group input:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 2px rgba(9,105,218,0.15);
}

.btn-login {
    width: 100%;
    padding: 8px;
    background: #0969da;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

.btn-login:hover {
    background: #0757ba;
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-text {
    color: #cf222e;
    font-size: 12px;
    margin-top: 6px;
    display: none;
    text-align: center;
}

@keyframes shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.login-box.shake {
    animation: shake 0.3s ease;
}

.spinner {
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   FEEDBACK — Animação de sucesso
============================================= */
@keyframes successPulse {
    0%   { box-shadow: 0 0 0 0 rgba(40,167,69,0.45); }
    60%  { box-shadow: 0 0 0 7px rgba(40,167,69,0); }
    100% { box-shadow: 0 0 0 0 rgba(40,167,69,0); }
}
.blink {
    animation: successPulse 0.7s ease-out;
}

/* Botões desabilitados */
button:disabled,
.btn:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
}

/* =============================================
   PÁGINAS INTERNAS — Badges, Botões, Tabela
   (reputacao / smtp / redesocial)
============================================= */
.badge-ip {
    background: #dc3545;
    color: white;
    font-weight: 500;
}

.btn-danger {
    background: #495057 !important;
    border: none !important;
    color: white !important;
}

.btn-primary {
    color: white !important;
}

.btn-excluir {
    background: #dc3545 !important;
    border: none !important;
    color: white !important;
}

.btn-excluir:hover {
    background: #b02030 !important;
}

/* Botões menores para tabelas de consulta */
.btn-xs {
    padding: 2px 7px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    border-radius: 4px !important;
}

.btn-danger:hover {
    background: #343a40 !important;
}

.btn-success {
    background: #28a745 !important;
    border: none !important;
    padding: 3px 10px;
    font-size: 12px;
}

.btn-success:hover {
    background: #218838 !important;
}

.table thead {
    background: linear-gradient(135deg, #0f2444 0%, #1a4a8a 100%);
    color: white;
}

.table thead th {
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
}

.table td, .table th {
    vertical-align: middle;
}

/* =============================================
   Oracle — Seções de resultado (consulta-oracle.php)
============================================= */
.info-section {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}
.info-section h5 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: #495057;
    font-weight: bold;
}
.table-sm td, .table-sm th {
    padding: 0.3rem;
    font-size: 0.82rem;
}

/* =============================================
   LDAP — Resultado (consulta-user.php)
============================================= */
.result-container { font-family: 'Roboto', Arial, sans-serif; font-size: 0.80rem; }
.result-container p { margin-bottom: 3px; }
.result-container b { color: #495057; }
.badge-group .badge { font-family: 'Roboto', Arial, sans-serif; font-size: 0.75rem; }

/* =============================================
   LDAP — Botões de Ação (consulta-user.php)
============================================= */
.btn-ldap-email {
    background: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #fff !important;
}
.btn-ldap-email:hover { background: #0e7490 !important; border-color: #0e7490 !important; }

.btn-ldap-vpn {
    background: #ea580c !important;
    border-color: #ea580c !important;
    color: #fff !important;
}
.btn-ldap-vpn:hover { background: #c2410c !important; border-color: #c2410c !important; }

.btn-ldap-pacs {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #fff !important;
}
.btn-ldap-pacs:hover { background: #6d28d9 !important; border-color: #6d28d9 !important; }

.btn-ldap-ti {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
}
.btn-ldap-ti:hover { background: #15803d !important; border-color: #15803d !important; }

.btn-ldap-reset {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}
.btn-ldap-reset:hover { background: #b91c1c !important; border-color: #b91c1c !important; }

.btn-ldap-status {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}
.btn-ldap-status:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; }

.btn-ldap-rf {
    background: #475569 !important;
    border-color: #475569 !important;
    color: #fff !important;
}
.btn-ldap-rf:hover { background: #334155 !important; border-color: #334155 !important; }
