﻿/* ===================================================================
   PIMML - FIȘIER DE STILURI CUSTOM
   =================================================================== */

/* --- 1. Variabile Globale & Setări Generale --- */
:root {
    --bs-primary: #045084;
    --bs-primary-rgb: 4, 80, 132;
    --bs-primary-soft: rgba(var(--bs-primary-rgb), 0.1);
    --bs-info: #0dcaf0;
    --bs-info-rgb: 13, 202, 240;
    --bs-info-soft: rgba(var(--bs-info-rgb), 0.1);
    --bs-gray-300: #dddfeb;
    --bs-gray-800: #5a5c69;
}

body {
    overflow-x: hidden;
    background-color: #f8f9fc; /* Fundal gri deschis pentru conținut */
}

/* --- 2. Pagina de Login --- */
.login-page {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: stretch;
}

.login-image-side {
    background: linear-gradient(rgba(4, 80, 132, 0.7), rgba(10, 40, 60, 0.8)), url('../images/login-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

    .login-image-side .brand-title {
        font-size: 3rem;
        font-weight: 600;
        letter-spacing: 2px;
        margin-bottom: 0.5rem;
    }

    .login-image-side .brand-subtitle {
        font-size: 1.1rem;
        font-weight: 300;
        opacity: 0.8;
    }

.login-form-side {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-container h3 {
    color: #333;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

@media (max-width: 767.98px) {
    .login-image-side {
        display: none;
    }

    .login-form-side {
        height: 100vh;
    }
}

/* --- 3. Layout Principal (Sidebar, Header, Footer) --- */
#wrapper {
    display: flex;
}

.main-content-area {
    padding: 2.5rem;
    flex-grow: 1;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 250px;
    transition: margin .25s ease-out;
    background-color: #fff;
    border-right: 1px solid #e3e6f0;
}

.sidebar-heading {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

.navbar-brand-logo {
    height: 32px;
    width: auto;
    margin-right: 10px;
}

.list-group-item-action {
    color: var(--bs-gray-800);
    font-weight: 500;
    border: 0;
    padding: 1rem 1.25rem;
}

    .list-group-item-action:hover, .list-group-item-action.active {
        color: var(--bs-primary);
        background-color: var(--bs-primary-soft);
    }

#page-content-wrapper {
    width: 100vw;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-footer {
    padding: 1rem 0;
    background-color: #fff;
    border-top: 1px solid #e3e6f0;
    font-size: 0.85rem;
    margin-top: auto;
}

@media (min-width: 992px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: -250px;
    }
}

/* --- 4. Dashboard --- */
.date-widget {
    background-color: #fff;
    border-radius: .5rem;
    border: 1px solid #e3e6f0;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.date-widget-day {
    font-size: 4rem;
    font-weight: 700;
    color: var(--bs-primary);
    line-height: 1;
}

.date-widget-details {
    display: flex;
    flex-direction: column;
}

.date-widget-weekday {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--bs-gray-800);
    text-transform: capitalize;
}

.date-widget-month-year {
    font-size: 1rem;
    color: #6c757d;
}

.date-widget-time {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--bs-gray-800);
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.action-card {
    transition: all 0.3s ease;
    border: 1px solid #e3e6f0;
    border-radius: .5rem;
}

    .action-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 .5rem 1rem rgba(0,0,0,.10) !important;
        border-color: var(--bs-primary);
    }

    .action-card .icon-circle {
        height: 70px;
        width: 70px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        margin-left: auto;
        margin-right: auto;
        transition: all 0.3s ease;
    }

    .action-card:hover .icon-circle {
        transform: scale(1.1);
    }

.bg-primary-soft {
    background-color: var(--bs-primary-soft);
}

.bg-info-soft {
    background-color: var(--bs-info-soft);
}

/* --- 5. Stiluri pentru Pagini de Liste și Formulare --- */

/* Card principal pentru pagină */
.card-header h4 {
    color: var(--bs-gray-800);
}

/* Tabel îmbunătățit */
.table {
    font-size: 0.9rem;
}

    .table thead {
        color: var(--bs-gray-800);
    }

/* Formulare stilizate */
.styled-fieldset {
    border: 1px solid #e3e6f0 !important;
    border-radius: .5rem;
    padding: 1.5rem !important;
}

    .styled-fieldset legend {
        float: none;
        width: auto;
        padding: 0 10px;
        font-size: 1rem;
        font-weight: 500;
        color: var(--bs-primary);
    }

/* Spinner pentru HTMX */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* --- 6. Stiluri pentru Pagini de Utilizatori --- */

.badge.bg-success-soft {
    background-color: rgba(var(--bs-success-rgb), 0.15) !important;
}

.badge.text-success {
    color: #198754 !important;
}

.badge.bg-secondary-soft {
    background-color: rgba(var(--bs-secondary-rgb), 0.15) !important;
}

.badge.text-secondary {
    color: #6c757d !important;
}

/* --- 7. Pagina de Detalii Dosar --- */
.details-fieldset {
    border: 1px solid #e3e6f0;
    border-radius: .5rem;
    padding: 1.5rem;
    height: 100%;
}

    .details-fieldset legend {
        float: none;
        width: auto;
        padding: 0 10px;
        font-size: 1rem;
        font-weight: 500;
        color: var(--bs-primary);
        margin-bottom: 1rem;
    }

.details-list {
    font-size: 0.95rem;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
}

    .details-list dt {
        font-weight: 500;
        color: #858796;
        flex-basis: 30%;
        margin-bottom: .5rem;
    }

    .details-list dd {
        font-weight: 500;
        color: var(--bs-gray-800);
        flex-basis: 70%;
        margin-bottom: .5rem;
    }

/* Stil pentru a păstra formatarea textului în rezumat */
.details-pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: inherit;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    font-weight: 500;
    color: #6c757d;
}

    .nav-tabs .nav-link.active {
        color: var(--bs-primary);
        border-bottom: 3px solid var(--bs-primary);
    }

/* --- 8. Stiluri Helper --- */

.table-row-clickable {
    cursor: pointer;
}

/* --- 9. Stiluri Noi & Corecții --- */

/* Culoare nouă pentru badge-ul de Rol */
:root {
    --bs-indigo: #6610f2;
    --bs-indigo-rgb: 102, 16, 242;
    --bs-indigo-soft: rgba(var(--bs-indigo-rgb), 0.15);
}

.badge.bg-indigo-soft {
    background-color: var(--bs-indigo-soft) !important;
}

.badge.text-indigo {
    color: var(--bs-indigo) !important;
}

/* --- 10. Ajustări Fine de Design --- */

.sidebar-heading .navbar-brand span {
    font-weight: 600; /* Îngroșăm textul */
    color: #3a3b45; /* Un gri închis, profesional */
    font-size: 1.1rem; /* Mărim puțin textul */
    vertical-align: middle; /* Aliniem perfect cu logo-ul */
}

/* === 11. STILURI PENTRU IMPRIMARE DOSAR (Details & Index) === */
@media print {

    /* --- Ascunde UI-ul general al aplicației --- */
    body > *, #wrapper > :not(#page-content-wrapper) {
        display: none;
    }

    #page-content-wrapper {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ascunde elementele de navigație din interiorul paginii */
    .navbar,
    .app-footer,
    .btn,
    .main-content-area > .alert {
        display: none !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    /* Ascunde toate antetele și subsolurile cardurilor (Dosar Nou, Filtrează, Imprimă, etc.) */
    .card-header, .card-footer {
        display: none !important;
    }

    /* --- Reguli specifice paginii de LISTĂ (Index.cshtml) --- */

    /* Ascunde formularul de filtrare */
    #filterCollapse {
        display: none !important;
    }

    /* Ascunde controalele de paginare */
    #case-list-container nav {
        display: none !important;
    }

    /* Asigură-te că tabelul este vizibil */
    #case-list-container .table-responsive {
        display: block !important;
    }

    /* Ascunde link-urile de pe numărul de înregistrare */
    .table-row-clickable a {
        color: #000 !important;
        text-decoration: none !important;
    }

    /* Asigură-te că link-urile de download (facturi/atașamente) NU sunt ascunse de regula '.btn' */
    a.btn {
        display: none !important;
    }

    a:not(.btn) {
        display: inline !important;
    }

    /* --- Reguli specifice paginii de DETALII (Details.cshtml) --- */

    /* Forțează afișarea tab-urilor */
    .tab-content > .tab-pane {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #caseDetailsTabs {
        display: none !important;
    }

    /* Ascunde toate formularele */
    form,
    #assign-options-container,
    #routing-container,
    #payment-status-container {
        display: none !important;
    }

    #general .details-list {
        display: grid !important;
    }

    .details-fieldset {
        page-break-inside: avoid;
    }

    /* Afișează tabelele (Atașamente, Istoric) */
    #activity .table-responsive,
    #history .table-responsive,
    #subs-panel .table-responsive {
        display: block !important;
    }

    #history {
        margin-top: 2rem !important;
    }
}