:root {
    --blanc-trencat: #F0F1EC;
    --gris-clar: #D9D9D9;
    --gris-pedra: #A9ABA4;
    --gris-carbo: #4A4B47;
    --gris-oliva: #6F726A;
    --blanc: #FFFFFF;

    --primary: #2f312e;
    --primary-light: #6f726a;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #DC3545;
    --danger-2: #900;

    --radius: 10px;
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);

    --padding-card: 10px 20px;

    --divider-shadow: rgba(0, 0, 0, .08);

    --border-shadow: 1px solid var(--border, rgba(0, 0, 0, .14));

    --font-weight: 800;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    color: var(--primary);
    line-height: 1.5;
    padding: 25px 40px 40px 40px;
    margin-left: 85px;
}

.title-section {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--padding-card);
    margin-bottom: 18px;
    min-width: 340px;
}

.title-section h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 14px;
}

.title-section p {
    color: var(--primary-light);
    margin-bottom: 8px;
}

.contingut {
    width: 100%;
}

h2 {
    font-size: 18px;
    font-weight: var(--font-weight);
    margin: 0;
}

.divider {
    height: 1px;
    background: var(--divider-shadow);
    margin: 12px 0 14px;
}

.card {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    min-width: 340px;
}

.descripcio {
    color: var(--gris-oliva);
    margin-bottom: 6px;
}

.mini-descripcio {
    margin-bottom: 0;
    font-size: 0.7rem;
    padding-left: 2px;
}

/*BUSCADOR DE NOM*/
#search-box-user {
    position: relative;
}

#search-box-user .result {
    display: none;
    position: absolute;
    /* top: calc(100% + 6px); */
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--blanc);
    border: 1px solid var(--gris-clar);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: auto;
    max-height: 300px;
}

.user-option-container {
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.user-option-container:last-child {
    border-bottom: none;
}

.user-option {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: var(--primary);
    font-size: 12px;
}

.user-option:hover {
    background: var(--blanc-trencat);
}

.no-results {
    padding: 10px 12px;
    color: var(--primary-light);
}

/* DISTRIBUCIÓ BÀSICA GRID */
.bsc-grid {
    /* Basic grid */
    display: grid;
    gap: 22px;
    align-items: start;
}

.bsc-col {
    /*Basic columna */
    display: grid;
    gap: 22px;
}

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

/* BOTONS */
.btn {
    flex: 1;
    border-radius: var(--radius);
    padding: 12px 14px;
    border: var(--border-shadow);
    background: var(--primary);
    color: var(--blanc);
    font-weight: var(--font-weight);
    cursor: pointer;

    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    white-space: nowrap;

    min-width: 250px;
    height: 44px;
}

.btn:hover {
    opacity: 0.7;
}

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

.btn-danger {
    border-color: transparent;
    color: var(--blanc);
    background: var(--danger);
}

.btn-success {
    border-color: transparent;
    color: var(--blanc);
    background: var(--success);
}

/* FORMS */
.lbl {
    /* LABELS */
    margin: 0 0 6px 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
}

/* evitem que el camp date a iOS es vegi malament */
input[type="date"].form-field {
    -webkit-appearance: none;
    appearance: none;
}

.form-field {
    width: 100%;
    height: 44px;
    border: 1px solid var(--gris-clar);
    border-radius: var(--radius);
    padding: 6px 12px;
    color: var(--title);
    background: #fff;
    outline: none;

    box-shadow: none;
    margin: 0;
}

.form-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 49, 46, 0.16);
}

/* Movem cap a l'esquerra la fletxa del select */
select.form-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding-right: 40px;
    /* reservem espai per la fletxa */

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    /* movem la fletxa */
    background-size: 16px;
}

input::placeholder {
    color: #A0A39A;
}

input:placeholder-shown {
    background: #fff;
}

.form-field[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: var(--primary-light);
}

/* TAULA */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    text-align: left;
}

th {
    color: var(--primary-light);
    font-weight: 800;
    font-size: 12px;
}

.taula-empty {
    color: var(--primary-light);
    padding: 14px 8px;
}

/* CHECKBOX */
.form-control {
    font-family: system-ui, sans-serif;
    font-size: 1.2rem;
    line-height: 1.1;
    font-weight: 600;
    display: grid;
    grid-template-columns: 1em auto;
    margin-top: 1em;
    margin-bottom: 20px;
    width: fit-content;
    cursor: pointer;
}

input[type="checkbox"] {
    transform: translateY(0.2em);
    appearance: none;
    background-color: var(--blanc);
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 0.8em;
    height: 0.8em;
    border: 0.1em solid currentColor;
    border-radius: 0.15em;
    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--primary);
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/*Les fletxes de les taules*/
.carousel-controls {
    text-align: center;
    margin-top: 12px;
}

.arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--gris-calid-clar);
    background: var(--blanc);
    color: var(--negre-base);
    text-decoration: none;
}

.arrow.disabled {
    opacity: .35;
    pointer-events: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    body {
        margin-left: 0;
        padding: 15px 12px 30px;
    }

    .contingut {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .card,
    .title-section {
        min-width: 0;
    }

    .btn {
        min-width: 0;
    }

    .out-sm {
        /*Elements que no han de sortir en pantalla petita*/
        display: none;
    }
}