/* ConsulenzaPro Legal V1.2 - Team + Timesheet
   Public showcase only. Synthetic staff and time records. */

.team-timesheet-view {
    padding-bottom: 48px;
}

.team-timesheet-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
}

.team-timesheet-page-heading h1 {
    margin: 8px 0 12px;
}

.team-timesheet-page-heading p {
    max-width: 780px;
    margin: 0;
}

.team-timesheet-safety-strip {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.team-timesheet-safety-strip > span {
    display: grid;
    place-items: center;
    min-width: 48px;
    height: 44px;
    padding: 0 9px;
    border-radius: 13px;
    background: var(--ink);
    color: var(--surface);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
}

.team-timesheet-safety-strip strong,
.team-timesheet-safety-strip p {
    display: block;
}

.team-timesheet-safety-strip p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.team-timesheet-safety-strip b {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.team-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.team-kpi-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.team-kpi-card span,
.team-kpi-card small {
    display: block;
    color: var(--muted);
}

.team-kpi-card strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 28px;
    letter-spacing: -.04em;
}

.team-kpi-card.billable {
    box-shadow: inset 0 3px 0 rgba(52, 118, 88, .35);
}

.team-kpi-card.nonbillable {
    box-shadow: inset 0 3px 0 rgba(181, 120, 42, .42);
}

.team-panel {
    margin-bottom: 20px;
}

.team-panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
}

.team-panel-heading h2 {
    margin: 3px 0 0;
}

.team-member-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.team-member-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}

.team-member-card:hover {
    background: var(--surface-soft);
}

.team-member-card.active {
    border: 3px solid #8b2432;
    background: #fff1f3;
    box-shadow:
        0 10px 24px rgba(139, 36, 50, .16),
        inset 0 0 0 1px rgba(139, 36, 50, .08);
    transform: translateY(-1px);
}

.team-member-card.active::after {
    content: "SELEZIONATO";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #8b2432;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    line-height: 1;
}

.team-member-card.active .team-member-avatar {
    background: #8b2432;
    color: #ffffff;
    outline: 2px solid rgba(139, 36, 50, .18);
    outline-offset: 2px;
}

.team-member-card.active strong {
    color: #8b2432;
}

.team-member-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--ink);
    color: var(--surface);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
}

.team-member-card strong,
.team-member-card small {
    display: block;
}

.team-member-card small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.team-member-hours {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.team-member-hours span {
    color: var(--muted);
    font-size: 11px;
}

.team-member-hours b {
    font-size: 12px;
}

.timesheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.timesheet-search {
    flex: 1 1 420px;
    max-width: 620px;
}

.team-filter-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.team-filter-state button {
    min-height: 32px;
    padding: 5px 12px;
    border: 2px solid #8b2432;
    border-radius: 999px;
    background: #ffffff;
    color: #8b2432;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(139, 36, 50, .04);
    transition:
        background .18s ease,
        color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.team-filter-state button:hover,
.team-filter-state button:focus-visible {
    border-color: #6f1826;
    background: #8b2432;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 36, 50, .12);
    transform: translateY(-1px);
}

.timesheet-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr);
    gap: 18px;
    align-items: start;
}

.timesheet-list-panel,
.timesheet-context-panel {
    overflow: hidden;
}

.timesheet-table-head,
.timesheet-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(175px, .9fr) 105px 120px;
    gap: 14px;
    align-items: center;
}

.timesheet-table-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.timesheet-row {
    width: 100%;
    padding: 15px 18px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}

.timesheet-row:hover,
.timesheet-row.selected {
    background: var(--surface-soft);
}

.timesheet-row.selected {
    box-shadow: inset 3px 0 0 var(--accent);
}

.timesheet-row.hidden {
    display: none;
}

.timesheet-primary {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.timesheet-primary > span,
.timesheet-row > span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.timesheet-primary strong,
.timesheet-row b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timesheet-primary small,
.timesheet-row small {
    color: var(--muted);
    font-size: 12px;
}

.timesheet-type-icon {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(77, 94, 130, .10);
    color: rgb(62, 77, 111);
    font-style: normal;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
}

.timesheet-billable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.timesheet-billable.yes {
    background: rgba(52, 118, 88, .11);
    color: rgb(37, 100, 72);
}

.timesheet-billable.no {
    background: rgba(181, 120, 42, .12);
    color: rgb(132, 82, 20);
}

.timesheet-empty {
    padding: 28px 18px;
    text-align: center;
}

.timesheet-empty strong,
.timesheet-empty span {
    display: block;
}

.timesheet-empty span {
    margin-top: 4px;
    color: var(--muted);
}

.timesheet-context-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

.timesheet-context-heading h2 {
    margin: 4px 0 0;
    font-size: 21px;
}

.timesheet-context-id {
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.timesheet-context-body {
    padding: 18px;
}

.timesheet-context-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.timesheet-context-facts {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
}

.timesheet-context-facts > div {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 10px;
    align-items: baseline;
}

.timesheet-context-facts dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.timesheet-context-facts dd {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.timesheet-value-box,
.timesheet-note-box,
.timesheet-linked-matter {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.timesheet-value-box span,
.timesheet-note-box span,
.timesheet-linked-matter > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
}

.timesheet-value-box strong {
    display: block;
    font-size: 25px;
    letter-spacing: -.03em;
}

.timesheet-value-box small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.timesheet-note-box p,
.timesheet-linked-matter p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.timesheet-linked-matter strong {
    display: block;
}

.timesheet-linked-matter p {
    margin-top: 5px;
}

.timesheet-linked-matter button {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.timesheet-demo-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: 14px;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(181, 120, 42, .09);
}

.timesheet-demo-note span {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.timesheet-demo-note p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 1160px) {
    .team-member-grid,
    .team-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timesheet-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .team-timesheet-page-heading,
    .timesheet-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .team-timesheet-safety-strip {
        grid-template-columns: auto 1fr;
    }

    .team-timesheet-safety-strip b {
        grid-column: 1 / -1;
    }

    .timesheet-table-head {
        display: none;
    }

    .timesheet-row {
        grid-template-columns: 1fr auto;
    }

    .timesheet-row > span:nth-child(2) {
        grid-column: 1 / -1;
    }

    .timesheet-row > span:nth-child(3),
    .timesheet-row > span:nth-child(4) {
        justify-self: start;
    }
}

@media (max-width: 620px) {
    .team-member-grid,
    .team-kpi-grid {
        grid-template-columns: 1fr;
    }

    .timesheet-context-facts > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}
