/* ==========================================================================
   ICE Maroc - Styles Espace Client & Administration API
   Complète dist/output.css et garantit un espacement aéré sans recouvrement
   ========================================================================== */

.ice-portal {
    padding-top: 1.5rem;
    padding-bottom: 3.5rem;
    line-height: 1.6;
}

/* Conteneur élargi sur les dashboards pour éviter que les tableaux soient écrasés */
@media (min-width: 1024px) {
    .container.max-w-4xl {
        max-width: 72rem !important;
    }
}

/* Cartes & Sections */
.ice-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
    .ice-card {
        padding: 2.25rem;
        margin-bottom: 2.5rem;
    }
}

.ice-card-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    .ice-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Navigation Onglets Espace Client */
.ice-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.75rem;
}

.ice-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 0.65rem;
    font-size: 0.925rem;
    font-weight: 600;
    color: #4b5563;
    background-color: #f3f4f6;
    transition: all 0.15s ease;
    text-decoration: none;
}

.ice-tab:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.ice-tab.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

/* Grilles responsives aérées */
.ice-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-bottom: 2.25rem;
}

.ice-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

.ice-grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

@media (min-width: 768px) {
    .ice-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ice-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ice-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .ice-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Cartes KPI */
.ice-kpi-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
}

.ice-kpi-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.ice-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.ice-kpi-sub {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Badges sans recouvrement */
.ice-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.ice-badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.ice-badge-green {
    background-color: #dcfce7;
    color: #166534;
}

.ice-badge-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.ice-badge-yellow {
    background-color: #fef9c3;
    color: #854d0e;
}

.ice-badge-dark {
    background-color: #111827;
    color: #ffffff;
}

/* Tableaux aérés */
.ice-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ice-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.ice-table th {
    padding: 0.9rem 1rem;
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4b5563;
    white-space: nowrap;
}

.ice-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    line-height: 1.5;
    color: #1f2937;
}

.ice-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Formulaires */
.ice-form-group {
    margin-bottom: 1.15rem;
}

.ice-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.ice-input,
.ice-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    background-color: #ffffff;
    color: #111827;
}

.ice-input:focus,
.ice-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Boutons */
.ice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.15rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
}

.ice-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

.ice-btn-primary {
    background-color: #2563eb;
    color: #ffffff;
}
.ice-btn-primary:hover {
    background-color: #1d4ed8;
}

.ice-btn-success {
    background-color: #16a34a;
    color: #ffffff;
}
.ice-btn-success:hover {
    background-color: #15803d;
}

.ice-btn-dark {
    background-color: #111827;
    color: #ffffff;
}
.ice-btn-dark:hover {
    background-color: #374151;
}

.ice-btn-outline {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.ice-btn-outline:hover {
    background-color: #f3f4f6;
}

.ice-btn-danger-outline {
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.ice-btn-danger-outline:hover {
    background-color: #ffe4e6;
}

/* Blocs Documentation API */
.ice-endpoint-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

@media (min-width: 768px) {
    .ice-endpoint-card {
        padding: 2.25rem;
    }
}

.ice-url-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.65rem;
    padding: 0.85rem 1.15rem;
    margin: 1rem 0 1.25rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    color: #1e3a8a;
    word-break: break-all;
}

.ice-method-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    background-color: #2563eb;
    color: #ffffff;
}

.ice-method-tag.post {
    background-color: #059669;
}

.ice-code-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.ice-code-block {
    background-color: #0f172a;
    color: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.65;
}

.ice-inline-code {
    display: inline-block;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.35rem;
    padding: 0.1rem 0.45rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: #111827;
    line-height: 1.4;
}
