/**
 * timesheet.css — Stili per attività giornaliere e vista timesheet mensile
 * Custom Supreme Plugin
 */

/* ================================================================
   SEZIONE ATTIVITÀ NEL FORM REPORT GIORNALIERO — CARD LAYOUT
   ================================================================ */

/* La sezione prende tutta la larghezza disponibile */
.cdi-activities-section {
    width: 100%;
}

.cdi-activities-section .cdi-view-content {
    padding: 16px;
    background: #fff;
}

/* Contenitore lista card */
.cdi-activities-cards-wrap {
    width: 100%;
}

.cdi-activities-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* ── Singola card attività ── */
.cdi-activity-card {
    width: 100%;
    background: #fff;
    border: 1px solid #c9d1d9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    box-sizing: border-box;
}

/* ── Barra in alto: orari + luogo + pulsante rimuovi ── */
.cdi-act-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 12px;
    background: #f0f4f8;
    border-bottom: 2px solid #d0d7de;
    flex-wrap: wrap;
}

.cdi-act-times {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}

/* Campo singolo nella topbar (etichetta sopra, input sotto) */
.cdi-act-field-inline {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px;
}

.cdi-act-field-inline label {
    display: block !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #57606a !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 !important;
}

.cdi-act-field-inline input[type="time"] {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 7px 9px;
    font-size: 0.9rem;
    width: 112px;
    box-sizing: border-box;
    background: #fff;
}

.cdi-act-luogo input[type="text"] {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 7px 10px;
    font-size: 0.9rem;
    width: 260px;
    box-sizing: border-box;
    background: #fff;
}

/* Ore calcolate */
.act-ore-display .ore-uomo-val {
    display: block !important;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0969da;
    padding: 7px 2px;
}

/* ── Corpo card: task dropdown + textareas grandi ── */
.cdi-act-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Campo verticale piena larghezza */
.cdi-act-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    width: 100%;
}

.cdi-act-field label {
    display: block !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin: 0 !important;
}

.cdi-act-field select {
    width: 100% !important;
    border: 1px solid #adb5bd;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.92rem;
    box-sizing: border-box;
    background: #fff;
    cursor: pointer;
}

.cdi-act-field textarea {
    width: 100% !important;
    border: 1px solid #adb5bd;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.93rem;
    line-height: 1.6;
    box-sizing: border-box;
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
}

/* Footer attività */
.cdi-activities-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cdi-ore-giornata {
    font-size: 0.95rem;
    color: #444;
    padding: 6px 14px;
    background: #eef6ff;
    border-radius: 6px;
    border: 1px solid #bce0fd;
}

.cdi-ore-giornata strong {
    color: #0969da;
    font-size: 1.05rem;
}

/* Campi auto-calcolati readonly */
.cdi-ora-computed {
    background: #f4f4f4 !important;
    color: #555 !important;
    cursor: default !important;
    font-style: italic;
}

/* ================================================================
   PAGINA TIMESHEET MENSILE
   ================================================================ */

#cdi-timesheet-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cdi-timesheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.cdi-timesheet-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a2e;
}

.cdi-month-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdi-month-nav .cdi-btn {
    padding: 6px 14px;
}

.cdi-month-label {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
}

/* Barra ore */
.cdi-ore-bar {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cdi-ore-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cdi-ore-stat .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
}

.cdi-ore-stat .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
}

.cdi-ore-stat.positivo .value { color: #1a7f37; }
.cdi-ore-stat.negativo .value { color: #cf222e; }

.cdi-ore-progress {
    flex: 1;
    min-width: 200px;
}

.cdi-ore-progress-bar {
    height: 12px;
    background: #e1e4e8;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.cdi-ore-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.cdi-ore-progress-fill.ok      { background: #1a7f37; }
.cdi-ore-progress-fill.warning { background: #bf8700; }
.cdi-ore-progress-fill.danger  { background: #cf222e; }
.cdi-ore-progress-fill.over    { background: #0969da; }

/* Selettori filtro */
.cdi-timesheet-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cdi-timesheet-filters label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cdi-timesheet-filters select,
.cdi-timesheet-filters input {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* Tabella timesheet */
.cdi-timesheet-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #d0d7de;
}

.cdi-timesheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.cdi-timesheet-table thead th {
    background: #1a1a2e;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid #333;
}

.cdi-timesheet-table thead th:last-child {
    border-right: none;
}

.cdi-timesheet-table tbody td {
    border-bottom: 1px solid #e1e4e8;
    border-right: 1px solid #e1e4e8;
    padding: 8px 12px;
    vertical-align: top;
}

.cdi-timesheet-table tbody td:last-child {
    border-right: none;
}

.cdi-timesheet-table tbody tr:hover {
    background: #f0f4f8;
}

.cdi-timesheet-table .col-data   { white-space: nowrap; font-weight: 600; }
.cdi-timesheet-table .col-ore    { text-align: center; font-weight: 600; color: #0969da; white-space: nowrap; }
.cdi-timesheet-table .col-wbs    { white-space: nowrap; font-size: 0.8rem; color: #555; }
.cdi-timesheet-table .col-orari  { white-space: nowrap; font-size: 0.82rem; }

/* Riga totale */
.cdi-timesheet-table tfoot td {
    background: #f0f4f8;
    font-weight: 700;
    padding: 10px 12px;
    border-top: 2px solid #d0d7de;
}

/* Vuoto */
.cdi-timesheet-empty {
    text-align: center;
    color: #666;
    padding: 48px 20px;
    font-size: 0.95rem;
}

/* Export button */
.cdi-timesheet-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .cdi-activity-luogo input[type="text"] {
        width: 100%;
    }
    .cdi-timesheet-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .cdi-ore-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
