
:root {
    /* Nuova Palette Moderna - Premium & Elegant */
    --sifp-primary: #0F9CC0;
    --sifp-primary-dark: #0A7A96;
    --sifp-accent: #EE7E14;
    --sifp-accent-dark: #D16D0F;
    
    /* Backgrounds Moderni (Light Theme) */
    --sifp-bg-main: #f0f2f5;
    --sifp-bg-card: #ffffff;
    --sifp-bg-nav: #ffffff;
    --sifp-bg-input: #ffffff;
    --sifp-bg-hover: #f8fafc;
    
    /* Testi */
    --sifp-text: #1e293b;
    --sifp-text-muted: #64748b;
    --sifp-text-on-accent: #ffffff;
    --sifp-label: #334155;
    --sifp-placeholder: #94a3b8;
    
    /* Stati */
    --sifp-success: #10b981;
    --sifp-error: #ef4444;
    --sifp-warning: #f59e0b;
    --sifp-info: #3b82f6;
    
    /* UI Elements */
    --sifp-radius: 10px;
    --sifp-radius-lg: 16px;
    --sifp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --sifp-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --sifp-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status Icons & Text Helpers */
.sifp-status-icon--success { color: var(--sifp-success) !important; }
.sifp-status-icon--primary { color: var(--sifp-primary) !important; }
.sifp-status-icon--error { color: var(--sifp-error) !important; }
.sifp-status-icon--warning { color: var(--sifp-warning) !important; }
.sifp-text--error { color: var(--sifp-error) !important; }
.sifp-u-ml-auto { margin-left: auto !important; }
.sifp-u-ml-20 { margin-left: 20px !important; }
.sifp-u-ml-10 { margin-left: 10px !important; }
.sifp-u-w-65 { width: 90px !important; }
.sifp-u-hidden { display: none !important; }
.sifp-u-flex-100 { flex-basis: 100% !important; }
.sifp-u-mb-0 { margin-bottom: 0 !important; }
.sifp-u-grid-generator { display: grid !important; grid-template-columns: 1fr 2fr auto !important; gap: 15px !important; margin-bottom: 15px !important; align-items: flex-end !important; }
.sifp-u-font-10 { font-size: 10px !important; }
.sifp-u-button-error-small { background: var(--sifp-error) !important; color: #fff !important; border: none !important; border-radius: 4px !important; padding: 10px !important; cursor: pointer !important; }

/* Reset & Globali */
#sifp-admin-content {
    margin: 20px 20px 20px 0;
    padding: 30px 30px 80px 30px !important; /* Aggiunto padding bottom per evitare sovrapposizione footer WP */
    background-color: var(--sifp-bg-main) !important;
    color: var(--sifp-text) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border-radius: var(--sifp-radius-lg);
    box-shadow: var(--sifp-shadow);
    line-height: 1.6;
    width: calc(100% - 40px);
    box-sizing: border-box;
}

#sifp-admin-content h2,
.sifp-generator-header__title-group h2 {
    color: #000000 !important;
}

#sifp-admin-content h1,
#sifp-admin-content h3,
#sifp-admin-content h4,
#sifp-admin-content h5,
#sifp-admin-content h6 {
    color: var(--sifp-text) !important;
}

#sifp-admin-content h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

#sifp-admin-content h1 img {
    padding: 0;
    margin: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
#sifp-admin-content label, 
.sifp-main-container label,
.sifp-generator-section label {
    color: var(--sifp-label) !important;
    font-weight: 700 !important;
}

#sifp-admin-content strong, 
#sifp-admin-content b {
    color: var(--sifp-text) !important;
}
#sifp-admin-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#sifp-admin-content::-webkit-scrollbar-track {
    background: var(--sifp-bg-nav);
}
#sifp-admin-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}
#sifp-admin-content::-webkit-scrollbar-thumb:hover {
    background: var(--sifp-primary);
}

/* Navigazione */
.sifp-main-nav {
    margin: 0 0 40px 0;
    background-color: var(--sifp-bg-nav);
    padding: 15px;
    border-radius: var(--sifp-radius-lg);
    display: flex;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.sifp-main-nav-el {
    margin: 0;
    padding: 14px 28px;
    border-radius: var(--sifp-radius);
    color: var(--sifp-text);
    text-decoration: none;
    font-weight: 700;
    transition: var(--sifp-transition);
    background-color: transparent;
    font-size: 14px;
}

.sifp-main-nav-el:hover {
    color: var(--sifp-text);
    background-color: var(--sifp-bg-hover) !important;
}

/* Bottoni Moderni */
.sifp-button, .sifp-search-btn, .sifp-button--ai-generate, .sifp-button--ai-import {
    background: var(--sifp-primary) !important;
    color: #fff !important;
    border: none !important;
    padding: 0 24px !important;
    height: 42px !important;
    border-radius: var(--sifp-radius) !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--sifp-transition) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.sifp-button:hover, .sifp-search-btn:hover {
    background: var(--sifp-primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2) !important;
}

/* Navbar Filtri */
.sifp-navbar {
    background-color: var(--sifp-bg-card);
    padding: 12px 25px;
    border-radius: var(--sifp-radius-lg);
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

/* Pagination Bar */
.sifp-pagination-bar {
    background-color: var(--sifp-bg-card);
    padding: 15px 25px;
    border-radius: var(--sifp-radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.sifp-container + .sifp-pagination-bar {
    margin-top: 25px;
    margin-bottom: 0;
}

.sifp-nav-element {
    background-color: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    color: var(--sifp-text);
    min-width: 0;
}

.sifp-nav-element--inline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.sifp-nav-element select, .sifp-nav-element input {
    background-color: var(--sifp-bg-input) !important;
    color: var(--sifp-text) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    min-height: 44px !important;
    height: auto !important;
    transition: var(--sifp-transition);
    font-size: 14px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-sizing: border-box;
}

.sifp-nav-element select {
    padding-right: 44px !important;
    min-width: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
}

.sifp-nav-element select:focus, .sifp-nav-element input:focus {
    border-color: var(--sifp-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(15, 156, 192, 0.2) !important;
}

.sifp-found {
    color: var(--sifp-primary);
    font-size: 16px;
    font-weight: 800;
}

/* Cards Grid */
.sifp-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
    padding: 10px 0;
    width: 100%;
}

.sifp-default-card {
    display: none !important;
}

.sifp-card {
    background-color: var(--sifp-bg-card);
    border-radius: var(--sifp-radius-lg);
    overflow: hidden;
    transition: var(--sifp-transition);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sifp-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    border-color: rgba(15, 156, 192, 0.3);
}

/* Variations UI Styles */
.sifp-variations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sifp-variation-row {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    padding: 20px !important;
    border-radius: var(--sifp-radius) !important;
    transition: var(--sifp-transition);
}

.sifp-variation-row:hover {
    background: rgba(255,255,255,0.05) !important;
    border-color: var(--sifp-primary) !important;
}

.sifp-variation-attrs-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sifp-variation-row .sifp-form-field {
    margin-bottom: 0 !important;
}

.sifp-variation-row label {
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sifp-label);
    margin-bottom: 8px !important;
    display: block;
    font-weight: 700;
}

.sifp-variation-row input {
    width: 100%;
    background: var(--sifp-bg-input) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: var(--sifp-text) !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
}

.sifp-variation-row input:focus {
    border-color: var(--sifp-primary) !important;
    outline: none;
}

/* Grid helper for variations */
.grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.sifp-card-head {
    position: relative;
    height: 220px;
    max-height: 220px;
    overflow: hidden;
    background-color: #000;
}

.sifp-card-head img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sifp-transition);
}

.sifp-card-selection {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 30;
    background: rgba(0,0,0,0.5);
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sifp-card-selection input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    cursor: pointer;
}

.bulk-actions {
    display: flex;
    align-items: center;
    background: rgba(15, 156, 192, 0.1);
    padding: 10px 15px !important;
    border-radius: 8px;
    border: 1px solid rgba(15, 156, 192, 0.2);
}

.bulk-actions label {
    margin: 0 15px 0 5px;
    font-weight: 600;
    color: var(--sifp-primary);
    cursor: pointer;
}

.sifp-bulk-import-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
}

.sifp-bulk-import-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sifp-card.selected {
    border-color: var(--sifp-primary);
    box-shadow: 0 0 0 2px var(--sifp-primary);
}

.sifp-card.selected .sifp-card-selection {
    background: var(--sifp-primary);
}

.sifp-card:hover .sifp-card-head img {
    transform: scale(1.05);
}

.sifp-card-foot {
    padding: 20px;
    background: transparent;
    position: relative;
    height: auto;
}

.sifp-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--sifp-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sifp-rapid-import {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--sifp-primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sifp-shadow);
    z-index: 20;
    transition: var(--sifp-transition);
}

.sifp-rapid-import:hover {
    background: var(--sifp-accent);
    transform: rotate(90deg) scale(1.1);
}

/* Generator UI Style - Modern BEM */
.sifp-generator-section {
    padding: 30px;
    max-width: 100%;
    margin: 0;
}

.sifp-generator-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
}

.sifp-generator-header__title-group h2 {
    font-size: 2.5rem;
    margin: 0;
    color: #000;
    font-weight: 800;
}

.sifp-generator-header__title-group p {
    color: var(--sifp-text-muted);
    margin: 5px 0 0 0;
    font-size: 1.1rem;
}

.sifp-generator-header__presets {
    display: flex;
    gap: 10px;
}

.sifp-button--preset {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--sifp-transition);
    font-size: 0.9rem;
}

.sifp-button--preset:hover {
    background: var(--sifp-primary);
    border-color: var(--sifp-primary);
}

.sifp-taxonomy-selector {
    position: relative;
    width: 100%;
}

.sifp-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sifp-bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-top: none;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    display: none;
}

.sifp-autocomplete-results__item {
    padding: 12px 18px;
    cursor: pointer;
    color: var(--sifp-text);
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    font-weight: 600;
}

.sifp-autocomplete-results__item:last-child {
    border-bottom: none;
}

.sifp-autocomplete-results__item:hover {
    background: var(--sifp-primary);
    color: #fff;
}

/* Notices */
.sifp-notice {
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    font-size: 14px;
}

.sifp-notice--success {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.4);
}

.sifp-notice--error {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.4);
}

.sifp-generator-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    width: 100%;
}

/* Generator & Global Cards - Modern BEM */
.sifp-card {
    background: var(--sifp-bg-card);
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    transition: var(--sifp-transition);
}

.sifp-card__header {
    padding: 20px 25px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sifp-card__header h3, .sifp-card__header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--sifp-text) !important;
    font-weight: 700;
}

.sifp-card__header .dashicons {
    color: var(--sifp-primary);
}

.sifp-card__body {
    padding: 25px;
}

.sifp-card__body.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sifp-card__body.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }

.sifp-form-field {
    margin-bottom: 20px;
}

.sifp-form-field label {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sifp-label) !important;
    margin-bottom: 10px;
    font-weight: 700;
}

.sifp-form-field input, .sifp-form-field select, .sifp-form-field textarea {
    width: 100%;
    background: var(--sifp-bg-input) !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    color: var(--sifp-text) !important;
    transition: var(--sifp-transition);
}

.sifp-form-field input::placeholder, .sifp-form-field textarea::placeholder {
    color: #a0a0a0 !important;
}

.sifp-form-field input:focus, .sifp-form-field select:focus, .sifp-form-field textarea:focus {
    border-color: var(--sifp-primary) !important;
    box-shadow: 0 0 0 3px rgba(15, 156, 192, 0.2) !important;
    outline: none !important;
}

/* WordPress Editor Dark Theme Integration */
.wp-editor-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.wp-editor-tabs button {
    background: transparent !important;
    color: var(--sifp-text) !important;
    border: 1px solid #ddd !important;
    border-bottom: none !important;
    margin-right: 5px !important;
}

.wp-editor-tabs button.active {
    background: var(--sifp-primary) !important;
    color: #fff !important;
    border-color: var(--sifp-primary) !important;
}

.wp-switch-editor {
    background: transparent !important;
    color: var(--sifp-text) !important;
    border: none !important;
    padding: 5px 15px !important;
    font-weight: 600 !important;
}

.wp-editor-tools {
    background: var(--sifp-bg-nav) !important;
    padding: 10px !important;
    border-bottom: 1px solid #ddd !important;
}

.quicktags-toolbar {
    background: #f1f1f1 !important;
    border-bottom: 1px solid #ddd !important;
}
.sifp-card--ai {
    background: linear-gradient(145deg, #ffffff, #f0f7f9) !important;
    border: 1px solid var(--sifp-primary) !important;
    box-shadow: 0 10px 30px rgba(15, 156, 192, 0.1) !important;
}

.sifp-card--ai.sticky {
    position: sticky;
    top: 50px;
}

.sifp-card__header--ai {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    padding: 30px;
}

.sifp-ai-logo {
    width: 50px;
    height: 50px;
    background: var(--sifp-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sifp-ai-logo .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: #fff;
}

.sifp-ai-title h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff !important;
}

.sifp-ai-badge {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.15);
    padding: 2px 10px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
}

.sifp-card__body--ai {
    padding: 0 30px 30px 30px;
}

.sifp-card__footer--ai {
    padding: 0 30px 30px 30px;
}

.sifp-button--ai-generate, .sifp-ai-generate-btn {
    width: 100%;
    margin-top: 10px;
    background: var(--sifp-primary) !important;
    padding: 15px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
}

.sifp-button--ai-import, .sifp-ai-import-btn {
    background: var(--sifp-accent) !important;
    padding: 18px !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    margin-top: 30px;
}

.sifp-button--ai-clear.ghost, .sifp-ai-clear-btn.ghost {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    margin-top: 10px;
    width: 100%;
}

.sifp-ai-card__error, .sifp-ai-error {
    color: var(--sifp-error);
    font-size: 0.8rem;
    margin-top: 10px;
    text-align: center;
}

.sifp-image-input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

#sifp-select-image-btn, #select_image_btn {
    white-space: nowrap;
    height: 44px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sifp-bg-input);
    border: 1px solid rgba(255,255,255,0.15);
}

#sifp-select-image-btn:hover, #select_image_btn:hover {
    background: var(--sifp-primary);
    border-color: var(--sifp-primary);
}

.sifp-image-preview, #img_preview_container {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* Taxonomy Badges */
.sifp-taxonomy-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sifp-quick-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 100px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.sifp-tax-badge {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--sifp-text-muted);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--sifp-transition);
}

.sifp-tax-badge:hover, .sifp-tax-badge.active {
    background: var(--sifp-primary);
    color: #fff;
    border-color: var(--sifp-primary);
}

/* Gallery Grid */
.sifp-gallery-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sifp-gallery-preview-grid, #gallery_preview_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.sifp-gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.sifp-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sifp-gallery-item__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--sifp-error);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
}

.sifp-gallery-item__remove:hover {
    opacity: 1;
}

.sifp-checkbox-group, .sifp-form-field__checkbox-group {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

.sifp-checkbox-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--sifp-text);
    cursor: pointer;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.sifp-checkbox-label input, .checkbox-label input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
}

/* Settings & Logs */
.sifp-form-separator {
    background: rgba(255, 255, 255, 0.02) !important;
    padding: 20px 25px !important;
    border-radius: var(--sifp-radius) var(--sifp-radius) 0 0 !important;
    margin: 40px 0 0 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-left: 4px solid var(--sifp-primary) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    cursor: default !important;
}

.sifp-form-separator b {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sifp-primary);
}

.sifp-setting-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 30px 25px;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255,255,255,0.05);
    border-top: none;
    border-radius: 0 0 var(--sifp-radius) var(--sifp-radius);
}

.sifp-setting-board--db {
    display: block !important;
    padding: 30px !important;
}

.sifp-db-status {
    margin-bottom: 25px;
}

.sifp-db-status p {
    margin: 8px 0 !important;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sifp-db-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.sifp-button--secondary {
    background-color: var(--sifp-bg-input) !important;
    color: var(--sifp-text) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

.sifp-button--secondary:hover {
    background-color: var(--sifp-bg-hover) !important;
    border-color: var(--sifp-primary) !important;
}

.sifp-setting-el {
    background-color: var(--sifp-bg-card) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: var(--sifp-radius) !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    transition: var(--sifp-transition) !important;
    min-width: 300px !important;
    position: relative;
}

.sifp-setting-el:hover {
    border-color: rgba(15, 156, 192, 0.3) !important;
    background-color: var(--sifp-bg-hover) !important;
    transform: translateY(-2px);
}

.sifp-text-settings {
    color: var(--sifp-label) !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sifp-setting-el input, .sifp-setting-el select, .sifp-setting-el textarea {
    width: 100% !important;
    background: var(--sifp-bg-input) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 6px !important;
    padding: 10px 15px !important;
    color: var(--sifp-text) !important;
    font-size: 14px !important;
    transition: var(--sifp-transition) !important;
}

.sifp-setting-el input:focus, .sifp-setting-el select:focus, .sifp-setting-el textarea:focus {
    border-color: var(--sifp-primary) !important;
    box-shadow: 0 0 0 2px rgba(15, 156, 192, 0.2) !important;
    outline: none !important;
}

.sifp-setting-el .dashicons-image-rotate {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 16px;
    color: var(--sifp-text-muted);
    opacity: 0.5;
    transition: var(--sifp-transition);
}

.sifp-setting-el:hover .dashicons-image-rotate {
    opacity: 1;
}

.sifp-setting-el .dashicons-image-rotate:hover {
    color: var(--sifp-primary);
    transform: rotate(180deg);
}

.sifp-setting-el p:not(.sifp-text-settings) {
    color: var(--sifp-text-muted) !important;
    font-size: 12px !important;
    margin: 5px 0 0 0 !important;
    line-height: 1.4 !important;
    opacity: 0.8;
}

/* Error Logs */
.sifp-log-section {
    background: var(--sifp-bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-top: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.sifp-log-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 20px 25px;
    background: rgba(255,255,255,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sifp-log-header span {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sifp-log-header span::before {
    content: "\f534";
    font-family: dashicons;
    color: var(--sifp-primary);
}

.sifp-log-table-container {
    border: none !important;
    max-height: 500px;
    overflow-y: auto;
}

.sifp-log-table-container table {
    margin: 0 !important;
    border: none !important;
    width: 100%;
    border-collapse: collapse;
}

.sifp-log-table-container table th {
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    padding: 12px 20px !important;
    color: var(--sifp-label);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-align: left;
}

.sifp-log-table-container table td {
    padding: 15px 20px !important;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--sifp-text-muted);
    font-size: 13px;
    transition: var(--sifp-transition);
}

.sifp-log-table-container table tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

.sifp-log-table-container table tr:hover td {
    background: rgba(15, 156, 192, 0.05) !important;
    color: var(--sifp-text);
}

.sifp-log-th-time { width: 180px; }
.sifp-log-th-context { width: 150px; }
.sifp-log-th-message { width: auto; }

.sifp-form-category {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sifp-form-category b {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--sifp-text-muted);
    letter-spacing: 1px;
}

.sifp-form-footer {
    position: sticky;
    bottom: -20px;
    background: var(--sifp-bg-nav);
    padding: 20px 30px;
    margin: 40px -30px -30px -30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: flex-end;
    z-index: 100;
    border-radius: 0 0 var(--sifp-radius-lg) var(--sifp-radius-lg);
    box-shadow: 0 -10px 20px rgba(0,0,0,0.2);
}

.sifp-button--large {
    padding: 15px 40px !important;
    font-size: 15px !important;
    letter-spacing: 1.5px !important;
}

.sifp-button--error {
    background-color: var(--sifp-error) !important;
    color: #fff !important;
}

.sifp-button--error:hover {
    background-color: #c0392b !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2) !important;
}

.sifp-no-logs {
    text-align: center !important;
    padding: 40px !important;
    color: var(--sifp-text-muted) !important;
    font-style: italic;
}

.sifp-log-code {
    background: rgba(0,0,0,0.3) !important;
    color: var(--sifp-primary) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-family: monospace;
    font-size: 12px !important;
}

.sifp-log-table-container code {
    background: rgba(0,0,0,0.3);
    color: var(--sifp-primary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Card States */
.sifp-card.is-importing {
    position: relative;
    pointer-events: none;
}

.sifp-card.is-importing::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.sifp-card.import-success { border-color: var(--sifp-success); }
.sifp-card.import-error { border-color: var(--sifp-error); }

@media (max-width: 1100px) {
    .sifp-navbar { flex-direction: column; align-items: stretch; }
    .sifp-setting-board { grid-template-columns: 1fr; }
    .sifp-setting-el { min-width: 0 !important; }
}

/* --- Detail Section Modal --- */
.sifp-detail-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    background: var(--sifp-bg-card);
    z-index: 10001;
    border-radius: var(--sifp-radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
}

.sifp-background-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

.sifp-detail-section__head {
    padding: 20px 30px;
    background: var(--sifp-bg-nav);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.sifp-detail-title {
    flex: 1;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--sifp-text) !important;
    padding: 5px 10px !important;
    border-radius: var(--sifp-radius-sm) !important;
}

.sifp-detail-title:hover, .sifp-detail-title:focus {
    background: rgba(0,0,0,0.02) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

.sifp-button--close {
    background: #f1f5f9;
    color: #64748b;
    padding: 8px 16px;
    border-radius: var(--sifp-radius-md);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: var(--sifp-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sifp-button--close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.sifp-detail-section__body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: grid;
    grid-template-columns: 350px 1fr 1fr;
    gap: 30px;
    background: #fcfcfc;
}

.sifp-detail-body-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sifp-detail-main-img {
    width: 100%;
    border-radius: var(--sifp-radius-md);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background: #fff;
}

.sifp-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.sifp-detail-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--sifp-radius-sm);
    cursor: pointer;
    border: 1px solid #eee;
}

.sifp-detail-section__col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sifp-detail-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sifp-detail-block strong {
    font-size: 11px;
    color: var(--sifp-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.sifp-detail-block input, 
.sifp-detail-block textarea {
    width: 100%;
    padding: 12px 15px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--sifp-radius-md) !important;
    background: #fff !important;
    font-size: 14px !important;
    color: var(--sifp-text) !important;
    transition: var(--sifp-transition) !important;
}

.sifp-detail-block input:focus, 
.sifp-detail-block textarea:focus {
    border-color: var(--sifp-primary) !important;
    box-shadow: 0 0 0 3px rgba(15, 156, 192, 0.1) !important;
    outline: none !important;
}

.sifp-detail-section__foot {
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
}

.sifp-import-edited-btn {
    padding: 12px 25px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

@media (max-width: 1100px) {
    .sifp-detail-section__body {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 850px) {
    .sifp-detail-section {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .sifp-detail-section__body {
        grid-template-columns: 1fr;
    }
}

.sifp-tax-clouds {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sifp-tax-cloud {
    background-color: rgba(15, 156, 192, 0.1) !important;
    color: var(--sifp-primary) !important;
    border: 1px solid rgba(15, 156, 192, 0.2);
    border-radius: 20px !important;
    padding: 5px 15px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Update Button Sticky Style */
.sifp-Form .sifp-button[name="update"] {
    z-index: 100;
    padding: 14px 40px !important;
    font-size: 15px !important;
    background: var(--sifp-accent) !important;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 14px rgba(238, 126, 20, 0.4) !important;
}

.sifp-Form .sifp-button[name="update"]:hover {
    background: var(--sifp-accent-dark) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(238, 126, 20, 0.5) !important;
}

/* Form Validation */
.sifp-form-field input:invalid, 
.sifp-form-field textarea:invalid {
    border-color: var(--sifp-error);
}

.sifp-form-field input:valid:not(:placeholder-shown) {
    border-color: #4CAF50;
}

.sifp-validation-msg {
    font-size: 11px;
    color: var(--sifp-error);
    margin-top: 4px;
    display: none;
}

.sifp-form-field.has-error .sifp-validation-msg {
    display: block;
}

.sifp-form-field.has-error input,
.sifp-form-field.has-error textarea {
    border-color: var(--sifp-error);
}

/* Bulk Import Progress */
.sifp-card.importing {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.sifp-card.importing::after {
    content: "\f463";
    font-family: dashicons;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: var(--sifp-primary);
    animation: rotation 2s infinite linear;
    z-index: 10;
}

.sifp-card.import-success {
    border: 2px solid #4CAF50;
}

.sifp-card.import-error {
    border: 2px solid var(--sifp-error);
}

@media (max-width: 768px) {
    .AI_Grid { grid-template-columns: 1fr; }
    .sifp-NavBar { flex-direction: column; align-items: stretch; }
    .sifp-Setting_Board { grid-template-columns: 1fr; }
    .sifp-setting-el, .sifp-setting-el { min-width: 0 !important; }
}

/* ════════════════════════════════════════════════════
   SETTINGS PAGE — redesigned
   ════════════════════════════════════════════════════ */

/* Header bar */
.sifp-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 20px 30px;
    background: var(--sifp-bg-card);
    border-radius: var(--sifp-radius-lg);
    box-shadow: var(--sifp-shadow);
}

.sifp-settings-header h1 {
    margin: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tabs */
.sifp-settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    background: var(--sifp-bg-card);
    padding: 10px 10px 0 10px;
    border-radius: var(--sifp-radius-lg) var(--sifp-radius-lg) 0 0;
    box-shadow: var(--sifp-shadow);
}

.sifp-settings-tab {
    padding: 12px 22px;
    border-radius: var(--sifp-radius) var(--sifp-radius) 0 0;
    text-decoration: none;
    color: var(--sifp-text-muted);
    font-weight: 600;
    font-size: 13px;
    transition: var(--sifp-transition);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-bottom: none;
}

.sifp-settings-tab:hover {
    color: var(--sifp-text);
    background: var(--sifp-bg-hover);
}

.sifp-settings-tab--active {
    color: var(--sifp-primary) !important;
    background: var(--sifp-bg-main) !important;
    border-color: #e2e8f0;
}

.sifp-settings-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Tab panels */
.sifp-tab-panel {
    background: var(--sifp-bg-card);
    padding: 30px;
    border-radius: 0 0 var(--sifp-radius-lg) var(--sifp-radius-lg);
    box-shadow: var(--sifp-shadow);
    margin-bottom: 30px;
    overflow-x: hidden;
}

/* Provider Selector at top of AI Providers tab */
.sifp-provider-selector {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding: 18px 22px;
    background: var(--sifp-bg-main);
    border-radius: var(--sifp-radius);
    border: 1px solid #e2e8f0;
}

.sifp-provider-selector label {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sifp-label);
    white-space: nowrap;
}

.sifp-provider-selector select {
    min-width: 280px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
}

/* Provider card (one per provider) */
.sifp-provider-card {
    border: 1px solid #e2e8f0;
    border-radius: var(--sifp-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    animation: sifpFadeIn 0.25s ease;
}

@keyframes sifpFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sifp-provider-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--sifp-bg-nav);
    border-bottom: 1px solid #e2e8f0;
}

.sifp-provider-card__head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--sifp-text);
}

.sifp-provider-card__refresh {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 10px;
    color: var(--sifp-text-muted);
    transition: var(--sifp-transition);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.sifp-provider-card__refresh:hover {
    color: var(--sifp-primary);
    border-color: var(--sifp-primary);
}

.sifp-provider-card__refresh.sifp-loading {
    opacity: 0.5;
    pointer-events: none;
}

.sifp-provider-card__refresh.sifp-loading .dashicons {
    animation: sifpSpin 1s linear infinite;
}

.sifp-provider-card__body {
    padding: 24px;
}

/* Field rows inside provider card */
.sifp-field {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.sifp-field:last-child {
    margin-bottom: 0;
}

.sifp-field__label {
    min-width: 120px;
    padding-top: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sifp-label);
    flex-shrink: 0;
}

.sifp-field__control {
    flex: 1;
}

.sifp-field__control select {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
}

.sifp-field__control input[type="password"],
.sifp-field__control input[type="text"] {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
    transition: var(--sifp-transition);
}

.sifp-field__control input:focus,
.sifp-field__control select:focus {
    border-color: var(--sifp-primary);
    box-shadow: 0 0 0 3px rgba(15, 156, 192, 0.15);
    outline: none;
}

.sifp-field__hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: var(--sifp-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sifp-field__hint input[type="text"] {
    width: 220px;
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
}

/* Test connection row */
.sifp-field--test .sifp-field__control {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sifp-test-result {
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sifp-test-result .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ─── Settings tab ─── */

.sifp-settings-section {
    border: 1px solid #e2e8f0;
    border-radius: var(--sifp-radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.sifp-settings-section__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: var(--sifp-bg-nav);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sifp-primary);
}

.sifp-settings-section__body {
    padding: 8px 0;
}

.sifp-settings-section__body--nopad {
    padding: 0;
}

/* Settings rows (label + field) */
.sifp-settings-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.sifp-settings-row:last-child {
    border-bottom: none;
}

.sifp-settings-row__label {
    width: 180px;
    flex-shrink: 0;
    padding-top: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--sifp-label);
}

.sifp-settings-row__field {
    flex: 1;
    max-width: 500px;
}

.sifp-settings-row__field input[type="text"],
.sifp-settings-row__field input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
    transition: var(--sifp-transition);
}

.sifp-settings-row__field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
}

.sifp-settings-row__field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: var(--sifp-bg-input);
    color: var(--sifp-text);
    resize: vertical;
}

.sifp-settings-row__field input:focus,
.sifp-settings-row__field select:focus,
.sifp-settings-row__field textarea:focus {
    border-color: var(--sifp-primary);
    box-shadow: 0 0 0 3px rgba(15, 156, 192, 0.15);
    outline: none;
}

.sifp-settings-row__hint {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--sifp-text-muted);
}

/* ─── Button variants ─── */
.sifp-button--small {
    height: 32px !important;
    padding: 0 14px !important;
    font-size: 12px !important;
}

.sifp-button--large {
    padding: 14px 40px !important;
    font-size: 15px !important;
}

.sifp-button--secondary {
    background: var(--sifp-bg-input) !important;
    color: var(--sifp-text) !important;
    border: 1px solid #e2e8f0 !important;
}

.sifp-button--secondary:hover {
    background: var(--sifp-bg-hover) !important;
    border-color: var(--sifp-primary) !important;
}

/* ─── Settings footer ─── */
.sifp-settings-footer {
    display: flex;
    justify-content: flex-end;
    padding: 20px 0;
    margin-top: 10px;
}

/* ─── Database tab ─── */
.sifp-db-intro {
    padding: 0 22px;
    margin: 12px 0 18px 0;
    font-size: 13px;
    color: var(--sifp-text-muted);
}

.sifp-db-cards {
    display: flex;
    gap: 16px;
    padding: 0 22px;
    margin-bottom: 20px;
}

.sifp-db-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: var(--sifp-radius);
    background: var(--sifp-bg-main);
}

.sifp-db-card--ok {
    border-left: 4px solid var(--sifp-success);
}

.sifp-db-card--empty {
    border-left: 4px solid var(--sifp-error);
}

.sifp-db-card__icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--sifp-primary);
}

.sifp-db-card__info strong {
    display: block;
    font-size: 13px;
    color: var(--sifp-text);
    margin-bottom: 2px;
}

.sifp-db-card__status {
    font-size: 12px;
    color: var(--sifp-success);
    font-weight: 600;
}

.sifp-db-card__status--missing {
    color: var(--sifp-error);
}

.sifp-db-actions {
    display: flex;
    gap: 12px;
    padding: 0 22px 22px 22px;
}

/* ─── Model capabilities card ─── */
.sifp-model-caps {
    margin: 0 0 18px 136px;
    padding: 14px 18px;
    background: var(--sifp-bg-hover);
    border: 1px solid #e2e8f0;
    border-radius: var(--sifp-radius);
}

.sifp-caps-card {
    font-size: 13px;
}

.sifp-caps-desc {
    margin-bottom: 8px;
    color: var(--sifp-text-muted);
    font-size: 12px;
    font-style: italic;
}

.sifp-caps-table {
    width: 100%;
    border-collapse: collapse;
}

.sifp-caps-table tr td {
    padding: 3px 8px;
    border-bottom: 1px solid #f1f5f9;
}

.sifp-caps-label {
    color: var(--sifp-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 40%;
}

.sifp-caps-val {
    color: var(--sifp-text);
    font-weight: 600;
    font-size: 12px;
}

.sifp-caps-cost {
    font-family: monospace;
    font-size: 11px;
    color: var(--sifp-text-muted);
}

.sifp-caps-bar {
    display: inline-block;
    width: 70px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
}

.sifp-caps-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.sifp-caps-score {
    font-weight: 700;
    font-size: 11px;
}

.sifp-caps-yes {
    color: var(--sifp-success);
    font-weight: 700;
    font-size: 13px;
}

.sifp-caps-no {
    color: var(--sifp-error);
    font-weight: 700;
    font-size: 13px;
}

/* ─── Error logs table ─── */
.sifp-log-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.sifp-log-table-container table {
    margin: 0 !important;
    border: none !important;
    width: 100%;
    border-collapse: collapse;
}

.sifp-log-table-container table th {
    background: var(--sifp-bg-nav);
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 16px !important;
    color: var(--sifp-label);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: left;
}

.sifp-log-table-container table td {
    padding: 10px 16px !important;
    border-bottom: 1px solid #f1f5f9;
    color: var(--sifp-text-muted);
    font-size: 13px;
}

.sifp-log-table-container table tr:hover td {
    background: var(--sifp-bg-hover);
}

/* ─── Plugin Logo / Icon (es. Primary-Source) ─── */
.sifp-header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sifp-admin-logo {
    width: 70px;
    height: auto;
    display: block;
}

.sifp-plugin-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

/* Animations */
@keyframes sifpSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


