.affirm-admin-wrap {
    max-width: 960px;
}

.affirm-admin-header {
    background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%);
    padding: 24px 32px;
    border-radius: 12px;
    margin-bottom: 0;
    color: #fff;
}

.affirm-admin-header h1 {
    color: #fff;
    font-size: 24px;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
}

.affirm-admin-header .description {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Tabs */
.affirm-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 0 0 0 0;
}

.affirm-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.affirm-tab:hover {
    color: #0f172a;
    background: #f8fafc;
}

.affirm-tab-active {
    color: #10b981;
    border-bottom-color: #10b981;
}

.affirm-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.affirm-settings-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.affirm-settings-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    padding: 0;
    color: #1e293b;
}

.affirm-settings-card .form-table th {
    padding-top: 16px;
    padding-bottom: 16px;
    font-weight: 500;
    color: #475569;
}

.affirm-settings-card .form-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.affirm-settings-card fieldset label {
    display: block;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.affirm-settings-card fieldset label:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.affirm-settings-card fieldset input[type="radio"]:checked + strong {
    color: #10b981;
}

#affirm-sync-status,
#affirm-connection-status {
    font-weight: 500;
}

.affirm-success {
    color: #10b981;
}

.affirm-error {
    color: #ef4444;
}

.affirm-loading {
    color: #6b7280;
}

/* Scanner Stats */
.affirm-scanner-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.affirm-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.affirm-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 6px;
}

.affirm-stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.affirm-stat-warning .affirm-stat-number {
    color: #f59e0b;
}

.affirm-stat-success .affirm-stat-number {
    color: #10b981;
}

.affirm-stat-danger .affirm-stat-number {
    color: #ef4444;
}

/* Scanner Actions Bar */
.affirm-scanner-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.affirm-scanner-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.affirm-scanner-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.affirm-btn-protect {
    background: #059669 !important;
    border-color: #047857 !important;
    color: #fff !important;
}

.affirm-btn-protect:hover:not(:disabled) {
    background: #047857 !important;
}

.affirm-btn-protect:disabled {
    opacity: 0.5;
}

/* Status Badges */
.affirm-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.affirm-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.affirm-badge-queued {
    background: #e0e7ff;
    color: #3730a3;
}

.affirm-badge-processing {
    background: #dbeafe;
    color: #1e40af;
}

.affirm-badge-protected {
    background: #d1fae5;
    color: #065f46;
}

.affirm-badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.affirm-badge-dismissed {
    background: #f1f5f9;
    color: #64748b;
}

/* Scanner Table */
.affirm-scanner-table-wrap {
    padding: 0;
    overflow: hidden;
}

.affirm-scanner-table-wrap .wp-list-table {
    border: none;
    margin: 0;
}

.affirm-scanner-table-wrap .wp-list-table thead th,
.affirm-scanner-table-wrap .wp-list-table thead td {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
}

.affirm-scanner-table-wrap .wp-list-table tbody td,
.affirm-scanner-table-wrap .wp-list-table tbody th {
    padding: 10px 12px;
    vertical-align: middle;
}

.affirm-src-text {
    font-weight: 500;
    color: #1e293b;
    word-break: break-all;
}

/* Pagination */
.affirm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

#affirm-page-info {
    font-size: 13px;
    color: #64748b;
}

/* Bulk Progress Banner */
.affirm-bulk-banner {
    border-color: #10b981;
    background: #f0fdf4;
}

.affirm-bulk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.affirm-bulk-header h2 {
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #065f46;
}

.affirm-bulk-percent {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
}

.affirm-progress-bar-wrap {
    background: #d1fae5;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.affirm-progress-bar {
    background: linear-gradient(90deg, #10b981, #059669);
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.affirm-bulk-stats {
    font-size: 13px;
    color: #475569;
    margin: 0;
}

/* Spin animation */
@keyframes affirm-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.affirm-spin {
    animation: affirm-spin 1s linear infinite;
}

/* =========================================================================
   Dashboard Tab
   ========================================================================= */

.affirm-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.affirm-plan-card {
    border-left: 4px solid #10b981;
}

.affirm-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.affirm-plan-price {
    text-align: right;
}

.affirm-plan-price span {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.affirm-plan-price small {
    font-size: 14px;
    color: #64748b;
    font-weight: 400;
}

.affirm-info-table {
    width: 100%;
    border-collapse: collapse;
}

.affirm-info-table td {
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #1e293b;
}

.affirm-info-label {
    color: #64748b !important;
    font-weight: 500;
    width: 80px;
}

.affirm-stat-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Usage Bars */
.affirm-usage-bar-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.affirm-usage-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.affirm-usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.affirm-usage-value {
    color: #94a3b8;
    font-weight: 400;
}

/* Recent Images */
.affirm-recent-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.affirm-recent-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.affirm-recent-thumb {
    width: 40px;
    height: 40px;
    background: #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.affirm-recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.affirm-recent-thumb .dashicons {
    color: #94a3b8;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.affirm-recent-info {
    flex: 1;
    min-width: 0;
}

.affirm-recent-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affirm-recent-meta {
    font-size: 12px;
    color: #94a3b8;
}

/* =========================================================================
   Upload Tab
   ========================================================================= */

.affirm-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.affirm-dropzone:hover,
.affirm-dropzone-active {
    border-color: #10b981;
    background: #f0fdf4;
}

.affirm-dropzone-active {
    border-style: solid;
}

.affirm-dropzone p {
    margin: 4px 0;
}

/* Upload Queue */
.affirm-upload-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.affirm-upload-item:last-child {
    border-bottom: none;
}

.affirm-upload-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.affirm-upload-item-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affirm-upload-item-size {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
}

.affirm-upload-item-status {
    flex-shrink: 0;
}

.affirm-upload-item-state {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.affirm-upload-item .affirm-progress-bar-wrap {
    width: 100%;
    flex-basis: 100%;
}

/* Vault Grid */
.affirm-vault-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.affirm-vault-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.affirm-vault-card:hover {
    background: #f1f5f9;
}

.affirm-vault-thumb {
    width: 40px;
    height: 40px;
    background: #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.affirm-vault-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.affirm-vault-thumb .dashicons {
    color: #94a3b8;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.affirm-vault-info {
    flex: 1;
    min-width: 0;
}

.affirm-vault-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affirm-vault-meta {
    font-size: 12px;
    color: #94a3b8;
}

.affirm-vault-id {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* =========================================================================
   Vault Grid + List Views
   ========================================================================= */

.affirm-view-toggle {
    display: inline-flex;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.affirm-view-btn {
    background: #fff;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}

.affirm-view-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.affirm-view-btn-active {
    background: #10b981;
    color: #fff;
}

.affirm-view-btn-active:hover {
    background: #059669;
    color: #fff;
}

.affirm-view-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Grid View */
.affirm-vault-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.affirm-vault-grid-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
}

.affirm-vault-grid-card:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
    transform: translateY(-1px);
}

.affirm-vault-grid-card-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.affirm-vault-grid-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.affirm-vault-grid-card-thumb .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #cbd5e1;
}

.affirm-vault-grid-card-info {
    padding: 10px 12px;
}

.affirm-vault-grid-card-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affirm-vault-grid-card-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* List View */
.affirm-vault-list-view {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.affirm-vault-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.affirm-vault-list-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.affirm-vault-list-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.affirm-vault-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.affirm-vault-list-thumb .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #cbd5e1;
}

.affirm-vault-list-info {
    flex: 1;
    min-width: 0;
}

.affirm-vault-list-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affirm-vault-list-meta {
    font-size: 12px;
    color: #94a3b8;
}

.affirm-vault-list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.affirm-vault-list-id {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
}

/* =========================================================================
   Image Detail Modal
   ========================================================================= */

.affirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.affirm-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.affirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.affirm-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.affirm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.affirm-modal-close:hover {
    color: #ef4444;
}

.affirm-modal-body {
    padding: 20px;
}

.affirm-modal-preview {
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    text-align: center;
    max-height: 240px;
}

.affirm-modal-preview img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.affirm-modal-info {
    margin-bottom: 16px;
}

.affirm-modal-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.affirm-modal-id {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.affirm-modal-id-label {
    color: #64748b;
}

.affirm-modal-id code {
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    color: #475569;
    word-break: break-all;
}

/* Embed Section */
.affirm-embed-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.affirm-embed-section h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.affirm-embed-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 12px;
}

.affirm-embed-size-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #475569;
}

.affirm-embed-size-row label {
    font-weight: 500;
    white-space: nowrap;
}

.affirm-embed-size-row input[type="text"] {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    background: #fff;
}

.affirm-embed-tab {
    flex: 1;
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.affirm-embed-tab:hover {
    color: #1e293b;
    background: #fff;
}

.affirm-embed-tab-active {
    background: #10b981 !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.affirm-embed-block {
    margin-bottom: 12px;
}

.affirm-embed-block-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

.affirm-embed-block-label small {
    color: #94a3b8;
    font-weight: 400;
}

.affirm-embed-block-label .affirm-copy-btn {
    margin-left: auto;
}

.affirm-embed-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.affirm-code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.affirm-code-url {
    color: #38bdf8;
}

.affirm-signed-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.affirm-signed-row label {
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

.affirm-signed-row select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.affirm-embed-security {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 12px;
    color: #166534;
    margin-top: 12px;
}

/* =========================================================================
   Media Modal — aFFirmFirst Vault Tab
   ========================================================================= */

.affirm-vault-browser {
    height: 100%;
    overflow: hidden;
}

.affirm-vault-modal-wrap {
    display: flex;
    height: 100%;
    min-height: 400px;
}

.affirm-vault-modal-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
}

.affirm-vault-modal-sidebar-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.affirm-vault-modal-brand {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #1e293b;
}

.affirm-vault-modal-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.affirm-vault-modal-preview {
    width: 100%;
    aspect-ratio: 4/3;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.affirm-vault-modal-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.affirm-vault-modal-preview-empty {
    text-align: center;
    color: #94a3b8;
}

.affirm-vault-modal-preview-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 8px;
}

.affirm-vault-modal-preview-empty p {
    font-size: 12px;
    margin: 0;
}

.affirm-vault-modal-meta {
    font-size: 13px;
}

.affirm-vault-modal-meta-name {
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
    margin-bottom: 4px;
}

.affirm-vault-modal-meta-info {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 2px;
}

.affirm-vault-modal-meta-id {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    word-break: break-all;
}

.affirm-vault-use-btn {
    width: 100%;
    text-align: center;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px !important;
    background: #059669 !important;
    border-color: #047857 !important;
    color: #fff !important;
}

.affirm-vault-use-btn:hover:not(:disabled) {
    background: #047857 !important;
}

.affirm-vault-use-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.affirm-vault-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.affirm-vault-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.affirm-vault-search-input {
    flex: 1;
    padding: 6px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    outline: none;
}

.affirm-vault-search-input:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
}

.affirm-vault-count {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.affirm-vault-modal-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    align-content: start;
}

.affirm-vault-modal-loading,
.affirm-vault-modal-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.affirm-vault-modal-loading .spinner {
    margin: 0 auto 12px !important;
}

.affirm-vault-modal-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 12px;
    color: #cbd5e1;
}

.affirm-vault-grid-item {
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    background: #f8fafc;
    transition: all 0.15s;
}

.affirm-vault-grid-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.affirm-vault-grid-item-selected {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981;
    background: #f0fdf4;
}

.affirm-vault-grid-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.affirm-vault-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.affirm-vault-grid-thumb .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #94a3b8;
}

.affirm-vault-grid-label {
    padding: 6px 8px;
    font-size: 11px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Multi-select: grid item position relative for badge */
.affirm-vault-grid-item {
    position: relative;
}

/* Selection badge — numbered circle on selected items */
.affirm-vault-select-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Empty badge — shows a circle outline for unselected items in multi mode */
.affirm-vault-select-badge-empty {
    background: rgba(255,255,255,0.8);
    border: 2px solid #cbd5e1;
    box-shadow: none;
}

/* Multi-preview: thumbnail grid in sidebar */
.affirm-vault-multi-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.affirm-vault-multi-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Multi-select toggle button in toolbar */
.affirm-vault-multi-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
    white-space: nowrap;
}

.affirm-vault-multi-toggle-active {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #fff !important;
}

.affirm-vault-multi-toggle-active .dashicons {
    color: #fff;
}

.affirm-vault-multi-more {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #f1f5f9;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* Responsive */
@media (max-width: 782px) {
    .affirm-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .affirm-scanner-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .affirm-scanner-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .affirm-scanner-actions-right {
        width: 100%;
    }

    .affirm-scanner-actions-right input {
        flex: 1;
    }

    .affirm-vault-modal-wrap {
        flex-direction: column;
    }

    .affirm-vault-modal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 200px;
    }

    .affirm-vault-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}
