/* ============================================================
   Super Fast Blog AI — Admin Styles v2.0
   ============================================================ */

:root {
	--sfba-blue:       #3b82f6;
	--sfba-blue-dark:  #2563eb;
	--sfba-blue-light: #eff6ff;
	--sfba-green:      #16a34a;
	--sfba-red:        #dc2626;
	--sfba-purple:     #7c3aed;
	--sfba-grey-50:    #f9fafb;
	--sfba-grey-100:   #f3f4f6;
	--sfba-grey-200:   #e5e7eb;
	--sfba-grey-400:   #9ca3af;
	--sfba-grey-600:   #4b5563;
	--sfba-grey-900:   #111827;
	--sfba-radius:     8px;
	--sfba-shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
	--sfba-shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
	--sfba-primary:    var(--sfba-blue);
}

/* ── Wrapper ────────────────────────────────────────────────── */
.sfba-admin-wrap {
	max-width: none;
	margin: 20px 0 40px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────── */
.sfba-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid var(--sfba-grey-200);
	border-radius: var(--sfba-radius) var(--sfba-radius) 0 0;
	margin-bottom: -1px;
}
.sfba-header-left { display: flex; align-items: center; gap: 12px; }
.sfba-logo { font-size: 28px; }
.sfba-header h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--sfba-grey-900); }
.sfba-version {
	display: inline-block;
	margin-top: 2px;
	font-size: 11px;
	color: var(--sfba-grey-400);
	background: var(--sfba-grey-100);
	padding: 1px 7px;
	border-radius: 20px;
}
.sfba-header-right { display: flex; align-items: center; gap: 12px; }

/* ── Global notice ───────────────────────────────────────────── */
.sfba-notice {
	padding: 8px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	animation: sfba-fadein .2s ease;
}
.sfba-notice.success,
.sfba-notice--success { background: #dcfce7; color: #166534; }
.sfba-notice.error,
.sfba-notice--error   { background: #fee2e2; color: #991b1b; }
@keyframes sfba-fadein { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ── Tab navigation (link style) ─────────────────────────────── */
.sfba-tabs {
	display: flex;
	background: #fff;
	border: 1px solid var(--sfba-grey-200);
	border-top: none;
	padding: 0 20px;
}
.sfba-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sfba-grey-600);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color .15s, border-color .15s;
}
.sfba-tab:hover { color: var(--sfba-grey-900); }
.sfba-tab.active { color: var(--sfba-blue); border-bottom-color: var(--sfba-blue); }
.sfba-tab-count {
	background: var(--sfba-grey-100);
	color: var(--sfba-grey-600);
	font-size: 11px;
	padding: 1px 7px;
	border-radius: 20px;
}

/* ── Tab segmented control (button style) ─────────────────────── */
.sfba-tab-seg {
	display: inline-flex;
	background: var(--sfba-grey-100);
	border-radius: 12px;
	padding: 4px;
	gap: 2px;
	margin-bottom: 24px;
}
.sfba-tab-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 20px;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sfba-grey-600);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background .18s, color .18s, box-shadow .18s;
	white-space: nowrap;
}
.sfba-tab-btn:hover { color: var(--sfba-grey-900); background: rgba(255,255,255,.6); }
.sfba-tab-btn.sfba-tab-active {
	background: #fff;
	color: var(--sfba-blue);
	box-shadow: 0 1px 4px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04);
}
.sfba-tab-btn .sfba-tab-icon { font-size: 15px; line-height: 1; }

/* ── Tab panel ────────────────────────────────────────────────── */
.sfba-tab-panel { animation: sfba-fadein .18s ease; }

/* ── Form field group ─────────────────────────────────────────── */
.sfba-field-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.sfba-field-hint {
	font-size: 11px;
	color: var(--sfba-grey-400);
	margin-top: 3px;
	line-height: 1.4;
}
.sfba-form-grid {
	display: grid;
	gap: 16px;
}
.sfba-form-grid-2 { grid-template-columns: 1fr 1fr; }
.sfba-form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Section divider ──────────────────────────────────────────── */
.sfba-section-sep {
	border: none;
	border-top: 1px solid var(--sfba-grey-100);
	margin: 20px 0 16px;
}

/* ── Checkbox group (pill toggles) ───────────────────────────── */
.sfba-check-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sfba-check-pill { position: relative; }
.sfba-check-pill input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.sfba-check-pill label {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--sfba-grey-200);
	font-size: 12px; font-weight: 600; color: var(--sfba-grey-600);
	background: #fff; cursor: pointer; user-select: none;
	transition: border-color .15s, background .15s, color .15s;
}
.sfba-check-pill label:hover { border-color: var(--sfba-blue); color: var(--sfba-blue); }
.sfba-check-pill input:checked + label {
	border-color: var(--sfba-blue);
	background: var(--sfba-blue-light);
	color: var(--sfba-blue);
}

/* ── Action bar ───────────────────────────────────────────────── */
.sfba-action-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-top: 20px;
	border-top: 1px solid var(--sfba-grey-100);
	flex-wrap: wrap;
}

/* ── Title result row ─────────────────────────────────────────── */
.sfba-title-result-item {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 14px;
	background: var(--sfba-grey-50);
	border: 1px solid var(--sfba-grey-200);
	border-radius: 8px;
	transition: border-color .15s, background .15s;
}
.sfba-title-result-item:hover { border-color: var(--sfba-blue); background: var(--sfba-blue-light); }
.sfba-title-result-text { flex: 1; font-size: 13px; font-weight: 500; color: var(--sfba-grey-900); line-height: 1.4; }

/* ── Success result card ──────────────────────────────────────── */
.sfba-result-card {
	display: flex; align-items: flex-start; gap: 16px;
	background: #f0fdf4; border: 1px solid #bbf7d0;
	border-radius: 12px; padding: 20px 22px;
}
.sfba-result-icon { font-size: 28px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.sfba-result-body { flex: 1; }
.sfba-result-body strong { display: block; font-size: 15px; font-weight: 700; color: #15803d; margin-bottom: 4px; }
.sfba-result-body p { margin: 0 0 12px; font-size: 12px; color: #166534; }

/* ── Outline pre ──────────────────────────────────────────────── */
.sfba-outline-pre {
	white-space: pre-wrap; font-size: 13px; line-height: 1.7;
	background: var(--sfba-grey-50); padding: 16px 18px;
	border-radius: 8px; border: 1px solid var(--sfba-grey-200);
	margin: 0; font-family: inherit; color: var(--sfba-grey-900);
	max-height: 360px; overflow-y: auto;
}

/* ── Tab content area ────────────────────────────────────────── */
.sfba-tab-content { padding: 24px 0; display: flex; flex-direction: column; gap: 20px; }
.sfba-section-intro h2 { margin: 0 0 6px; font-size: 16px; color: var(--sfba-grey-900); }
.sfba-section-intro p  { margin: 0; color: var(--sfba-grey-600); font-size: 13px; }

/* ── Cards ───────────────────────────────────────────────────── */
.sfba-card {
	background: #fff;
	border: 1px solid var(--sfba-grey-200);
	border-radius: var(--sfba-radius);
	padding: 20px 22px;
	box-shadow: var(--sfba-shadow);
}
.sfba-card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--sfba-grey-900); }
.sfba-card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--sfba-grey-900); }
.sfba-card-muted { background: var(--sfba-grey-50); }
.sfba-card-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sfba-card-row > div { flex: 1; }
.sfba-card-row strong { font-size: 14px; font-weight: 600; display: block; margin-bottom: 2px; }

/* ── Provider grid ───────────────────────────────────────────── */
.sfba-provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sfba-provider-card {
	background: #fff;
	border: 1px solid var(--sfba-grey-200);
	border-radius: var(--sfba-radius);
	box-shadow: var(--sfba-shadow);
	overflow: hidden;
	transition: box-shadow .2s;
}
.sfba-provider-card:hover { box-shadow: var(--sfba-shadow-md); }
.sfba-provider-card.is-connected { border-color: #bbf7d0; }
.sfba-provider-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: var(--sfba-grey-50);
	border-bottom: 1px solid var(--sfba-grey-200);
}
.sfba-provider-icon { font-size: 22px; line-height: 1; }
.sfba-provider-meta { flex: 1; }
.sfba-provider-meta strong { display: block; font-size: 13px; font-weight: 600; }
.sfba-status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sfba-status-dot.connected    { background: var(--sfba-green); box-shadow: 0 0 0 3px #dcfce7; }
.sfba-status-dot.disconnected { background: var(--sfba-grey-400); }
.sfba-provider-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Form elements ───────────────────────────────────────────── */
.sfba-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--sfba-grey-600);
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: .4px;
}
.sfba-input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid var(--sfba-grey-200);
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
	color: var(--sfba-grey-900);
	transition: border-color .15s, box-shadow .15s;
}
.sfba-input:focus {
	outline: none;
	border-color: var(--sfba-blue);
	box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.sfba-input-sm { width: 100px; padding: 6px 8px; font-size: 13px; border: 1px solid var(--sfba-grey-200); border-radius: 6px; }
.sfba-input-group { display: flex; gap: 6px; }
.sfba-input-group .sfba-input { flex: 1; }
.sfba-select {
	padding: 8px 10px;
	border: 1px solid var(--sfba-grey-200);
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
	color: var(--sfba-grey-900);
	min-width: 200px;
}
.sfba-textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid var(--sfba-grey-200);
	border-radius: 6px;
	font-size: 13px;
	resize: vertical;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.sfba-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background .15s, opacity .15s, box-shadow .15s;
	text-decoration: none;
}
.sfba-btn:disabled { opacity: .55; cursor: not-allowed; }
.sfba-btn-primary   { background: var(--sfba-blue); color: #fff; border-color: var(--sfba-blue-dark); }
.sfba-btn-primary:hover:not(:disabled)   { background: var(--sfba-blue-dark); color: #fff; }
.sfba-btn-secondary { background: #fff; color: var(--sfba-grey-900); border-color: var(--sfba-grey-200); }
.sfba-btn-secondary:hover:not(:disabled) { background: var(--sfba-grey-100); }
.sfba-btn-danger    { background: #fff; color: var(--sfba-red); border-color: #fecaca; }
.sfba-btn-danger:hover:not(:disabled)    { background: #fee2e2; }
.sfba-btn-icon { padding: 7px 9px; }
.sfba-btn-lg   { padding: 10px 20px; font-size: 14px; }
.sfba-btn-sm   { padding: 4px 10px; font-size: 12px; }
.sfba-provider-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sfba-align-bottom { display: flex; align-items: flex-end; }

/* ── Provider feedback ───────────────────────────────────────── */
.sfba-provider-feedback { font-size: 12px; min-height: 16px; }
.sfba-provider-feedback.success { color: var(--sfba-green); }
.sfba-provider-feedback.error   { color: var(--sfba-red); }
.sfba-provider-feedback--box {
	margin-top: 10px; padding: 8px 12px; border-radius: 6px; font-size: 12px;
	line-height: 1.55; word-break: break-word;
}
.sfba-provider-feedback--box.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.sfba-provider-feedback--box.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.sfba-inline-feedback, .sfba-feedback { font-size: 13px; margin-left: 10px; }
.sfba-inline-feedback.success, .sfba-feedback.success { color: var(--sfba-green); }
.sfba-inline-feedback.error,   .sfba-feedback.error   { color: var(--sfba-red); }

/* ── Badges ───────────────────────────────────────────────────── */
.sfba-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.sfba-badge-green  { background: #dcfce7; color: var(--sfba-green); }
.sfba-badge-blue   { background: var(--sfba-blue-light); color: var(--sfba-blue-dark); }
.sfba-badge-purple { background: #ede9fe; color: var(--sfba-purple); }
.sfba-badge-red    { background: #fee2e2; color: var(--sfba-red); }
.sfba-badge-yellow { background: #fef9c3; color: #854d0e; }
.sfba-badge-gray   { background: var(--sfba-grey-100); color: var(--sfba-grey-600); }
.sfba-notice--success { background: #dcfce7; color: #166534; }
.sfba-notice--error   { background: #fee2e2; color: #991b1b; }

/* ── Toggle switch ───────────────────────────────────────────── */
.sfba-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.sfba-toggle input { opacity: 0; width: 0; height: 0; }
.sfba-toggle-slider {
	position: absolute; inset: 0;
	background: var(--sfba-grey-200); border-radius: 24px; transition: background .2s;
}
.sfba-toggle-slider::before {
	content: ''; position: absolute;
	width: 18px; height: 18px; left: 3px; bottom: 3px;
	background: #fff; border-radius: 50%;
	box-shadow: var(--sfba-shadow); transition: transform .2s;
}
.sfba-toggle input:checked + .sfba-toggle-slider { background: var(--sfba-blue); }
.sfba-toggle input:checked + .sfba-toggle-slider::before { transform: translateX(20px); }

/* ── Spinner ─────────────────────────────────────────────────── */
.sfba-spinner {
	width: 16px; height: 16px;
	border: 2px solid var(--sfba-grey-200);
	border-top-color: var(--sfba-blue);
	border-radius: 50%;
	display: inline-block;
	animation: sfba-spin .7s linear infinite;
}
@keyframes sfba-spin { to { transform: rotate(360deg); } }
.sfba-analyze-status { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: var(--sfba-grey-600); font-size: 13px; }

/* ── Brand Voice profile ─────────────────────────────────────── */
.sfba-profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.sfba-profile-stat { background: var(--sfba-grey-50); border: 1px solid var(--sfba-grey-200); border-radius: 6px; padding: 10px 14px; }
.sfba-profile-stat-label { display: block; font-size: 11px; font-weight: 600; color: var(--sfba-grey-400); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.sfba-profile-stat-value { font-size: 14px; font-weight: 600; color: var(--sfba-grey-900); }
.sfba-terms-section { margin-top: 4px; }
.sfba-terms-section strong { font-size: 13px; display: block; margin-bottom: 8px; }
.sfba-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.sfba-tag { background: var(--sfba-blue-light); color: var(--sfba-blue-dark); font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; }

/* ── Overrides details ───────────────────────────────────────── */
.sfba-overrides { margin-top: 16px; border: 1px solid var(--sfba-grey-200); border-radius: 6px; overflow: hidden; }
.sfba-overrides summary { padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--sfba-grey-50); user-select: none; }
.sfba-overrides-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

/* ── Empty state ─────────────────────────────────────────────── */
.sfba-empty-state { text-align: center; padding: 48px 24px; background: #fff; border: 2px dashed var(--sfba-grey-200); border-radius: var(--sfba-radius); }
.sfba-empty-icon { font-size: 48px; margin-bottom: 12px; }
.sfba-empty-state h3 { font-size: 16px; margin: 0 0 8px; color: var(--sfba-grey-900); }
.sfba-empty-state p  { color: var(--sfba-grey-600); margin: 0; font-size: 13px; }

/* ── Info box ────────────────────────────────────────────────── */
.sfba-info-box { background: var(--sfba-blue-light); border: 1px solid #bfdbfe; border-radius: var(--sfba-radius); padding: 14px 18px; }
.sfba-info-box h4 { margin: 0 0 4px; font-size: 13px; color: var(--sfba-blue-dark); }
.sfba-info-box p  { margin: 0; font-size: 12px; color: var(--sfba-blue-dark); }
.sfba-info-box--warning { background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--sfba-radius); padding: 14px 18px; margin-bottom: 16px; }
.sfba-info-box--warning strong { display: block; color: #c2410c; margin-bottom: 4px; font-size: 13px; }
.sfba-info-box--warning p     { color: var(--sfba-grey-600); font-size: 13px; margin: 0 0 10px; }

/* ── Info table ──────────────────────────────────────────────── */
.sfba-info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sfba-info-table td { padding: 5px 0; }
.sfba-info-table td:first-child { color: var(--sfba-grey-600); width: 160px; }
.sfba-info-table td:last-child  { font-weight: 500; }

/* ── Utility ─────────────────────────────────────────────────── */
.sfba-muted { color: var(--sfba-grey-600); font-size: 13px; margin: 2px 0 0; }
.sfba-row { display: flex; align-items: flex-start; }
.sfba-row-gap { gap: 16px; }
.sfba-section-intro { margin-bottom: 4px; }

/* ── Cost Tracker ────────────────────────────────────────────── */
.sfba-cost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.sfba-cost-headline-inner { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 12px; }
.sfba-cost-stat { min-width: 100px; }
.sfba-cost-stat-value { display: block; font-size: 26px; font-weight: 700; color: var(--sfba-grey-900); line-height: 1.1; }
.sfba-cost-stat-label { display: block; font-size: 12px; color: var(--sfba-grey-400); margin-top: 4px; }
.sfba-cost-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.sfba-cost-table th { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--sfba-grey-400); border-bottom: 1px solid var(--sfba-grey-200); }
.sfba-cost-table td { padding: 9px 10px; border-bottom: 1px solid var(--sfba-grey-100); color: var(--sfba-grey-900); vertical-align: middle; }
.sfba-cost-table tr:last-child td { border-bottom: none; }
.sfba-cost-table tr:hover td { background: var(--sfba-grey-50); }
.sfba-table-loading { text-align: center; color: var(--sfba-grey-400); padding: 20px !important; }
.sfba-budget-bar-wrap { margin-top: 10px; }
.sfba-budget-labels { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--sfba-grey-600); margin-bottom: 6px; }
.sfba-budget-bar { height: 8px; background: var(--sfba-grey-100); border-radius: 8px; overflow: hidden; }
.sfba-budget-bar-fill { height: 100%; border-radius: 8px; transition: width .4s ease; }
.sfba-budget-bar-fill.sfba-badge-green  { background: var(--sfba-green); }
.sfba-budget-bar-fill.sfba-badge-yellow { background: #ca8a04; }
.sfba-budget-bar-fill.sfba-badge-blue   { background: var(--sfba-blue); }
.sfba-budget-bar-fill.sfba-badge-red    { background: var(--sfba-red); }
.sfba-budget-message { font-size: 12px; color: var(--sfba-red); margin: 6px 0 0; }
.sfba-date-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sfba-grey-100); }
.sfba-date-filter .sfba-label { margin-bottom: 0; }
.sfba-optimization-card { padding: 14px 16px; background: var(--sfba-grey-50); border: 1px solid var(--sfba-grey-200); border-radius: 6px; margin-bottom: 10px; }
.sfba-optimization-card:last-child { margin-bottom: 0; }
.sfba-optimization-models { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sfba-arrow { font-size: 16px; color: var(--sfba-grey-400); }
.sfba-optimization-savings { font-size: 12px; color: var(--sfba-grey-600); margin: 6px 0 0; }

/* ── Content Calendar ────────────────────────────────────────── */
.sfba-calendar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.sfba-month-nav { display: flex; align-items: center; gap: 12px; }
.sfba-month-nav h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--sfba-grey-900); }
.sfba-calendar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Modal */
.sfba-modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100000; display: flex; align-items: center; justify-content: center; }
.sfba-modal-inner { background: #fff; border-radius: var(--sfba-radius); padding: 24px 28px; width: 440px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 12px; }
.sfba-modal-inner h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.sfba-modal-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── Dashboard ───────────────────────────────────────────────── */
.sfba-dash { max-width: 1060px; }
.sfba-dash-hero {
	background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
	padding: 22px 26px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.sfba-dash-hero-brand { display: flex; align-items: center; gap: 14px; }
.sfba-dash-logo-ring {
	width: 52px; height: 52px; border-radius: 50%;
	background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
	display: flex; align-items: center; justify-content: center;
	font-size: 26px; flex-shrink: 0; box-shadow: 0 2px 10px rgba(59,130,246,.35);
}
.sfba-dash-hero-brand h1 { margin: 0 0 3px; font-size: 21px; font-weight: 700; color: #111827; line-height: 1.2; }
.sfba-dash-hero-sub  { margin: 0; font-size: 13px; color: #6b7280; }
.sfba-dash-ver {
	display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .6px; color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe;
	padding: 2px 9px; border-radius: 20px; margin-left: 6px; vertical-align: middle;
}
.sfba-dash-hero-actions { display: flex; align-items: center; gap: 10px; }
.sfba-dash-hero-cta {
	display: inline-flex; align-items: center; gap: 7px;
	background: #3b82f6; color: #fff !important;
	font-size: 13px; font-weight: 700; padding: 10px 20px; border-radius: 9px;
	text-decoration: none !important;
	transition: background .15s, transform .1s, box-shadow .15s;
	box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.sfba-dash-hero-cta:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59,130,246,.4); }

/* Stat cards */
.sfba-dash-stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.sfba-dash-stat {
	background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0,0,0,.05); padding: 16px 20px;
	display: flex; align-items: center; gap: 14px; flex: 1; min-width: 180px;
	transition: box-shadow .15s, transform .15s; text-decoration: none;
}
.sfba-dash-stat:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.sfba-dash-stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.sfba-dash-stat-icon--blue   { background: #eff6ff; }
.sfba-dash-stat-icon--green  { background: #f0fdf4; }
.sfba-dash-stat-icon--purple { background: #faf5ff; }
.sfba-dash-stat-icon--orange { background: #fff7ed; }
.sfba-dash-stat-value { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.5px; color: #111827; }
.sfba-dash-stat-total { font-size: 16px; font-weight: 500; color: #9ca3af; }
.sfba-dash-stat-label { font-size: 12px; color: #6b7280; font-weight: 500; margin-top: 3px; }
.sfba-dash-stat--blue  .sfba-dash-stat-value { color: #3b82f6; }
.sfba-dash-stat--green .sfba-dash-stat-value { color: #16a34a; }
.sfba-dash-stat--purple .sfba-dash-stat-value { color: #9333ea; }
.sfba-dash-stat--muted .sfba-dash-stat-value { color: #9ca3af; }

/* Module cards */
.sfba-dash-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--sfba-grey-400); margin-bottom: 12px; }
.sfba-dash-modules { display: flex; flex-direction: column; gap: 8px; }
.sfba-dash-module {
	display: flex; align-items: center; gap: 16px;
	background: #fff; border: 1px solid var(--sfba-grey-200); border-radius: 10px;
	padding: 16px 20px; text-decoration: none; color: inherit;
	box-shadow: var(--sfba-shadow); transition: box-shadow .15s, border-color .15s, transform .12s;
}
.sfba-dash-module:hover { box-shadow: var(--sfba-shadow-md); border-color: var(--sfba-blue); transform: translateY(-1px); color: inherit; text-decoration: none; }
.sfba-dash-module-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.sfba-dash-icon--blue   { background: #eff6ff; }
.sfba-dash-icon--purple { background: #f5f3ff; }
.sfba-dash-icon--green  { background: #f0fdf4; }
.sfba-dash-icon--orange { background: #fff7ed; }
.sfba-dash-module-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sfba-dash-module-body strong { font-size: 14px; font-weight: 600; color: var(--sfba-grey-900); line-height: 1.3; }
.sfba-dash-module-body > span { font-size: 12px; color: var(--sfba-grey-400); font-weight: 500; }
.sfba-dash-module-body p { margin: 4px 0 0; font-size: 12px; color: var(--sfba-grey-600); line-height: 1.5; }
.sfba-dash-module-arrow { font-size: 16px; color: var(--sfba-grey-200); flex-shrink: 0; transition: color .15s, transform .12s; }
.sfba-dash-module:hover .sfba-dash-module-arrow { color: var(--sfba-blue); transform: translateX(3px); }

/* ── Rules table (routing) ───────────────────────────────────── */
.sfba-rules-header,
.sfba-rule-row { display: grid; grid-template-columns: 28% 14% 22% 11% 8% 11% 6%; align-items: center; }
.sfba-rules-header { padding: 0 20px 0 0; margin-bottom: 6px; }
.sfba-rules-header .sfba-rc { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #9ca3af; padding: 0 10px 6px; }
.sfba-rules-header .sfba-rc--type { padding-left: 20px; }
.sfba-rules-body { display: flex; flex-direction: column; gap: 6px; }
.sfba-rule-row {
	background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
	overflow: hidden; min-height: 58px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
	transition: border-color .15s, box-shadow .15s;
}
.sfba-rule-row:hover { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.08), 0 2px 8px rgba(0,0,0,.06); }
.sfba-rc { padding: 0 12px; display: flex; align-items: center; }
.sfba-rc--type { padding: 0; }
.sfba-rc-type-inner { display: flex; align-items: center; gap: 9px; padding: 0 16px; height: 100%; min-height: 58px; border-right: 1px solid #e5e7eb; width: 100%; }
.sfba-rc-icon { font-size: 17px; line-height: 1; flex-shrink: 0; }
.sfba-rc-type-label { font-size: 13px; font-weight: 600; color: #111827; line-height: 1.3; }
.sfba-rc--provider { gap: 7px; }
.sfba-rc-provider-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sfba-rc-provider-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.sfba-rc-model-code { font-size: 11.5px; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 5px; padding: 3px 9px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sfba-rc--tokens, .sfba-rc--temp { justify-content: center; }
.sfba-rc-num { font-size: 13px; font-weight: 600; color: #374151; }
.sfba-rc--status { justify-content: center; }
.sfba-rc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.sfba-rc-status-dot { width: 6px; height: 6px; border-radius: 50%; }
.sfba-rc-status--active   { background: #f0fdf4; color: #166534; }
.sfba-rc-status--active   .sfba-rc-status-dot { background: #22c55e; }
.sfba-rc-status--inactive { background: #f9fafb; color: #6b7280; }
.sfba-rc-status--inactive .sfba-rc-status-dot { background: #9ca3af; }
.sfba-rc--del { justify-content: center; }
.sfba-rc-del-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff; color: #9ca3af; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.sfba-rc-del-btn:hover { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.sfba-routing-form { display: flex; flex-direction: column; gap: 16px; }
.sfba-routing-form-row { display: flex; gap: 12px; align-items: flex-start; }
.sfba-routing-form-field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sfba-routing-field-narrow { flex: 0 0 140px; }

/* ── Rules wrap ──────────────────────────────────────────────── */
.sfba-rules-wrap { margin-bottom: 16px; }

/* ── WordPress Admin Body Padding ────────────────────────────── */
#wpbody { padding-right: 10px; }
