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

:root {
    --primary-color: #0e2e5f;
    --primary-hover-color: #123972;
    --light-bg: #f8f9fa;
    --sidebar-bg: #000000;
    --sidebar-width: 260px;
    --sidebar-transition: margin-left .3s ease, width .3s ease;
    --bs-body-font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--light-bg);
    font-family: var(--bs-body-font-family), sans-serif;
    overflow-x: hidden;
}

/* Layout with Sidebar */
.page-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    transition: var(--sidebar-transition);
    z-index: 1000;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    transition: var(--sidebar-transition);
    width: calc(100% - var(--sidebar-width));
}

.main-content main {
    flex-grow: 1;
    padding: 2rem;
}

/* Collapsed state */
body.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

body.sidebar-collapsed .main-content {
    width: 100%;
    margin-left: 0;
}

.sidebar .menu-title {
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: .5px;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar .nav-link:hover {
    background-color: #1c1c1e;
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: #2c2c2e;
    color: #fff;
    font-weight: 500;
}

.sidebar .nav-link .bi {
    font-size: 1.5rem;
}

.sidebar .nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.2s ease;
}

.sidebar .nav-link[data-bs-toggle="collapse"]:not(.collapsed) .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar .sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #2c2c2e;
    padding-top: 1rem;
}

/* Auth / Login Page styling */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #181818 0%, #0d0d0d 60%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 70%);
    top: -150px;
    left: -150px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -150px;
    right: -150px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
    padding: 3rem 2.25rem;
    width: 100%;
}

.auth-logo {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.06));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.15));
}

.auth-title {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a3a3a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .form-control {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 0.625rem;
    transition: all 0.3s ease;
}

.auth-card .form-control:focus {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

/* Ensure placeholder text is translucent */
.auth-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-card .form-floating label {
    color: #cbd5e1;
    background-color: transparent !important;
    transition: transform 0.2s ease, color 0.2s ease;
}

.auth-card .form-floating label::after {
    background-color: transparent !important;
}

.auth-card .form-floating .form-control:focus ~ label,
.auth-card .form-floating .form-control:not(:placeholder-shown) ~ label {
    color: #ffffff;
    background-color: transparent !important;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.auth-card .form-floating .form-control:focus ~ label::after,
.auth-card .form-floating .form-control:not(:placeholder-shown) ~ label::after {
    background-color: transparent !important;
}

.auth-card .btn-primary {
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.auth-card .btn-primary:hover {
    background: #f4f4f5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
    color: #000000;
}

.auth-card .btn-primary:active {
    transform: translateY(0);
}

.forgot-password-link {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.forgot-password-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
    text-decoration: underline !important;
}

/* Fix autocompletes black background in chrome */
.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover, 
.auth-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #0a0a0a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

header.navbar {
    background-color: var(--primary-color);
}

header.navbar .navbar-brand,
header.navbar .navbar-text,
header.navbar .bi {
    color: #fff;
}

.logo-light {
    filter: brightness(0) invert(1);
}

.main-content header {
    position: sticky;
    top: 0;
    z-index: 999;
}

.modal-body .pdf-embed {
    width: 100%;
    height: 70vh;
    border: 1px solid #dee2e6;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    background-color: #f0f0f0;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: .5rem;
}

.info-box {
    background-color: #fff;
    padding: 0.5rem 1rem;
    border-radius: .375rem;
    border: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-box label {
    font-size: 0.85rem;
    color: #6c757d;
}

.info-box span {
    font-weight: 500;
}


.info-box.info-box-neutral {
    border-left: 4px solid #6c757d;
}

.info-box.info-box-danger {
    border-left: 4px solid #dc3545;
}

.info-box.info-box-success {
    border-left: 4px solid #198754;
}

/* Component Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover-color);
    border-color: var(--primary-hover-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(243, 112, 33, 0.25);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border: 2px dashed #ced4da;
}

.table {
    font-size: 0.9rem;
}

.table th {
    font-weight: 500;
}

/* CSS para a tela de loading */
#loading-overlay {
    position: fixed; /* Fixa na tela, independente da rolagem */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7); /* Fundo branco semitransparente */
    display: none; /* Começa escondido */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Garante que fique sobre todos os outros elementos */
    backdrop-filter: blur(3px); /* Efeito de desfoque no fundo (opcional) */
    flex-direction: column;
}

#loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Premium Dashboard Styles */
.dashboard-welcome-banner {
    background: linear-gradient(135deg, #0e2e5f 0%, #091f42 60%, #051226 100%);
    color: #ffffff;
    border-radius: 1rem;
    padding: 2.25rem;
    box-shadow: 0 10px 30px rgba(14, 46, 95, 0.15);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.dashboard-welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.kpi-card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.kpi-card-glass:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.07);
    border-color: rgba(14, 46, 95, 0.15);
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-hover-premium {
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #f1f3f5;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.card-hover-premium:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(14, 46, 95, 0.2);
}

/* Customized shortcut card themes */
.card-theme-invoice {
    border-left: 5px solid #0e2e5f !important;
}
.card-theme-invoice .icon-color {
    color: #0e2e5f;
}
.card-theme-birth {
    border-left: 5px solid #0d9488 !important;
}
.card-theme-birth .icon-color {
    color: #0d9488;
}
.card-theme-death {
    border-left: 5px solid #64748b !important;
}
.card-theme-death .icon-color {
    color: #64748b;
}
.card-theme-receipt {
    border-left: 5px solid #d97706 !important;
}
.card-theme-receipt .icon-color {
    color: #d97706;
}
.card-theme-email {
    border-left: 5px solid #7c3aed !important;
}
.card-theme-email .icon-color {
    color: #7c3aed;
}
.card-theme-cnpj {
    border-left: 5px solid #2563eb !important;
}
.card-theme-cnpj .icon-color {
    color: #2563eb;
}

.badge-upload-limit {
    background-color: rgba(14, 46, 95, 0.1);
    color: #0e2e5f;
    font-size: 0.75rem;
    font-weight: 500;
}