
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: #f4f5fb;
    color: #1f2933;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.auth-container {
    max-width: 360px;
    width: 100%;
    text-align: center;
}

.auth-container h1 {
    margin-bottom: 8px;
}

.subtitle {
    color: #6b7280;
    margin-bottom: 16px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.form-row {
    display: flex;
    gap: 12px;
}
.form-row > div {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
}

textarea {
    resize: vertical;
}

.btn-primary {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 500;
    text-decoration: none;
}

.btn-small {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.8rem;
    text-decoration: none;
    color: #374151;
}

.alert {
    padding: 8px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    text-align: left;
    font-size: 0.85rem;
}
.alert-error {
    background: #fee2e2;
    color: #b91c1c;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
}

.main-container {
    max-width: 1000px;
    margin: 80px auto 32px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
    z-index: 10;
}

.topbar-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo {
    font-weight: 700;
}

.logo-sub {
    font-size: 0.8rem;
    color: #9ca3af;
}

.topbar-nav a {
    margin-left: 14px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.9rem;
}

.topbar-nav a:hover {
    color: white;
}

.logout-link {
    opacity: 0.8;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.table th,
.table td {
    text-align: left;
    padding: 8px;
    font-size: 0.9rem;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
}

.status {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}
.status-pendent {
    background: #fef9c3;
    color: #854d0e;
}
.status-aprovat {
    background: #dcfce7;
    color: #166534;
}
.status-denegat {
    background: #fee2e2;
    color: #b91c1c;
}

.profile-card {
    max-width: 600px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4b5563;
}

.muted {
    font-size: 0.85rem;
    color: #9ca3af;
}

.file-list {
    list-style: none;
    margin-top: 8px;
}
.file-list li {
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .main-container {
        margin-top: 72px;
    }
    .form-row {
        flex-direction: column;
    }
}
/* --- CALENDARI ANUAL --- */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 mesos per fila */
    gap: 14px;
}

@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .calendar-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.month-card {
    border-radius: 16px;
    background: #ffffff;
    padding: 10px 12px 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.month-card h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

.calendar-table th,
.calendar-table td {
    text-align: center;
    padding: 3px;
}

.calendar-table th {
    font-weight: 600;
    color: #6b7280;
}

.day-cell {
    border-radius: 8px;
    height: 26px;
    vertical-align: middle;
    position: relative;
}

.day-number {
    display: block;
}

.empty-day {
    height: 26px;
}

.weekend-day {
    background: #e0f2fe; /* blau suau per dissabtes i diumenges */
}

.holiday-day {
    background: #fef3c7; /* groc suau per festius */
}

.holiday-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #f97316;
    display: block;
    margin: 1px auto 0;
}
.vacation-day {
    background: #dcfce7;           /* verd suau */
    box-shadow: inset 0 0 0 1px #22c55e;
}



/* === Responsive tweaks added by ChatGPT === */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

@media (max-width: 768px) {
    .main-container {
        padding: 8px;
    }

    nav, .nav, .navbar {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    nav a, .nav a, .navbar a {
        padding: 6px 8px;
        font-size: 0.9rem;
    }

    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.85rem;
    }

    .form input[type="text"],
    .form input[type="email"],
    .form input[type="password"],
    .form input[type="date"],
    .form input[type="file"],
    .form select,
    .form textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .card {
        margin-bottom: 16px;
    }

    .btn-primary,
    .btn-small {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .auth-card {
        margin: 16px;
    }
}

@media (max-width: 480px) {
    .auth-body {
        padding: 12px;
    }

    .login-container {
        margin: 20px 8px;
        padding: 12px;
    }
}


/* Absències especials (LD, IT, Formació) en color salmó */
.absence-it,
.absence-ld,
.absence-formacio,
.absence-other {
    background: #ffdab9; /* salmó suau */
    box-shadow: inset 0 0 0 1px #fb923c;
}

/* Targetes de resum per al panell d'administració */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0;
}

.stat-card {
    flex: 1 1 160px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f9fafb;
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #4b5563;
}

.stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Colors específics per cada tipus */
.stat-it .stat-value,
.stat-ld .stat-value,
.stat-formacio .stat-value {
    color: #fb923c;
}
