/* Area clienti e relative pagine admin (si appoggia alle variabili di admin.css) */

.ac-wrap { max-width: 920px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.ac-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.ac-brand { display: flex; align-items: center; gap: 12px; color: var(--m35-ink); text-decoration: none; }
.ac-brand img { width: 40px; height: 40px; border-radius: 10px; }
.ac-brand small { display: block; color: var(--m35-slate); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ac-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ac-nav form { margin: 0; }

.ac-h1 { font-size: 1.7rem; margin: 0 0 4px; }
.ac-lead { color: var(--m35-slate); margin: 0 0 2rem; }
.ac-h2 { font-size: 1.15rem; margin: 2.5rem 0 1rem; display: flex; align-items: center; gap: 10px; }
.ac-h2 span { color: var(--m35-slate); font-weight: 400; font-size: 0.85rem; }

.ac-card {
    background: var(--m35-panel);
    border: 1px solid var(--m35-border);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}
.ac-card-accent { border-left: 3px solid var(--m35-accent); }
.ac-card-warn { border-left: 3px solid #EAB308; }
.ac-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.ac-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
/* Il testo a sinistra si restringe, così prezzo e stato restano a destra anche con descrizioni lunghe */
.ac-row > :first-child { flex: 1 1 260px; min-width: 0; }
.ac-muted { color: var(--m35-slate); font-size: 0.85rem; }
.ac-price { font-family: 'Roboto Mono', monospace; font-weight: 700; white-space: nowrap; }
.ac-big { font-size: 1.5rem; }

.ac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.ac-stat { background: var(--m35-panel); border: 1px solid var(--m35-border); border-radius: 12px; padding: 1rem 1.1rem; }
.ac-stat div { color: var(--m35-slate); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ac-stat strong { display: block; font-family: 'Roboto Mono', monospace; font-size: 1.25rem; margin-top: 4px; }

.ac-badge { display: inline-block; font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--m35-border); color: var(--m35-slate); white-space: nowrap; }
.ac-badge-ok { color: #5eead4; border-color: rgba(13, 148, 136, 0.6); background: rgba(13, 148, 136, 0.12); }
.ac-badge-warn { color: #fde68a; border-color: rgba(234, 179, 8, 0.5); background: rgba(234, 179, 8, 0.1); }
.ac-badge-err { color: #fca5a5; border-color: rgba(220, 38, 38, 0.5); background: rgba(220, 38, 38, 0.1); }
.ac-badge-info { color: #93c5fd; border-color: rgba(41, 121, 255, 0.5); background: rgba(41, 121, 255, 0.1); }

.ac-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ac-table th, .ac-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--m35-border); vertical-align: top; }
.ac-table th { color: var(--m35-slate); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ac-table td.num, .ac-table th.num { text-align: right; font-family: 'Roboto Mono', monospace; white-space: nowrap; }
.ac-table-wrap { overflow-x: auto; }

.ac-btn, .ac-btn-ghost, .ac-btn-danger {
    display: inline-block;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
}
.ac-btn { background: var(--m35-accent); color: #fff; border: 1px solid var(--m35-accent); }
.ac-btn:hover { filter: brightness(1.1); }
.ac-btn-ghost { background: transparent; color: var(--m35-ink); border: 1px solid var(--m35-border); }
.ac-btn-ghost:hover { border-color: var(--m35-accent); }
.ac-btn-danger { background: transparent; color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.5); }
.ac-btn-small { padding: 6px 11px; font-size: 0.78rem; }

.ac-form { display: grid; gap: 12px; }
.ac-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ac-field { display: flex; flex-direction: column; gap: 5px; }
.ac-field label, .ac-label { font-size: 0.78rem; color: var(--m35-slate); }
.ac-field input, .ac-field select, .ac-field textarea, .ac-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--m35-border);
    color: var(--m35-ink);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
}
.ac-field select option { color: #111; }
.ac-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.ac-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ac-inline form { margin: 0; }

.ac-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.ac-choice { position: relative; }
.ac-choice input { position: absolute; opacity: 0; }
.ac-choice label {
    display: block;
    border: 1px solid var(--m35-border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
}
.ac-choice label strong { display: block; font-size: 0.95rem; }
.ac-choice label span { font-family: 'Roboto Mono', monospace; font-size: 0.85rem; color: var(--m35-slate); }
.ac-choice input:checked + label { border-color: var(--m35-accent); background: rgba(13, 148, 136, 0.15); }
.ac-choice input:focus-visible + label { outline: 2px solid var(--m35-accent); outline-offset: 2px; }

.ac-bank { background: rgba(13, 148, 136, 0.08); border: 1px dashed rgba(13, 148, 136, 0.6); border-radius: 12px; padding: 1rem 1.2rem; font-size: 0.9rem; }
.ac-bank dt { color: var(--m35-slate); font-size: 0.75rem; margin-top: 8px; }
.ac-bank dd { margin: 2px 0 0; font-family: 'Roboto Mono', monospace; word-break: break-all; }

.ac-copy { font-family: 'Roboto Mono', monospace; font-size: 0.8rem; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--m35-border); border-radius: 8px; padding: 10px; word-break: break-all; }

details.ac-details { margin-top: 10px; }
details.ac-details summary { cursor: pointer; color: var(--m35-accent); font-size: 0.86rem; font-weight: 600; }
details.ac-details[open] summary { margin-bottom: 10px; }

.ac-footer { margin-top: 3rem; color: var(--m35-slate); font-size: 0.8rem; text-align: center; }

@media (max-width: 600px) {
    .ac-wrap { padding: 1.5rem 1rem 3rem; }
    .ac-h1 { font-size: 1.4rem; }
    .ac-hide-mobile { display: none; }
}

@media (max-width: 600px) {
    /* Prezzo e stato vanno sotto al testo: allineati a sinistra come il resto */
    .ac-row > :last-child:not(:first-child) { text-align: left !important; }

    /* Tabella delle rate: ogni rata diventa un riquadro, così "Ho pagato" resta visibile senza scorrere di lato */
    .ac-table-stack thead { display: none; }
    .ac-table-stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--m35-border); }
    .ac-table-stack td, .ac-table-stack td.num { border: 0; padding: 0; text-align: left; }
    .ac-table-stack td[data-label]::before { content: attr(data-label) ' '; color: var(--m35-slate); font-family: 'Inter', sans-serif; font-size: 0.75rem; }
    .ac-table-stack td:last-child { grid-column: 1 / -1; }
    .ac-table-stack details.ac-details { margin-top: 0; }
}
