:root {
    --fugar-blue: #003b5c;
    --fugar-blue-dark: #002f49;
    --fugar-blue-light: #eef6fb;
    --fugar-beige: #efdbb2;

    --app-background: #f6f7f9;
    --app-border: #dee2e6;
    --app-text-muted: #6c757d;

    --app-radius: 16px;
    --app-radius-small: 12px;
}

/*
 * Struttura generale.
 */
html,
body {
    min-height: 100%;
}

body {
    background: var(--app-background);
}

a {
    text-underline-offset: 0.15em;
}

/*
 * Barra di navigazione.
 */
.navbar-fugar {
    background: var(--fugar-blue);
}

/*
 * Marchio Fugar nella barra di navigazione.
 *
 * Il logo viene applicato tramite CSS a tutte le viste
 * che utilizzano la classe Bootstrap navbar-brand.
 * In questo modo non è necessario modificare ogni pagina.
 */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 46px;
    margin-right: 1rem;
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.navbar-brand::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 112px;
    height: 38px;
    border-radius: 5px;
    /*background-color: #fff;*/
    background-image:
        url("/assets/images/fugar-logo-inver-head.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.18);
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #fff;
    text-decoration: none;
}

/*
 * Pulsanti.
 */
.btn-fugar {
    background: var(--fugar-blue);
    border-color: var(--fugar-blue);
    color: #fff;
}

.btn-fugar:hover,
.btn-fugar:focus,
.btn-fugar:active {
    background: var(--fugar-blue-dark);
    border-color: var(--fugar-blue-dark);
    color: #fff;
}

.btn-fugar:disabled {
    background: var(--fugar-blue);
    border-color: var(--fugar-blue);
    color: #fff;
    opacity: 0.65;
}

/*
 * Titoli e testi.
 */
.section-title {
    color: var(--fugar-blue);
}

.proposal-title,
.ingredient-name {
    color: var(--fugar-blue);
}

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

.bg-fugar {
    background: var(--fugar-blue) !important;
    color: #fff;
}

/*
 * Card.
 */
.content-card,
.dashboard-card,
.table-card,
.form-card {
    border: 0;
    border-radius: var(--app-radius);
}

.dashboard-card {
    height: 100%;
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

/*
 * Badge.
 */
.role-badge {
    background: var(--fugar-beige);
    color: var(--fugar-blue-dark);
}

.proposal-count,
.notification-count {
    min-width: 2rem;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ingredient-edit-page .status-badges {
    gap: 0.4rem;
}

/*
 * Notifiche.
 */
.notification-row {
    transition: background-color 0.15s ease;
}

.notification-row-unread {
    background: var(--fugar-blue-light);
    border-left: 5px solid var(--fugar-blue);
}

.notification-row-read {
    border-left: 5px solid transparent;
}

.notification-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.notification-icon-approved {
    background: #d1e7dd;
    color: #0f5132;
}

.notification-icon-rejected {
    background: #f8d7da;
    color: #842029;
}

.notification-icon-default {
    background: #e2e3e5;
    color: #41464b;
}

.notification-message {
    white-space: pre-wrap;
}

.notification-preview {
    border-left-width: 5px !important;
    border-radius: var(--app-radius-small);
}

.notification-preview:last-child {
    margin-bottom: 0 !important;
}

/*
 * Proposte ingredienti.
 */
.changed-row td,
.changed-row th {
    background: #fff3cd;
}

.value-cell {
    min-width: 180px;
    white-space: pre-wrap;
    word-break: break-word;
}

/*
 * Storico ingredienti.
 */
pre.history-json {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8rem;
    margin: 0;
}

/*
 * Login.
 */
body.login-page {
    min-height: 100vh;
    background:
        linear-gradient(
            135deg,
            #f6f7f9 0%,
            #e9eef2 100%
        );
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 430px;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
}

.login-header {
    background: var(--fugar-blue);
    color: #fff;
    padding: 1.75rem 2rem 2rem;
    text-align: center;
}

.login-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.login-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    max-width: 100%;
    min-height: 76px;
    padding: 10px 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.22);
}

.login-logo {
    display: block;
    width: 100%;
    max-width: 185px;
    height: auto;
    max-height: 58px;
    object-fit: contain;
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 700;
}

.login-body {
    padding: 2rem;
}

.app-subtitle {
    color: var(--fugar-beige);
}

/*
 * Tabelle.
 */
.table thead th {
    white-space: nowrap;
}

.table-actions {
    white-space: nowrap;
}

/*
 * Form.
 */
.form-required::after {
    content: " *";
    color: #dc3545;
}

.form-section {
    border: 0;
    border-radius: var(--app-radius);
}

.form-section-title {
    color: var(--fugar-blue);
}

/*
 * Stati vuoti.
 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--app-text-muted);
    margin-bottom: 1rem;
}

/*
 * Responsive.
 */
@media (max-width: 767.98px) {
    .navbar-brand {
        gap: 0.5rem;
        margin-right: 0.5rem;
        font-size: 0.9rem;
    }

    .navbar-brand::before {
        width: 88px;
        height: 32px;
    }

    .dashboard-card .card-body,
    .content-card .card-body {
        padding: 1.25rem;
    }

    .login-body {
        padding: 1.5rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .login-logo-box {
        width: 190px;
        min-height: 68px;
    }

    .login-logo {
        max-width: 165px;
        max-height: 52px;
    }

    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 479.98px) {
    .navbar-brand {
        font-size: 0;
    }

    .navbar-brand::before {
        width: 98px;
        height: 34px;
    }
}
