/* STV CAF Gestionale - Public CSS */

/* === Base Reset === */
.stv-caf-auth-container,
.stv-caf-dashboard,
.stv-caf-section {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e293b;
    line-height: 1.6;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* === Auth === */
.stv-caf-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.stv-caf-auth-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.stv-caf-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.stv-caf-auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.stv-caf-auth-header p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.stv-caf-auth-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stv-caf-auth-links a {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
}

.stv-caf-auth-links a:hover {
    text-decoration: underline;
}

/* === Forms === */
.stv-caf-form-group {
    margin-bottom: 16px;
}

.stv-caf-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.stv-caf-form-group input,
.stv-caf-form-group select,
.stv-caf-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.stv-caf-form-group input:focus,
.stv-caf-form-group select:focus,
.stv-caf-form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.stv-caf-form-row {
    display: flex;
    gap: 16px;
}

.stv-caf-form-half { flex: 1; }
.stv-caf-form-quarter { flex: 0.5; }

.stv-caf-form-message {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin: 12px 0;
    display: none;
}

.stv-caf-msg-error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.stv-caf-msg-success {
    display: block;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* === Buttons === */
.stv-caf-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

.stv-caf-btn-primary {
    background: #2563eb;
    color: #fff;
}

.stv-caf-btn-primary:hover { background: #1d4ed8; }

.stv-caf-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.stv-caf-btn-secondary:hover { background: #e2e8f0; }

.stv-caf-btn-outline {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.stv-caf-btn-outline:hover { background: #eff6ff; }

.stv-caf-btn-success { background: #16a34a; color: #fff; }
.stv-caf-btn-success:hover { background: #15803d; }
.stv-caf-btn-danger { background: #dc2626; color: #fff; }
.stv-caf-btn-danger:hover { background: #b91c1c; }

.stv-caf-btn-full { width: 100%; }
.stv-caf-btn-small { padding: 6px 14px; font-size: 13px; }
.stv-caf-btn-tiny { padding: 3px 10px; font-size: 12px; }

/* === Dashboard === */
.stv-caf-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stv-caf-dash-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

/* === Tabs === */
.stv-caf-dash-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.stv-caf-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.stv-caf-tab:hover { color: #2563eb; }
.stv-caf-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

.stv-caf-tab-content { display: none; }
.stv-caf-tab-content.active { display: block; }

.stv-caf-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 100px;
    margin-left: 4px;
}

/* === Stats === */
.stv-caf-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

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

.stv-caf-stat-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.stv-caf-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.stv-caf-stat-number { font-size: 32px; font-weight: 700; }
.stv-caf-stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }

.stv-caf-stat-blue { border-left: 4px solid #2563eb; }
.stv-caf-stat-blue .stv-caf-stat-number { color: #2563eb; }
.stv-caf-stat-green { border-left: 4px solid #16a34a; }
.stv-caf-stat-green .stv-caf-stat-number { color: #16a34a; }
.stv-caf-stat-orange { border-left: 4px solid #ea580c; }
.stv-caf-stat-orange .stv-caf-stat-number { color: #ea580c; }
.stv-caf-stat-red { border-left: 4px solid #dc2626; }
.stv-caf-stat-red .stv-caf-stat-number { color: #dc2626; }
.stv-caf-stat-purple { border-left: 4px solid #7c3aed; }
.stv-caf-stat-purple .stv-caf-stat-number { color: #7c3aed; }

/* === Cards === */
.stv-caf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.stv-caf-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stv-caf-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #0f172a;
}

/* === Status badges === */
.stv-caf-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.stv-caf-status-in_accettazione { background: #fef3c7; color: #92400e; }
.stv-caf-status-confermato { background: #dbeafe; color: #1e40af; }
.stv-caf-status-completato { background: #dcfce7; color: #166534; }
.stv-caf-status-annullato { background: #f1f5f9; color: #475569; }
.stv-caf-status-rifiutato { background: #fef2f2; color: #991b1b; }
.stv-caf-status-richiesto { background: #fef3c7; color: #92400e; }
.stv-caf-status-parzialmente_caricato { background: #fed7aa; color: #c2410c; }
.stv-caf-status-caricato { background: #dbeafe; color: #1e40af; }
.stv-caf-status-verificato { background: #dcfce7; color: #166534; }
.stv-caf-status-da_reinviare { background: #fef2f2; color: #991b1b; }
.stv-caf-status-aperta { background: #dbeafe; color: #1e40af; }
.stv-caf-status-in_lavorazione { background: #fef3c7; color: #92400e; }
.stv-caf-status-completata { background: #dcfce7; color: #166534; }
.stv-caf-status-archiviata { background: #f1f5f9; color: #475569; }

/* === Tables === */
.stv-caf-table {
    width: 100%;
    border-collapse: collapse;
}

.stv-caf-table th,
.stv-caf-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.stv-caf-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
}

.stv-caf-table tr:hover { background: #f8fafc; }

/* === Section Header === */
.stv-caf-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stv-caf-section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* === Appointments === */
.stv-caf-apt-card { position: relative; }
.stv-caf-apt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stv-caf-apt-details { font-size: 13px; color: #64748b; }
.stv-caf-apt-note { font-size: 13px; margin-top: 8px; padding: 8px 12px; background: #f8fafc; border-radius: 6px; }
.stv-caf-staff-note { background: #eff6ff; }
.stv-caf-reject-note { background: #fef2f2; color: #991b1b; }
.stv-caf-apt-date { font-size: 12px; color: #94a3b8; margin-top: 8px; }

/* === Documents === */
.stv-caf-doc-card, .stv-caf-doc-review-card { margin-bottom: 16px; }
.stv-caf-doc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stv-caf-doc-header h4 { margin: 0; font-size: 16px; }
.stv-caf-doc-meta { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.stv-caf-doc-nota { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.stv-caf-required { color: #dc2626; font-weight: 600; }
.stv-caf-uploaded-files { margin: 12px 0; }
.stv-caf-uploaded-files ul { list-style: none; padding: 0; margin: 4px 0; }
.stv-caf-uploaded-files li { padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.stv-caf-upload-section { margin-top: 12px; padding: 12px; background: #f8fafc; border-radius: 8px; }
.stv-caf-upload-row { display: flex; gap: 16px; }
.stv-caf-upload-item { flex: 1; }
.stv-caf-upload-message { margin-top: 8px; }
.stv-caf-verify-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e2e8f0; }

/* === Cases === */
.stv-caf-case-card { margin-bottom: 16px; }
.stv-caf-case-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stv-caf-case-header h4 { margin: 0; font-size: 16px; font-family: monospace; }
.stv-caf-case-details { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.stv-caf-case-desc { font-size: 14px; margin: 8px 0; }
.stv-caf-case-note { font-size: 13px; color: #64748b; }
.stv-caf-case-date { font-size: 12px; color: #94a3b8; margin-top: 8px; }

/* === Quick Actions === */
.stv-caf-quick-actions h3 { font-size: 18px; margin-bottom: 12px; }
.stv-caf-actions-grid { display: flex; gap: 12px; flex-wrap: wrap; }

/* === Notifications === */
.stv-caf-notif-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}
.stv-caf-notif-item:hover { background: #f8fafc; }
.stv-caf-notif-unread { background: #eff6ff; border-left: 3px solid #2563eb; }
.stv-caf-notif-title { font-weight: 600; font-size: 14px; }
.stv-caf-notif-msg { font-size: 13px; color: #64748b; margin-top: 4px; }
.stv-caf-notif-date { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* === Modal === */
.stv-caf-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}

.stv-caf-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.stv-caf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.stv-caf-modal-header h3 { margin: 0; font-size: 20px; }

.stv-caf-modal-close {
    background: none; border: none; font-size: 24px; cursor: pointer;
    color: #64748b; padding: 4px 8px;
}
.stv-caf-modal-close:hover { color: #0f172a; }

.stv-caf-modal-body { padding: 24px; }

.stv-caf-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* === Notice === */
.stv-caf-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.stv-caf-notice-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* === Loading & Empty === */
.stv-caf-loading { text-align: center; color: #64748b; padding: 40px; }
.stv-caf-empty, .stv-caf-empty-state { text-align: center; color: #94a3b8; padding: 40px; }
.stv-caf-empty-state p { font-size: 16px; }

/* === Filter bar === */
.stv-caf-filter-bar select {
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

/* === Doc req item === */
.stv-caf-doc-req-item {
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

/* v2.0.0: Agenda styles */
.stv-caf-agenda-filters {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: flex-end;
}
.stv-caf-agenda-filters select,
.stv-caf-agenda-filters input {
    padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; background: #fff;
}
.stv-caf-agenda-filters select { min-width: 120px; }
.stv-caf-agenda-filters input[type="date"] { width: 140px; }
.stv-caf-agenda-filters input[type="text"] { width: 180px; }

.stv-caf-agenda-row {
    display: grid; grid-template-columns: 90px 1fr 1fr 1fr 1fr 100px 80px;
    gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; align-items: center;
}
.stv-caf-agenda-row:hover { background: #f8fafc; }
.stv-caf-agenda-head {
    font-weight: 600; color: #475569; background: #f8fafc; border-radius: 6px 6px 0 0; font-size: 12px;
}
.stv-caf-agenda-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stv-caf-agenda-cell-wrap { white-space: normal; word-break: break-word; }

.stv-caf-agenda-doc-indicator { display: inline-flex; gap: 2px; font-size: 11px; }
.stv-caf-agenda-doc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Calendar week */
.stv-caf-cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e2e8f0; border-radius: 8px 8px 0 0; overflow: hidden; }
.stv-caf-cal-header-cell { background: #f1f5f9; padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 600; color: #475569; }
.stv-caf-cal-header-cell.today { background: #dbeafe; color: #1e40af; }
.stv-caf-cal-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e2e8f0; min-height: 300px; }
.stv-caf-cal-day { background: #fff; padding: 4px; min-height: 80px; overflow-y: auto; }
.stv-caf-cal-day.today { background: #eff6ff; }
.stv-caf-cal-event { padding: 3px 6px; margin-bottom: 2px; border-radius: 4px; font-size: 11px; cursor: pointer; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stv-caf-cal-event:hover { opacity: 0.85; }
.stv-caf-cal-ev-confirmed { background: #dbeafe; color: #1e40af; }
.stv-caf-cal-ev-pending { background: #fef3c7; color: #92400e; }
.stv-caf-cal-ev-completed { background: #dcfce7; color: #166534; }
.stv-caf-cal-ev-cancelled { background: #f1f5f9; color: #475569; }
.stv-caf-cal-ev-rejected { background: #fef2f2; color: #991b1b; }
.stv-caf-cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stv-caf-cal-nav h4 { margin: 0; font-size: 15px; }

.stv-caf-view-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.stv-caf-view-btn { padding: 6px 14px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; }
.stv-caf-view-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

@media (max-width: 768px) {
    .stv-caf-agenda-filters { flex-direction: column; }
    .stv-caf-agenda-filters select,
    .stv-caf-agenda-filters input { width: 100%; }
    .stv-caf-agenda-row { grid-template-columns: 1fr; gap: 2px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; }
    .stv-caf-agenda-head { display: none; }
    .stv-caf-agenda-cell { white-space: normal; }
    .stv-caf-agenda-cell::before { font-weight: 600; color: #64748b; font-size: 11px; display: block; }
    .stv-caf-cal-header { grid-template-columns: repeat(7, 1fr); }
    .stv-caf-cal-header-cell { font-size: 10px; padding: 6px 2px; }
    .stv-caf-cal-body { grid-template-columns: repeat(7, 1fr); }
    .stv-caf-cal-day { min-height: 50px; padding: 2px; }
    .stv-caf-cal-event { font-size: 10px; padding: 2px 4px; }
}

/* === Responsive === */

/* v1.7.2: Document card responsive system */
.stv-caf-doc-card-v2 {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stv-caf-doc-card-v2 * { box-sizing: border-box; }

.stv-caf-doc-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.stv-caf-doc-header-v2 h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
}

.stv-caf-doc-meta-v2 {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.stv-caf-doc-note-box {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    word-break: break-word;
}

.stv-caf-doc-note-info { background: #f8fafc; color: #475569; }
.stv-caf-doc-note-warn { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.stv-caf-doc-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}

.stv-caf-doc-file-name {
    min-width: 0;
    word-break: break-all;
    overflow-wrap: break-word;
    flex: 1;
}

.stv-caf-doc-file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.stv-caf-doc-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stv-caf-doc-upload-box {
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
}

.stv-caf-doc-upload-box p { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.stv-caf-doc-upload-box input[type="file"] { font-size: 12px; max-width: 100%; }

.stv-caf-doc-upload-single {
    padding: 14px;
    border-radius: 8px;
    text-align: center;
}
.stv-caf-doc-upload-single p { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.stv-caf-doc-upload-single input[type="file"] { font-size: 12px; max-width: 100%; }

@media (max-width: 768px) {
    .stv-caf-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stv-caf-stats-5 { grid-template-columns: repeat(2, 1fr); }
    .stv-caf-form-row { flex-direction: column; gap: 0; }
    .stv-caf-section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .stv-caf-dash-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .stv-caf-dash-header h2 { font-size: 20px; }
    .stv-caf-dash-tabs { flex-wrap: wrap; gap: 0; }
    .stv-caf-tab { padding: 8px 14px; font-size: 13px; }
    .stv-caf-upload-row { flex-direction: column; }
    .stv-caf-modal { padding: 12px 8px; }
    .stv-caf-modal-content { border-radius: 12px; }
    .stv-caf-modal-body { padding: 16px; }
    .stv-caf-card { padding: 16px; }
    .stv-caf-card-header { flex-direction: column; gap: 8px; align-items: flex-start; }

    .stv-caf-auth-container,
    .stv-caf-dashboard,
    .stv-caf-section { padding: 12px; }

    .stv-caf-auth-card { padding: 24px 16px; }
    .stv-caf-stat-card { padding: 14px; }
    .stv-caf-stat-number { font-size: 24px; }
    .stv-caf-stat-label { font-size: 12px; }
    .stv-caf-section-header h2 { font-size: 20px; }

    /* Document cards mobile */
    .stv-caf-doc-card-v2 { padding: 14px; margin-bottom: 12px; }
    .stv-caf-doc-header-v2 { flex-direction: column; gap: 6px; }
    .stv-caf-doc-header-v2 h4 { font-size: 15px; }

    .stv-caf-doc-file-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .stv-caf-doc-file-actions {
        align-self: stretch;
        justify-content: flex-start;
    }

    .stv-caf-doc-upload-grid {
        grid-template-columns: 1fr;
    }

    .stv-caf-doc-upload-box { padding: 12px; }
    .stv-caf-doc-upload-single { padding: 12px; }

    /* Table responsive */
    .stv-caf-table th,
    .stv-caf-table td { padding: 8px 10px; font-size: 13px; }

    /* Buttons */
    .stv-caf-btn { padding: 8px 14px; font-size: 13px; }
    .stv-caf-btn-full { display: block; }
    .stv-caf-actions-grid { flex-direction: column; }
    .stv-caf-actions-grid .stv-caf-btn { width: 100%; text-align: center; }

    /* Apt details */
    .stv-caf-apt-header { flex-direction: column; gap: 6px; align-items: flex-start; }
    .stv-caf-apt-details { word-break: break-word; }
}

@media (max-width: 480px) {
    .stv-caf-stats-grid { grid-template-columns: 1fr; }
    .stv-caf-stats-5 { grid-template-columns: 1fr; }
    .stv-caf-doc-card-v2 { padding: 12px; border-radius: 8px; }
    .stv-caf-btn-tiny { padding: 4px 8px; font-size: 11px; }
}
