/* === Dashboard Stripe === */
.ssm-stripe-dashboard {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.ssm-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.ssm-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ssm-header-left h2 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.ssm-status-connected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #dcfce7;
    color: #166534;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.ssm-status-dot {
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ssm-header-right {
    display: flex;
    gap: 10px;
}

.ssm-btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    font-size: 14px;
}

.ssm-btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.ssm-btn-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

/* === Résumé du compte === */
.ssm-account-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 24px 30px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.ssm-summary-card {
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.ssm-summary-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.ssm-summary-value {
    font-size: 18px;
    color: #111827;
    font-weight: 600;
}

.ssm-summary-value code {
    font-size: 14px;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* === Onglets === */
.ssm-tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.ssm-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ssm-tab:hover {
    color: #111827;
    background: #f9fafb;
}

.ssm-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

.ssm-tab svg {
    flex-shrink: 0;
}

/* === Contenu des onglets === */
.ssm-tab-content {
    padding: 30px;
    min-height: 400px;
}

.ssm-tab-pane {
    display: none;
}

.ssm-tab-pane.active {
    display: block;
}

.ssm-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 15px;
}

.ssm-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === Cartes de solde === */
.ssm-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.ssm-balance-card {
    padding: 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.ssm-balance-card.ssm-balance-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.ssm-balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 12px;
    font-weight: 500;
}

.ssm-balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ssm-balance-currency {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 600;
    letter-spacing: 1px;
}

/* === Tableaux === */
.ssm-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.ssm-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ssm-data-table thead {
    background: #f9fafb;
}

.ssm-data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.ssm-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
}

.ssm-data-table tbody tr:hover {
    background: #f9fafb;
}

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

.ssm-data-table .ssm-amount {
    font-weight: 600;
    color: #059669;
}

/* === Badges de statut === */
.ssm-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ssm-status-success {
    background: #dcfce7;
    color: #166534;
}

.ssm-status-warning {
    background: #fef3c7;
    color: #92400e;
}

.ssm-status-error {
    background: #fee2e2;
    color: #991b1b;
}

.ssm-status-info {
    background: #dbeafe;
    color: #1e40af;
}

/* === Bouton lien === */
.ssm-link-btn {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.ssm-link-btn:hover {
    background: #eff6ff;
}

/* === État vide === */
.ssm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.ssm-error-message {
    padding: 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    border: 1px solid #fca5a5;
}

/* === Onglet Documents/Justificatifs === */
.ssm-documents-intro {
    background: #eff6ff;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
    margin-bottom: 30px;
}

.ssm-documents-intro p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
}

.ssm-document-year {
    margin-bottom: 40px;
}

.ssm-year-title {
    font-size: 20px;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.ssm-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ssm-document-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.ssm-document-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.ssm-document-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border-radius: 8px;
    color: #2563eb;
}

.ssm-document-info {
    flex: 1;
}

.ssm-document-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.ssm-document-meta {
    font-size: 13px;
    color: #6b7280;
}

.ssm-document-actions {
    flex-shrink: 0;
}

.ssm-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ssm-btn-download:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.ssm-btn-download svg {
    flex-shrink: 0;
}

/* === Récapitulatif annuel === */
.ssm-annual-summary {
    margin-top: 40px;
    padding: 30px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    text-align: center;
}

.ssm-annual-summary h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #111827;
}

.ssm-annual-summary p {
    color: #6b7280;
    margin-bottom: 20px;
}

.ssm-year-select {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-right: 12px;
    background: #ffffff;
    color: #111827;
}

.ssm-annual-summary .ssm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* === Responsive documents === */
@media (max-width: 768px) {
    .ssm-documents-grid {
        grid-template-columns: 1fr;
    }
    
    .ssm-document-card {
        flex-direction: column;
        text-align: center;
    }
    
    .ssm-document-actions {
        width: 100%;
    }
    
    .ssm-btn-download {
        width: 100%;
        justify-content: center;
    }
    
    .ssm-annual-summary {
        padding: 20px;
    }
    
    .ssm-year-select {
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .ssm-annual-summary .ssm-btn {
        width: 100%;
        justify-content: center;
    }
}

/* === Responsive dashboard === */
@media (max-width: 768px) {
    .ssm-dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ssm-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ssm-header-right {
        width: 100%;
    }
    
    .ssm-header-right .ssm-btn {
        flex: 1;
    }
    
    .ssm-tabs {
        flex-wrap: nowrap;
    }
    
    .ssm-tab {
        font-size: 13px;
        padding: 12px 16px;
    }
    
    .ssm-tab-content {
        padding: 20px 15px;
    }
    
    .ssm-balance-amount {
        font-size: 28px;
    }
    
    .ssm-data-table {
        font-size: 13px;
    }
    
    .ssm-data-table th,
    .ssm-data-table td {
        padding: 10px 12px;
    }
}

/* === Paramètres WooCommerce === */
.ssm-woo-settings {
    padding: 24px 30px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.ssm-woo-settings h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #111827;
}

.ssm-woo-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ssm-setting-card {
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.ssm-setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.ssm-setting-info {
    flex: 1;
}

.ssm-setting-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #111827;
    font-weight: 600;
}

.ssm-setting-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* === Toggle Switch === */
.ssm-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.ssm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ssm-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 26px;
}

.ssm-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ssm-toggle input:checked + .ssm-toggle-slider {
    background-color: #10b981;
}

.ssm-toggle input:checked + .ssm-toggle-slider:before {
    transform: translateX(24px);
}

.ssm-toggle input:disabled + .ssm-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Messages de statut WooCommerce === */
.ssm-woo-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    background: #f3f4f6;
}

.ssm-status-message-inline {
    font-size: 14px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ssm-status-message-inline.ssm-success {
    color: #059669;
}

.ssm-status-message-inline.ssm-error {
    color: #dc2626;
}

.ssm-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Actions WooCommerce === */
.ssm-woo-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.ssm-woo-actions .ssm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* === Info badge === */
.ssm-woo-info {
    margin-top: 20px;
}

.ssm-info-badge {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid;
}

.ssm-info-badge-blue {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.ssm-info-badge svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.ssm-info-badge strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.ssm-info-badge p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* === Responsive actions === */
@media (max-width: 768px) {
    .ssm-woo-actions {
        flex-direction: column;
    }
    
    .ssm-woo-actions .ssm-btn {
        width: 100%;
        justify-content: center;
    }
}

/* === Affichage des clés === */
.ssm-keys-display {
    margin-top: 20px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

.ssm-key-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ssm-key-item:last-child {
    margin-bottom: 0;
}

.ssm-key-item label {
    min-width: 120px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.ssm-key-item input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: #f9fafb;
    color: #111827;
}

.ssm-copy-btn {
    padding: 8px 12px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssm-copy-btn:hover {
    background: #1d4ed8;
}

.ssm-copy-btn svg {
    width: 16px;
    height: 16px;
}

/* === Liste d'étapes === */
.ssm-steps-list {
    margin: 10px 0;
    padding-left: 20px;
    color: #1e40af;
}

.ssm-steps-list li {
    margin: 6px 0;
    line-height: 1.6;
}

/* === Responsive keys === */
@media (max-width: 768px) {
    .ssm-key-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ssm-key-item label {
        min-width: auto;
    }
    
    .ssm-copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* === Formulaire WooCommerce === */
.ssm-woo-form {
    background: #ffffff;
    border-radius: 8px;
}

.ssm-form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
}

.ssm-form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.ssm-form-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #111827;
    font-weight: 600;
}

.ssm-form-help {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

.ssm-form-row {
    margin-bottom: 16px;
}

.ssm-form-row:last-child {
    margin-bottom: 0;
}

.ssm-form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.ssm-form-row input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ssm-form-row input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ssm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.ssm-checkbox-label:hover {
    background: #f9fafb;
}

.ssm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ssm-checkbox-label span {
    font-size: 14px;
    color: #374151;
}

.ssm-keys-readonly {
    background: #f9fafb;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.ssm-key-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ssm-key-row:last-child {
    margin-bottom: 0;
}

.ssm-key-row label {
    min-width: 140px;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.ssm-key-row code {
    flex: 1;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.ssm-form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.ssm-btn-large {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
}

.ssm-form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.ssm-form-message.ssm-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.ssm-form-message.ssm-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.ssm-info-badge-green {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* === Responsive formulaire === */
@media (max-width: 768px) {
    .ssm-key-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ssm-key-row label {
        min-width: auto;
    }
    
    .ssm-key-row code {
        width: 100%;
    }
    
    .ssm-btn-large {
        width: 100%;
        justify-content: center;
    }
}

/* === Notice d'activation === */
.ssm-activation-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 6px;
    color: #166534;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.ssm-activation-notice svg {
    flex-shrink: 0;
    color: #16a34a;
}

/* === Badge de mode === */
.ssm-mode-info {
    margin-top: 12px;
}

.ssm-mode-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 2px solid;
}

.ssm-mode-badge.ssm-mode-test,
.ssm-mode-badge:not(.ssm-mode-live) {
    background: #fef3c7;
    border-color: #fbbf24;
}

.ssm-mode-badge.ssm-mode-live {
    background: #dbeafe;
    border-color: #3b82f6;
}

.ssm-mode-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ssm-mode-badge strong {
    display: block;
    font-size: 14px;
    color: #111827;
    margin-bottom: 4px;
}

.ssm-mode-badge p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.ssm-mode-badge code {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}
