/* =============================================================================
   6rsh WhatsApp — Admin Styles
   ============================================================================= */

:root {
	--sixrsh-green:       #25D366;
	--sixrsh-green-dark:  #1da851;
	--sixrsh-green-light: #e6f9ee;
	--sixrsh-border:      #e0e0e0;
	--sixrsh-radius:      10px;
	--sixrsh-shadow:      0 2px 12px rgba(0,0,0,.08);
	--sixrsh-text:        #1e1e1e;
	--sixrsh-muted:       #757575;
	--sixrsh-danger:      #d63638;
}

/* =============================================================================
   Page title
   ============================================================================= */

.sixrsh-page-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 22px;
	font-weight: 600;
	color: var(--sixrsh-text);
	margin-bottom: 24px;
}

/* =============================================================================
   Card
   ============================================================================= */

.sixrsh-card {
	background: #fff;
	border: 1px solid var(--sixrsh-border);
	border-radius: var(--sixrsh-radius);
	padding: 28px 32px;
	margin-bottom: 24px;
	box-shadow: var(--sixrsh-shadow);
}

.sixrsh-card h2 {
	margin-top: 0;
	font-size: 16px;
	font-weight: 600;
}

.sixrsh-card h3 {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 12px;
}

/* =============================================================================
   Tab Navigation
   ============================================================================= */

.sixrsh-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 2px solid var(--sixrsh-border);
	padding-bottom: 0;
}

.sixrsh-tab {
	appearance: none;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 500;
	color: var(--sixrsh-muted);
	cursor: pointer;
	border-radius: 6px 6px 0 0;
	transition: color .2s, border-color .2s, background .2s;
}

.sixrsh-tab:hover {
	color: var(--sixrsh-green-dark);
	background: var(--sixrsh-green-light);
}

.sixrsh-tab.active {
	color: var(--sixrsh-green-dark);
	border-bottom-color: var(--sixrsh-green);
	font-weight: 600;
}

.sixrsh-tab-panel { display: none; }
.sixrsh-tab-panel.active { display: block; }
.sixrsh-tab-panel.hidden { display: none; }

/* =============================================================================
   Form rows
   ============================================================================= */

.sixrsh-field-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.sixrsh-field-row:last-child { border-bottom: none; }

.sixrsh-field-label {
	flex: 0 0 280px;
	font-size: 14px;
	font-weight: 500;
	color: var(--sixrsh-text);
}

.sixrsh-field-note {
	font-size: 12px;
	color: var(--sixrsh-muted);
	margin-top: 4px;
	display: block;
}

/* =============================================================================
   Toggle switch (CSS-only)
   ============================================================================= */

.sixrsh-toggle {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex-shrink: 0;
	cursor: pointer;
}

.sixrsh-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.sixrsh-toggle-slider {
	position: absolute;
	inset: 0;
	background: #ccc;
	border-radius: 26px;
	transition: background .2s;
}

.sixrsh-toggle-slider::before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s;
	box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.sixrsh-toggle input:checked + .sixrsh-toggle-slider {
	background: var(--sixrsh-green);
}

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

.sixrsh-toggle input:focus-visible + .sixrsh-toggle-slider {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* =============================================================================
   Divider, row helpers
   ============================================================================= */

.sixrsh-divider {
	border: none;
	border-top: 1px solid var(--sixrsh-border);
	margin: 20px 0;
}

.sixrsh-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.sixrsh-row-top { margin-top: 16px; }

/* =============================================================================
   Badges
   ============================================================================= */

.sixrsh-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.sixrsh-badge-green {
	background: var(--sixrsh-green-light);
	color: var(--sixrsh-green-dark);
}

.sixrsh-badge-red {
	background: #fce8e8;
	color: var(--sixrsh-danger);
}

/* =============================================================================
   Alerts / notices
   ============================================================================= */

.sixrsh-alert {
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin-top: 12px;
}

.sixrsh-alert-success {
	background: var(--sixrsh-green-light);
	color: var(--sixrsh-green-dark);
	border-left: 3px solid var(--sixrsh-green);
}

.sixrsh-alert-error {
	background: #fce8e8;
	color: var(--sixrsh-danger);
	border-left: 3px solid var(--sixrsh-danger);
}

.sixrsh-notice {
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin: 16px 0;
}

.sixrsh-notice-info {
	background: #eef6fd;
	color: #1a5276;
	border-left: 3px solid #2980b9;
}

.sixrsh-notice-info a {
	color: #2980b9;
	text-decoration: none;
}

.sixrsh-save-status {
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	margin-bottom: 12px;
}

/* =============================================================================
   Connection tab
   ============================================================================= */

.sixrsh-account-info {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background: var(--sixrsh-green-light);
	border-radius: 8px;
	margin-bottom: 16px;
}

.sixrsh-account-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sixrsh-api-key-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.sixrsh-masked-key {
	background: #f6f6f6;
	border: 1px solid var(--sixrsh-border);
	border-radius: 4px;
	padding: 4px 10px;
	font-size: 13px;
	font-family: monospace;
	letter-spacing: 1px;
}

.sixrsh-change-key-form {
	margin-top: 10px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.sixrsh-inline-result {
	font-size: 13px;
}

.sixrsh-last-tested {
	font-size: 12px;
	color: var(--sixrsh-muted);
}

.sixrsh-no-account {
	color: var(--sixrsh-muted);
}

/* =============================================================================
   Notifications table
   ============================================================================= */

.sixrsh-events-table {
	border-collapse: collapse;
	width: 100%;
	margin-top: 12px;
}

.sixrsh-events-table th {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: var(--sixrsh-muted);
	padding: 10px 12px;
	text-align: left;
	border-bottom: 2px solid var(--sixrsh-border);
}

.sixrsh-events-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
	vertical-align: middle;
}

.sixrsh-events-table tr:last-child td {
	border-bottom: none;
}

.sixrsh-event-name {
	font-weight: 500;
}

.sixrsh-template-cell {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.sixrsh-template-display {
	color: var(--sixrsh-muted);
	font-size: 13px;
}

.sixrsh-change-template {
	font-size: 12px;
	color: #0073aa;
	cursor: pointer;
	text-decoration: underline;
	background: none;
	border: none;
	padding: 0;
}

.sixrsh-template-select {
	min-width: 200px;
}

.sixrsh-test-result-inline {
	font-size: 12px;
}

/* =============================================================================
   Cart stats
   ============================================================================= */

.sixrsh-stats-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-top: 16px;
}

.sixrsh-stat-card {
	background: #f9f9f9;
	border: 1px solid var(--sixrsh-border);
	border-radius: 8px;
	padding: 20px;
	text-align: center;
}

.sixrsh-stat-value {
	font-size: 32px;
	font-weight: 700;
	color: var(--sixrsh-green-dark);
	line-height: 1;
	margin-bottom: 6px;
}

.sixrsh-stat-label {
	font-size: 12px;
	color: var(--sixrsh-muted);
	text-transform: uppercase;
	letter-spacing: .4px;
}

/* =============================================================================
   Widget settings — two-column layout
   ============================================================================= */

.sixrsh-settings-cols {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 20px;
	align-items: start;
}

.sixrsh-col-preview h3 {
	font-size: 14px;
	margin-bottom: 10px;
}

.sixrsh-color-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sixrsh-radio-group {
	display: flex;
	gap: 20px;
}

.sixrsh-radio-group label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 14px;
}

/* Widget preview */

.sixrsh-preview-frame {
	background: #f0f2f5;
	border-radius: 10px;
	width: 240px;
	height: 280px;
	position: relative;
	overflow: hidden;
	border: 1px solid var(--sixrsh-border);
}

.sixrsh-preview-widget {
	position: absolute;
	bottom: 20px;
	right: 20px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.sixrsh-preview-btn {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--sixrsh-green);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 12px rgba(0,0,0,.2);
	cursor: pointer;
}

.sixrsh-preview-tooltip {
	background: #fff;
	border-radius: 8px;
	padding: 7px 12px;
	font-size: 12px;
	box-shadow: 0 2px 10px rgba(0,0,0,.1);
	max-width: 180px;
	word-break: break-word;
	color: #333;
}

/* =============================================================================
   Logs
   ============================================================================= */

.sixrsh-logs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	flex-wrap: wrap;
	gap: 10px;
}

.sixrsh-logs-header h2 {
	margin: 0;
}

.sixrsh-logs-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.sixrsh-logs-table { font-size: 13px; }

.sixrsh-logs-table th {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: var(--sixrsh-muted);
	white-space: nowrap;
}

.sixrsh-logs-table td { vertical-align: middle; }

.sixrsh-logs-empty {
	text-align: center;
	color: var(--sixrsh-muted);
	padding: 24px !important;
}

.sixrsh-status-success { color: var(--sixrsh-green-dark); font-weight: 600; }
.sixrsh-status-failed  { color: var(--sixrsh-danger);     font-weight: 600; }

.sixrsh-table-wrap {
	overflow-x: auto;
}

.sixrsh-btn-danger {
	color: var(--sixrsh-danger) !important;
	border-color: var(--sixrsh-danger) !important;
}

.sixrsh-btn-danger:hover {
	background: #fce8e8 !important;
}

/* =============================================================================
   Wizard
   ============================================================================= */

.sixrsh-wizard-wrap {
	max-width: 620px;
	margin: 40px auto;
}

.sixrsh-wizard-step.hidden { display: none; }

.sixrsh-wizard-card {
	background: #fff;
	border: 1px solid var(--sixrsh-border);
	border-radius: 14px;
	box-shadow: 0 8px 32px rgba(0,0,0,.10);
	overflow: hidden;
}

.sixrsh-wizard-header {
	background: linear-gradient(135deg, #f9fffe 0%, var(--sixrsh-green-light) 100%);
	border-bottom: 1px solid var(--sixrsh-border);
	padding: 36px 40px 24px;
	text-align: center;
}

.sixrsh-wizard-header h1,
.sixrsh-wizard-header h2 {
	margin: 12px 0 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--sixrsh-text);
}

.sixrsh-wizard-header p {
	margin: 8px 0 0;
	color: var(--sixrsh-muted);
	font-size: 14px;
}

.sixrsh-wizard-logo {
	margin-bottom: 4px;
}

.sixrsh-success-icon {
	font-size: 48px;
	line-height: 1;
	display: block;
}

/* Progress bar */

.sixrsh-progress-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	margin-top: 24px;
}

.sixrsh-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.sixrsh-step-num {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #e0e0e0;
	color: #888;
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .3s, color .3s;
}

.sixrsh-step-label {
	font-size: 11px;
	color: var(--sixrsh-muted);
	white-space: nowrap;
}

.sixrsh-progress-step.active .sixrsh-step-num {
	background: var(--sixrsh-green);
	color: #fff;
}

.sixrsh-progress-step.done .sixrsh-step-num {
	background: var(--sixrsh-green-dark);
	color: #fff;
}

.sixrsh-progress-line {
	flex: 1;
	min-width: 40px;
	height: 2px;
	background: #e0e0e0;
	margin: 0 6px;
	margin-bottom: 16px;
	transition: background .3s;
}

.sixrsh-progress-line.filled {
	background: var(--sixrsh-green);
}

/* Wizard body */

.sixrsh-wizard-body {
	padding: 32px 40px 36px;
}

.sixrsh-lead {
	font-size: 15px;
	color: var(--sixrsh-text);
	margin: 0 0 10px;
}

.sixrsh-link {
	color: var(--sixrsh-green-dark);
	font-size: 14px;
	text-decoration: none;
	display: inline-block;
	margin-bottom: 18px;
}

.sixrsh-link:hover { text-decoration: underline; }

.sixrsh-field-wrap {
	margin: 16px 0;
}

.button.button-hero {
	height: 42px;
	line-height: 40px;
	padding: 0 24px;
	font-size: 15px;
}

/* Checklist */

.sixrsh-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sixrsh-cl-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f4f4f4;
	font-size: 14px;
	color: var(--sixrsh-text);
}

.sixrsh-cl-item:last-child { border-bottom: none; }

.sixrsh-cl-icon {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	flex-shrink: 0;
	background: #e0e0e0;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Pending: gray circle */
.sixrsh-cl-item.pending .sixrsh-cl-icon {
	background: #e0e0e0;
}

/* Loading: CSS spinner */
.sixrsh-cl-item.loading .sixrsh-cl-icon {
	background: transparent;
	border: 3px solid var(--sixrsh-green-light);
	border-top-color: var(--sixrsh-green);
	animation: sixrsh-spin .7s linear infinite;
}

/* Done: green check */
.sixrsh-cl-item.done .sixrsh-cl-icon {
	background: var(--sixrsh-green);
}

.sixrsh-cl-item.done .sixrsh-cl-icon::after {
	content: '';
	width: 6px;
	height: 10px;
	border: 2px solid #fff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg) translate(-1px, -1px);
}

/* Error: red x */
.sixrsh-cl-item.error .sixrsh-cl-icon {
	background: var(--sixrsh-danger);
}

.sixrsh-cl-item.error .sixrsh-cl-icon::after {
	content: '\00D7';
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

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

/* Summary card */

.sixrsh-summary-card {
	background: var(--sixrsh-green-light);
	border: 1px solid #b2dfca;
	border-radius: 10px;
	padding: 20px 24px;
	margin-bottom: 24px;
}

.sixrsh-summary-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	font-size: 14px;
}

.sixrsh-summary-item strong {
	font-size: 18px;
	color: var(--sixrsh-green-dark);
	min-width: 40px;
}

.sixrsh-wizard-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

/* =============================================================================
   Spinner wrapper
   ============================================================================= */

.sixrsh-spinner-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* =============================================================================
   Utility
   ============================================================================= */

.hidden { display: none !important; }

/* =============================================================================
   RTL support
   ============================================================================= */

[dir="rtl"] .sixrsh-field-label { text-align: right; }
[dir="rtl"] .sixrsh-card        { text-align: right; }
[dir="rtl"] .sixrsh-preview-widget { right: auto; left: 20px; }
[dir="rtl"] .sixrsh-progress-bar   { direction: rtl; }

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 900px) {
	.sixrsh-settings-cols {
		grid-template-columns: 1fr;
	}
	.sixrsh-col-preview {
		order: -1;
	}
	.sixrsh-stats-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.sixrsh-wizard-header,
	.sixrsh-wizard-body {
		padding-left: 20px;
		padding-right: 20px;
	}
	.sixrsh-logs-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.sixrsh-tabs {
		overflow-x: auto;
		white-space: nowrap;
		flex-wrap: nowrap;
	}
	.sixrsh-field-row {
		flex-direction: column;
		align-items: flex-start;
	}
	.sixrsh-field-label {
		flex: none;
	}
}

/* ═══════════════════════════════════════════════════════
   STATUS BAR (v1.1.0)
   ═══════════════════════════════════════════════════════ */

.sixrsh-status-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 1px solid var(--sixrsh-border);
	border-radius: 8px;
	padding: 10px 18px;
	margin-bottom: 18px;
	font-size: 13px;
	flex-wrap: wrap;
}

.sixrsh-dot {
	font-size: 10px;
	line-height: 1;
}

.sixrsh-dot-green { color: var(--sixrsh-green); }
.sixrsh-dot-gray  { color: #9ca3af; }
.sixrsh-dot-red   { color: var(--sixrsh-danger); }

.sixrsh-status-bar-sep {
	flex: 1;
}

.sixrsh-status-bar .button-link {
	color: var(--sixrsh-green-dark);
	font-size: 13px;
	text-decoration: none;
}

.sixrsh-status-bar .button-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   ONBOARDING CHECKLIST
   ═══════════════════════════════════════════════════════ */

.sixrsh-onboarding-checklist {
	background: #f9fffe;
	border: 1px solid #b2dfca;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 20px;
}

.sixrsh-onboarding-checklist h3 {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.sixrsh-onboarding-checklist ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sixrsh-onboarding-checklist li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	font-size: 13px;
	color: var(--sixrsh-text);
}

.sixrsh-check-done  { color: var(--sixrsh-green); font-size: 16px; font-weight: 700; }
.sixrsh-check-empty { color: #ccc; font-size: 16px; }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════ */

.sixrsh-empty-state {
	text-align: center;
	padding: 40px 20px;
	background: #f9f9f9;
	border: 2px dashed var(--sixrsh-border);
	border-radius: 10px;
	margin: 16px 0;
}

.sixrsh-empty-state p {
	color: var(--sixrsh-muted);
	margin-bottom: 16px;
	font-size: 14px;
}

.sixrsh-empty-icon {
	font-size: 40px;
	margin-bottom: 10px;
	display: block;
}

/* ═══════════════════════════════════════════════════════
   LOG DETAIL ROW
   ═══════════════════════════════════════════════════════ */

.sixrsh-log-detail-row td {
	background: #f9f9f9;
	font-family: monospace;
	font-size: 12px;
	word-break: break-all;
}

.sixrsh-status-skipped { color: #d97706; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   SETUP BANNER (override notice style)
   ═══════════════════════════════════════════════════════ */

#sixrsh-setup-banner {
	position: relative;
}

/* ═══════════════════════════════════════════════════════
   NAV TAB OVERRIDES (ensure our page looks right)
   ═══════════════════════════════════════════════════════ */

#sixrsh-settings .nav-tab-wrapper {
	margin-bottom: 20px;
	border-bottom-color: var(--sixrsh-border);
}

#sixrsh-settings .nav-tab {
	font-size: 13px;
}

#sixrsh-settings .nav-tab-active {
	border-bottom-color: var(--sixrsh-green);
	color: var(--sixrsh-green-dark);
}

#sixrsh-settings .nav-tab:hover {
	color: var(--sixrsh-green-dark);
	border-bottom-color: var(--sixrsh-green);
}

/* ═══════════════════════════════════════════════════════
   INLINE SAVE INDICATOR
   ═══════════════════════════════════════════════════════ */

.sixrsh-save-indicator {
	display: inline-block;
	font-size: 12px;
	color: var(--sixrsh-green-dark);
	opacity: 0;
	transition: opacity .3s;
	margin-left: 8px;
}

.sixrsh-save-indicator.show { opacity: 1; }

/* Cart section header */
.sixrsh-section-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.sixrsh-section-icon {
	font-size: 22px;
}

/* 6rsh info box */
.sixrsh-platform-box {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: 8px;
	padding: 18px 20px;
	margin-top: 8px;
}

.sixrsh-platform-box .sixrsh-platform-icon { font-size: 32px; flex-shrink: 0; }

.sixrsh-platform-box p { margin: 0 0 12px; font-size: 13px; color: #0c4a6e; }
