/* ── Adozioni Scolastiche v2 ── */

.as-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a2e;
    max-width: 100%;
    font-size: 14px;
}

/* Filters */
.as-filters {
    background: #f0f4f8;
    border: 1px solid #d0dae5;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.as-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.as-fg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 150px;
}
.as-fg label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.as-fg input,
.as-fg select {
    padding: 8px 10px;
    border: 1px solid #c5d0dc;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #1a1a2e;
    transition: border-color .15s, box-shadow .15s;
}
.as-fg input:focus,
.as-fg select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.as-fg-actions {
    flex: 0;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    min-width: auto;
}

/* Buttons */
.as-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    border: none;
    transition: background .15s, box-shadow .15s;
    white-space: nowrap;
}
.as-btn-primary  { background: #2563eb; color: #fff !important; }
.as-btn-primary:hover { background: #1d4ed8; }
.as-btn-outline  { background: #fff; color: #374151 !important; border: 1px solid #c5d0dc; }
.as-btn-outline:hover { background: #f0f4f8; }
.as-btn-export   { background: #059669; color: #fff !important; }
.as-btn-export:hover  { background: #047857; }

/* Toolbar */
.as-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.as-count { font-size: 13px; color: #6b7280; font-weight: 500; }

/* Table */
.as-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #d0dae5;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.as-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}
.as-table thead tr {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
}
.as-table th {
    padding: 11px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.as-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #e8edf3;
    vertical-align: top;
    line-height: 1.4;
}
.as-table tbody tr:last-child td { border-bottom: none; }
.as-table tbody tr:hover { background: #f0f7ff; }

.as-table code {
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: .03em;
}
.as-titolo { max-width: 300px; }
.as-ind    { max-width: 200px; font-size: 12px; color: #4a5568; }
.as-num    { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.as-vol    { font-size: 11px; color: #6b7280; }

/* Badges */
.as-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.as-tipo { background: #dbeafe; color: #1e40af; }
.as-yes  { background: #d1fae5; color: #065f46; }
.as-no   { background: #f3f4f6; color: #6b7280; }
.as-cons { background: #fef3c7; color: #92400e; }

/* Empty / Loading */
.as-empty, .as-loading {
    text-align: center;
    padding: 36px;
    color: #6b7280;
    font-size: 15px;
    background: #fff;
}
.as-loading { color: #2563eb; font-weight: 600; }

/* Legend */
.as-legend {
    margin-top: 14px;
    font-size: 13px;
    color: #4a5568;
    border: 1px solid #d0dae5;
    border-radius: 8px;
    padding: 8px 14px;
    background: #f8fafc;
}
.as-legend summary { cursor: pointer; font-weight: 600; user-select: none; }
.as-legend ul { margin: 8px 0 6px 18px; padding: 0; }
.as-legend li { margin-bottom: 3px; }

/* Responsive */
@media (max-width: 768px) {
    .as-fg        { min-width: 100%; }
    .as-fg-actions { width: 100%; }
    .as-btn       { flex: 1; justify-content: center; }
    .as-table th,
    .as-table td  { padding: 7px 8px; font-size: 12px; }
    /* Hide less critical columns on mobile */
    .as-table th:nth-child(4),  /* Vol. */
    .as-table td:nth-child(4),
    .as-table th:nth-child(9),  /* Cons. */
    .as-table td:nth-child(9),
    .as-table th:nth-child(11), /* Indirizzo */
    .as-table td:nth-child(11) { display: none; }
}

/* ── PDF additions (v2.1) ───────────────────────────────────────────────── */

/* Static banner (from shortcode attr) */
.as-pdf-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 500;
    color: #065f46;
}

/* Dynamic bar (shown when user selects a class with a PDF) */
.as-pdf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 500;
    color: #1e40af;
}

/* PDF download button */
.as-btn-pdf {
    background: #7c3aed;
    color: #fff !important;
    white-space: nowrap;
}
.as-btn-pdf:hover { background: #6d28d9; }

/* PDF column in table */
.as-col-pdf {
    text-align: center;
    width: 36px;
    padding: 9px 6px !important;
}
.as-pdf-link {
    font-size: 18px;
    text-decoration: none;
    line-height: 1;
    display: inline-block;
    transition: transform .15s;
}
.as-pdf-link:hover { transform: scale(1.25); }
.as-pdf-none { color: #d1d5db; font-size: 13px; }

/* Responsive: keep PDF column visible always */
@media (max-width: 768px) {
    .as-pdf-banner, .as-pdf-bar { flex-direction: column; align-items: flex-start; }
    .as-btn-pdf { width: 100%; justify-content: center; }
}
