/*
 * crm-detail.css
 * Stili condivisi tra le pagine dettaglio del modulo CRM (Salon, Employee, ecc.)
 * Caricato globalmente — non usare come scoped Razor CSS.
 */

/* ─── Loading ───────────────────────────────── */
.sd-loading {
    display: flex;
    justify-content: center;
    padding: 80px;
}

.sd-root {
    display: flex;
    flex-direction: column;
}

/* ─── Page header ───────────────────────────── */
.sd-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 32px 40px 26px;
    border-bottom: 1px solid var(--its-border);
    background: var(--its-surface);
}

.sd-ph-left {
    min-width: 0;
    flex: 1;
}

.sd-ph-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--its-gold-deep);
    margin-bottom: 8px;
}

.sd-back-link {
    color: var(--its-gold-deep);
    text-decoration: none;
    font-weight: 600;
    transition: opacity .12s;
}

.sd-back-link:hover { opacity: .7; }

.sd-ph-h1 {
    font-family: var(--its-serif);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.18;
    letter-spacing: -.005em;
    margin: 0;
    color: var(--its-text);
    text-wrap: balance;
}

.sd-ph-h1 em {
    font-style: italic;
    color: var(--its-gold-deep);
    font-weight: 400;
}

.sd-ph-sub {
    margin-top: 10px;
    font-size: 13px;
    color: var(--its-text-dim);
    line-height: 1.5;
    margin-bottom: 0;
}

.sd-ph-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: none;
    padding-top: 4px;
}

/* ─── Client hero card ──────────────────────── */
.sd-client-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 28px 40px;
    background: var(--its-surface);
    margin: 20px 40px;
    border: 1px solid var(--its-border);
    border-radius: var(--its-radius);
}

/* Avatar grande (initials) */
.sd-avatar-xl {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--its-mark-gradient);
    color: var(--its-gold);
    display: grid;
    place-items: center;
    font-family: var(--its-serif);
    font-weight: 500;
    font-size: 30px;
    flex-shrink: 0;
    overflow: hidden;
}

/* Avatar grande (foto reale) */
.sd-avatar-xl--photo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 0;
    background: var(--its-border);
    border: 1px solid var(--its-border);
}

/* Corpo hero */
.sd-ch-name {
    font-family: var(--its-serif);
    font-weight: 400;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -.01em;
    margin: 0 0 6px;
    color: var(--its-text);
}

.sd-ch-brand {
    font-size: 13px;
    color: var(--its-text-muted);
    margin-bottom: 8px;
}

.sd-ch-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sd-ch-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--its-text-dim);
    line-height: 1.4;
}

.sd-ch-meta b {
    color: var(--its-text);
    font-weight: 500;
}

/* Stats column */
.sd-client-stats {
    display: flex;
    gap: 28px;
    padding-right: 8px;
}

.sd-ks {
    text-align: right;
}

.sd-ks-v {
    font-family: var(--its-serif);
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -.015em;
    color: var(--its-text);
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}

.sd-ks-v small {
    font-family: var(--its-sans);
    font-size: .5em;
    color: var(--its-text-dim);
    margin-left: 1px;
}

.sd-ks-l {
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--its-text-muted);
    font-weight: 600;
    margin-top: 6px;
}

/* ─── Action bar (edit mode) ────────────────── */
.sd-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--its-border);
}

/* ─── Error / validation banner ─────────────── */
.sd-error-banner {
    margin: 0 36px 16px;
    padding: 12px 16px;
    background: #fff0f0;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 13px;
    color: #b91c1c;
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 1100px) {
    .sd-client-hero { grid-template-columns: auto 1fr; }
    .sd-client-stats { display: none; }
}

@media (max-width: 720px) {
    .sd-page-header { padding: 22px 20px 18px; flex-direction: column; align-items: flex-start; }
    .sd-ph-h1 { font-size: 28px; }
    .sd-client-hero { padding: 20px; gap: 16px; margin: 16px 16px; }
}

@media (max-width: 640px) {
    .sd-ch-name { font-size: 24px; }
    .sd-avatar-xl,
    .sd-avatar-xl--photo { width: 56px; height: 56px; font-size: 22px; }
    .sd-ch-meta { gap: 10px; font-size: 12px; }
    .sd-actions { flex-direction: column; }
    .sd-page-header { padding: 16px; }
}

/* ── Timeline (storico modifiche) — condiviso tra tutti i dettagli ── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 120px 20px 1fr;
    align-items: start;
    gap: 0 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--its-border);
    position: relative;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item .when {
    font-size: 12px;
    color: var(--its-text-muted);
    line-height: 1.5;
    text-align: right;
    padding-top: 1px;
}

.timeline-item .when b {
    display: block;
    font-weight: 600;
    color: var(--its-text);
    font-size: 13px;
}

.timeline-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--its-gold);
    border: 2px solid var(--its-surface);
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
}

.timeline-item .what {
    font-size: 13.5px;
    line-height: 1.5;
}

.timeline-item .what strong {
    display: block;
    font-weight: 500;
    color: var(--its-text);
}

.timeline-item .what small {
    display: block;
    font-size: 12px;
    color: var(--its-text-muted);
    margin-top: 2px;
}
