/*
 * ══════════════════════════════════════════════════════════════
 *  AOC UI — Design System
 *  Adognicosto Srl · Portale Strumenti Interni
 *  v1.0.0 · Febbraio 2026
 * ══════════════════════════════════════════════════════════════
 *
 *  UTILIZZO:
 *  <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
 *  <link href="../aoc-assets/aoc-style.css" rel="stylesheet">
 *
 *  INDICE:
 *  1. Temi (Dark / Light / AOC Verde)
 *  2. Reset & Base
 *  3. Typography
 *  4. Scrollbar
 *  5. Layout (Header, Content, Footer)
 *  6. Cards
 *  7. Badges
 *  8. Bottoni
 *  9. Form & Input
 * 10. Tabelle
 * 11. Drop Zone (file upload)
 * 12. Toast Notifications
 * 13. Modal / Dialog
 * 14. Stats
 * 15. Sezioni
 * 16. Animazioni
 * 17. Utility Classes
 * 18. Responsive
 * ══════════════════════════════════════════════════════════════
 */


/* ════════════════════════════════════════
   1. TEMI
   ════════════════════════════════════════ */

:root, [data-theme="dark"] {
    /* Background & Surface */
    --bg: #0f0f1a;
    --surface: #1a1a2e;
    --surface2: #252542;
    --surface3: #2a2a4a;
    --bg-hover: #2a2a4a;

    /* Borders */
    --border: #2a2a4a;
    --border-light: #3a3a5a;

    /* Text */
    --text: #f1f1f1;
    --text-dim: #a0a0b8;
    --text-muted: #606078;

    /* Accent (rosso AOC) */
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --accent-glow: rgba(233, 69, 96, 0.12);

    /* Semantic */
    --success: #4ade80;
    --success-dim: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-dim: rgba(251, 191, 36, 0.15);
    --error: #ef4444;
    --error-dim: rgba(239, 68, 68, 0.15);
    --info: #60a5fa;
    --info-dim: rgba(96, 165, 250, 0.15);

    /* Special */
    --trade-in: #00b8d4;
    --trade-in-glow: rgba(0, 184, 212, 0.12);
    --admin: #a855f7;
    --admin-glow: rgba(168, 85, 247, 0.12);

    /* Effects */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);

    /* Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Logo */
    --logo-filter: brightness(1.2);
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface2: #e8e8eb;
    --surface3: #dcdce0;
    --bg-hover: #dcdce0;
    --border: #d1d1d6;
    --border-light: #c7c7cc;
    --text: #1d1d1f;
    --text-dim: #6e6e73;
    --text-muted: #8e8e93;
    --accent: #e94560;
    --accent-hover: #d63850;
    --accent-glow: rgba(233, 69, 96, 0.08);
    --success: #34c759;
    --success-dim: rgba(52, 199, 89, 0.15);
    --warning: #ff9500;
    --warning-dim: rgba(255, 149, 0, 0.15);
    --error: #ff3b30;
    --error-dim: rgba(255, 59, 48, 0.12);
    --info: #007aff;
    --info-dim: rgba(0, 122, 255, 0.12);
    --trade-in: #0097a7;
    --trade-in-glow: rgba(0, 151, 167, 0.1);
    --admin: #7c3aed;
    --admin-glow: rgba(124, 58, 237, 0.1);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --logo-filter: none;
}

[data-theme="aoc"] {
    --bg: #e8f0e8;
    --surface: #f4f9f4;
    --surface2: #dce8dc;
    --surface3: #c8dcc8;
    --bg-hover: #c8dcc8;
    --border: #b8d4b8;
    --border-light: #a0c4a0;
    --text: #1a2e1a;
    --text-dim: #4a6a4a;
    --text-muted: #6a8a6a;
    --accent: #5b9a2d;
    --accent-hover: #4a8024;
    --accent-glow: rgba(91, 154, 45, 0.12);
    --success: #5b9a2d;
    --success-dim: rgba(91, 154, 45, 0.2);
    --warning: #d4a017;
    --warning-dim: rgba(212, 160, 23, 0.2);
    --error: #c0392b;
    --error-dim: rgba(192, 57, 43, 0.15);
    --info: #2e7d8c;
    --info-dim: rgba(46, 125, 140, 0.15);
    --trade-in: #2e7d8c;
    --trade-in-glow: rgba(46, 125, 140, 0.12);
    --admin: #6b21a8;
    --admin-glow: rgba(107, 33, 168, 0.12);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --logo-filter: none;
}


/* ════════════════════════════════════════
   2. RESET & BASE
   ════════════════════════════════════════ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}


/* ════════════════════════════════════════
   3. TYPOGRAPHY
   ════════════════════════════════════════ */

/* Font monospace per numeri, codici, IMEI, tabelle dati */
.mono, .data-value, code, pre, kbd {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

.text-sm   { font-size: 0.8rem; }
.text-xs   { font-size: 0.72rem; }
.text-xxs  { font-size: 0.65rem; }
.text-lg   { font-size: 1.1rem; }
.text-xl   { font-size: 1.35rem; }

.label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}


/* ════════════════════════════════════════
   4. SCROLLBAR
   ════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}


/* ════════════════════════════════════════
   5. LAYOUT — Header, Content, Footer
   ════════════════════════════════════════ */

/* --- App Header (sticky top bar) --- */
.aoc-header {
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: background 0.3s, border-color 0.3s;
}

.aoc-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.aoc-header-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.aoc-header-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.aoc-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Back to Home button (nell'header) --- */
.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-home:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* --- Content area --- */
.aoc-content {
    padding: 28px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Footer --- */
.aoc-footer {
    text-align: center;
    padding: 24px 28px;
    color: var(--text-muted);
    font-size: 0.72rem;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}


/* ════════════════════════════════════════
   6. CARDS
   ════════════════════════════════════════ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.cards-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.cards-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

/* Card base */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

/* Barra rossa hover (signature AOC) */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card:hover::before {
    opacity: 1;
}

/* Card icon */
.card-icon-box {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
}

/* Card content */
.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Card arrow (animata su hover) */
.card-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.2s;
    margin-top: 6px;
    flex-shrink: 0;
}

.card:hover .card-arrow {
    opacity: 1;
    color: var(--accent);
    transform: translateX(3px);
}

/* Card semplice (senza icon-box, layout verticale) */
.card-simple {
    flex-direction: column;
    gap: 8px;
}


/* ════════════════════════════════════════
   7. BADGES
   ════════════════════════════════════════ */

.card-badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    font-size: 0.58rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.badge-success {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-warning {
    background: var(--warning-dim);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-error {
    background: var(--error-dim);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: var(--info-dim);
    color: var(--info);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.badge-trade-in {
    background: var(--trade-in-glow);
    color: var(--trade-in);
    border: 1px solid rgba(0, 184, 212, 0.3);
}

.badge-neutral {
    background: var(--surface3);
    color: var(--text-dim);
    border: 1px solid var(--border);
}


/* ════════════════════════════════════════
   8. BOTTONI
   ════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary (accent rosso) */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Secondary (bordo) */
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* Ghost (trasparente) */
.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text);
}

/* Success */
.btn-success {
    background: var(--success);
    color: #000;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Danger */
.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Sizes */
.btn-sm {
    padding: 7px 14px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 0.95rem;
}

/* Icon-only button */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 1rem;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* ════════════════════════════════════════
   9. FORM & INPUT
   ════════════════════════════════════════ */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23606078' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-select option {
    background: var(--surface);
    color: var(--text);
}

/* Search box (come header homepage) */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.84rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Checkbox & Radio custom */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.84rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Inline form */
.form-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
}


/* ════════════════════════════════════════
   10. TABELLE
   ════════════════════════════════════════ */

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.aoc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.aoc-table thead {
    background: var(--surface2);
    position: sticky;
    top: 0;
    z-index: 5;
}

.aoc-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.aoc-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    vertical-align: middle;
}

.aoc-table tbody tr {
    transition: background 0.1s;
}

.aoc-table tbody tr:hover {
    background: var(--bg-hover);
}

.aoc-table tbody tr:last-child td {
    border-bottom: none;
}

/* Cella numerica (allineata a destra, monospace) */
.aoc-table td.num,
.aoc-table th.num {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

/* Cella positiva/negativa */
.aoc-table td.positive { color: var(--success); }
.aoc-table td.negative { color: var(--error); }

/* Riga totale */
.aoc-table tr.row-total {
    background: var(--surface2);
    font-weight: 700;
}

.aoc-table tr.row-total td {
    color: var(--text);
    border-top: 2px solid var(--border-light);
}

/* Table compact */
.aoc-table-compact th,
.aoc-table-compact td {
    padding: 8px 12px;
}

/* Table striped */
.aoc-table-striped tbody tr:nth-child(even) {
    background: var(--surface2);
}


/* ════════════════════════════════════════
   11. DROP ZONE (file upload)
   ════════════════════════════════════════ */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.01);
}

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.drop-zone-text {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.drop-zone-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}


/* ════════════════════════════════════════
   12. TOAST NOTIFICATIONS
   ════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: var(--success);
    color: #000;
}

.toast-error {
    background: var(--error);
    color: #fff;
}

.toast-warning {
    background: var(--warning);
    color: #000;
}

.toast-info {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.toast-exit {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}


/* ════════════════════════════════════════
   13. MODAL / DIALOG
   ════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}


/* ════════════════════════════════════════
   14. STATS
   ════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.stat-value.accent  { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.error   { color: var(--error); }
.stat-value.info    { color: var(--info); }


/* ════════════════════════════════════════
   15. SEZIONI
   ════════════════════════════════════════ */

.section {
    margin-bottom: 32px;
    animation: fadeUp 0.4s ease both;
}

.section:nth-child(2) { animation-delay: 0.05s; }
.section:nth-child(3) { animation-delay: 0.10s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.20s; }
.section:nth-child(6) { animation-delay: 0.25s; }

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.section-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
}

.section-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 3px 9px;
    border-radius: 10px;
}


/* ════════════════════════════════════════
   16. ANIMAZIONI
   ════════════════════════════════════════ */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Classe utility per animazione */
.animate-fadeUp {
    animation: fadeUp 0.4s ease both;
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease both;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}


/* ════════════════════════════════════════
   17. UTILITY CLASSES
   ════════════════════════════════════════ */

/* Display */
.hidden      { display: none !important; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-sm      { gap: 8px; }
.gap-md      { gap: 14px; }
.gap-lg      { gap: 24px; }

/* Spacing */
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 28px; }
.p-sm  { padding: 8px; }
.p-md  { padding: 16px; }
.p-lg  { padding: 28px; }

/* Colors */
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error   { color: var(--error); }
.text-info    { color: var(--info); }
.text-dim     { color: var(--text-dim); }
.text-muted   { color: var(--text-muted); }

/* Background */
.bg-surface  { background: var(--surface); }
.bg-surface2 { background: var(--surface2); }

/* Border */
.border      { border: 1px solid var(--border); }
.rounded     { border-radius: var(--radius); }
.rounded-sm  { border-radius: var(--radius-sm); }

/* Text alignment */
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Width */
.w-full { width: 100%; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Tag/Chip */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--surface2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

/* Progress bar */
.progress {
    height: 6px;
    background: var(--surface2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }


/* ════════════════════════════════════════
   18. RESPONSIVE
   ════════════════════════════════════════ */

@media (max-width: 900px) {
    .aoc-content {
        padding: 20px 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .aoc-header {
        padding: 12px 16px;
    }

    .form-inline {
        flex-direction: column;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }
}

@media (max-width: 600px) {
    .aoc-content {
        padding: 14px 12px;
    }

    .aoc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.15rem; }

    .btn-group {
        flex-direction: column;
    }
}

/* ════════════════════════════════════════
   GUIDE CORRELATE — cross-link tra le guide del Portale Guide
   ════════════════════════════════════════ */
.related-guides {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}
.related-guide {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s;
}
.related-guide:hover {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateY(-1px);
}
.related-guide-ico { font-size: 1.3rem; line-height: 1.2; flex-shrink: 0; }
.related-guide-txt { display: flex; flex-direction: column; min-width: 0; }
.related-guide-ttl { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.related-guide-dsc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }
