/* Card & Grid Foundations */
.cwp-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.cwp-card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cwp-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.cwp-card-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0 0;
}

.cwp-grid { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 640px) {
    .cwp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cwp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Forms */
.cwp-form-group { margin-bottom: 14px; }
.cwp-form-label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.cwp-form-control {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
}
.cwp-form-control:focus {
    border-color: #2563eb;
    outline: none;
}
.cwp-required { color: #dc2626; }

/* Buttons */
.cwp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}
.cwp-btn-primary { background: #2563eb; color: #ffffff; }
.cwp-btn-primary:hover { background: #1d4ed8; }
.cwp-btn-success { background: #16a34a; color: #ffffff; }
.cwp-btn-success:hover { background: #15803d; }

/* Badges & Metrics */
.cwp-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.cwp-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.cwp-metric-label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; }
.cwp-metric-value { font-size: 28px; font-weight: 800; margin: 6px 0 2px 0; }
.cwp-metric-sub { font-size: 12px; color: #94a3b8; }

.cwp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
}
.cwp-badge-green { background-color: #dcfce7; color: #15803d; }
.cwp-badge-yellow { background-color: #fef9c3; color: #a16207; }
.cwp-badge-red { background-color: #fee2e2; color: #b91c1c; }
.cwp-badge-gray { background-color: #f1f5f9; color: #475569; }

/* Table */
.cwp-table-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}
.cwp-filters-bar { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; background: #fafafa; }
.cwp-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cwp-table-responsive { overflow-x: auto; }
.cwp-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.cwp-table th { background: #f8fafc; padding: 12px 16px; font-weight: 600; color: #475569; border-bottom: 1px solid #e2e8f0; }
.cwp-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.cwp-cat-pill { background: #e2e8f0; color: #334155; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.cwp-btn-action { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; border: 1px solid #cbd5e1; background: #ffffff; color: #475569; text-decoration: none; cursor: pointer; }
.cwp-btn-action:hover { background: #f1f5f9; color: #0f172a; }

/* Preview box & Dossier */
.cwp-preview-stat { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; }
.cwp-stat-label { display: block; font-size: 11px; color: #64748b; margin-bottom: 2px; }
.cwp-stat-val { font-size: 13px; font-weight: bold; color: #0f172a; }
.cwp-details-header { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 20px 24px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 20px; }
.cwp-details-title { font-size: 20px; font-weight: 800; color: #0f172a; margin: 0 0 4px 0; }
.cwp-kv-list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cwp-kv-item { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
.cwp-alert { padding: 12px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.cwp-alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }
.cwp-alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.cwp-spin { animation: cwp-spin 1s infinite linear; }
@keyframes cwp-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
