/* =======================
   BASE / GERAL
   ======================= */

body.app-body {
    background-color: #f5f5f7;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
}

/* Layout principal autenticado */
.app-layout {
    min-height: 100vh;
}

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

.sidebar {
    width: 230px;
    background: #111827;
    color: #e5e7eb;
    padding: 16px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.18);
}

.sidebar-header {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(249, 250, 251, 0.07);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.85rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: #9ca3af;
}

.sidebar-nav {
    margin-top: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}

.sidebar-link i {
    font-size: 1rem;
}

.sidebar-link:hover {
    background: rgba(55, 65, 81, 0.8);
    color: #f9fafb;
    transform: translateX(2px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #f9fafb;
}

.sidebar-footer {
    padding-top: 10px;
    border-top: 1px solid rgba(249, 250, 251, 0.07);
}

.sidebar-user {
    gap: 8px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f97316;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.user-label {
    font-size: 0.7rem;
    color: #9ca3af;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

/* =======================
   MAIN / TOPO / CONTEÚDO
   ======================= */

.app-main {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;          /* 🔹 faz o main ocupar o espaço disponível */
}

.main-topbar {
    height: 50px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
}

.app-content {
    padding: 20px 24px 32px 24px;
    flex: 1 0 auto;          /* 🔹 conteúdo cresce e empurra o rodapé pra baixo */
}


.app-footer {
    border-top: 1px solid #e5e7eb;
    padding: 10px 24px;
    font-size: 0.8rem;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);

    flex-shrink: 0;    /* 🔹 impede o rodapé de encolher */
    margin-top: auto;  /* 🔹 empurra o rodapé pro final da coluna */
}

.app-footer a {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}


/* Layout de autenticação (login/registro) */
.auth-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    margin-top: 40px;
}

.auth-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.auth-logo-text {
    font-weight: 600;
    margin-top: 4px;
}

/* =======================
   DASHBOARD / PÁGINAS
   ======================= */

.dashboard-page {
    padding-bottom: 40px;
}

.dashboard-header {
    margin-top: 4px;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.dashboard-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
}

.dashboard-new-btn {
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 500;
}

/* Cards de resumo */
.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.06);
    border: 1px solid #f0f0f0;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #ffe8ea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #e63946;
}

.stat-icon-warning {
    background: #fff3cd;
    color: #ff8c00;
}

.stat-icon-success {
    background: #e7f7ec;
    color: #198754;
}

.stat-content .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.stat-content .stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-content .stat-helper {
    font-size: 0.8rem;
    color: #999;
}

/* Card de filtros */
.filters-card {
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.filters-title {
    font-size: 1rem;
    font-weight: 600;
}

.filters-card .form-control,
.filters-card .form-select {
    border-radius: 999px;
    font-size: 0.9rem;
}

/* Cards de tabela */
.card-table {
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    background: #ffffff;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Tabela */
.card-table table thead tr {
    background-color: #fafafa;
}

.card-table table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    border-bottom: 1px solid #e5e7eb;
}

.card-table table tbody td {
    font-size: 0.9rem;
    border-bottom-color: #f1f1f1;
}

.doc-name-cell {
    font-weight: 500;
}

/* Pílulas de status */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-valido {
    background-color: #e7f7ec;
    color: #198754;
}

.status-critico {
    background-color: #fff3cd;
    color: #ff8c00;
}

.status-vencido {
    background-color: #fde2e4;
    color: #e63946;
}

/* Etapas (bolinhas) */
.etapas-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.etapas-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #d1d5db; /* cinza (apagado) */
}

.etapas-dots .dot-active {
    background-color: #22c55e; /* verde (aceso) */
}

/* Botões de ação */
.btn-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

/* Cards de empresas (dashboard) */
.empresa-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.empresa-card {
    background: #fff7f7;
    border-radius: 14px;
    border: 1px solid #ffe2e5;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.empresa-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #ffe8ea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e63946;
    font-size: 1rem;
}

.empresa-info {
    flex: 1;
}

.empresa-nome {
    font-size: 0.9rem;
    font-weight: 600;
}

.empresa-docs {
    font-size: 0.8rem;
    color: #6c757d;
}

.empresa-criticos {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e63946;
    background: #ffe2e5;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* =======================
   ADMIN / SETTINGS
   ======================= */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.settings-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 14px 10px 14px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

.settings-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #ffffff;
}

.settings-card-icon.icon-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.settings-card-icon.icon-teal {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.settings-card-icon.icon-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.settings-card-icon.icon-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.settings-card-body {
    flex-grow: 1;
}

.settings-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-card-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0;
}

.settings-card-footer {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

@media (max-width: 992px) {
    .sidebar {
        display: none; /* simples: some a sidebar no mobile */
    }

    .app-content {
        padding: 16px;
    }
}


/* =======================
   LOGIN
   ======================= */

.login-center {
	min-height: calc(90vh - 30px); /* ocupa a tela menos o rodapé */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;;   /* dá um respiro vertical, mas sem forçar altura maior que a tela */
}

.login-panel {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: 26px 26px 22px 26px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    border: 1px solid #e5e7eb;
}

.login-panel-header .login-logo-circle {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
}

.login-panel-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.login-panel-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

.login-panel-form {
    margin-top: 8px;
}

.login-input-group .input-group-text {
    border-radius: 999px 0 0 999px;
    border-right: 0;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.login-input-group .form-control {
    border-radius: 0 999px 999px 0;
    border-left: 0;
    border-color: #e5e7eb;
    font-size: 0.95rem;
}

.login-input-group .form-control:focus {
    box-shadow: none;
    border-color: #ef4444;
}

.login-input-group .input-group-text i {
    color: #6b7280;
}

.btn-login-main {
    border-radius: 999px;
    padding: 0.55rem 1.3rem;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Responsivo */
@media (max-width: 576px) {
    .login-panel {
        padding: 22px 18px 20px 18px;
        margin: 0 10px;
    }
}
