/**
 * SC-ICG SNMG — Frontend Partner Dashboard styles
 *
 * @package SC_ICG_SNMG
 */

/* ── Wrapper ─────────────────────────────── */
.snmg-dash {
	max-width: 960px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.snmg-dash-login-msg {
	text-align: center;
	padding: 60px 20px;
	color: #666;
	font-size: 16px;
}

/* ── Header ──────────────────────────────── */
.snmg-dash__header {
	margin-bottom: 24px;
}
.snmg-dash__welcome {
	font-size: 22px;
	font-weight: 600;
	margin: 0;
	color: #1d2327;
}

/* ── Navigation ──────────────────────────── */
.snmg-dash__nav {
	display: flex;
	gap: 0;
	border-bottom: 2px solid #e2e4e7;
	margin-bottom: 24px;
	overflow-x: auto;
}
.snmg-dash__nav-item {
	padding: 10px 18px;
	text-decoration: none;
	color: #50575e;
	font-size: 14px;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	white-space: nowrap;
	transition: color .2s, border-color .2s;
}
.snmg-dash__nav-item:hover {
	color: #2271b1;
}
.snmg-dash__nav-item--active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

/* ── Cards ───────────────────────────────── */
.snmg-dash__cards {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}
.snmg-dash__card {
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
}
.snmg-dash__card-value {
	font-size: 26px;
	font-weight: 700;
	color: #1d2327;
	line-height: 1.2;
}
.snmg-dash__card-label {
	font-size: 13px;
	color: #646970;
	margin-top: 6px;
}

/* ── Tables ──────────────────────────────── */
.snmg-dash__table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 24px;
	font-size: 14px;
}
.snmg-dash__table th {
	background: #f6f7f7;
	padding: 10px 14px;
	text-align: left;
	font-weight: 600;
	font-size: 13px;
	color: #50575e;
	border-bottom: 1px solid #e2e4e7;
}
.snmg-dash__table td {
	padding: 10px 14px;
	border-bottom: 1px solid #f0f0f1;
	color: #1d2327;
}
.snmg-dash__table tbody tr:last-child td {
	border-bottom: none;
}
.snmg-dash__table tbody tr:hover {
	background: #f9f9f9;
}

/* ── Refund rows ─────────────────────────── */
.snmg-dash__row--refund td {
	color: #b32d2e;
	text-decoration: line-through;
}
.snmg-dash__amount--negative {
	color: #b32d2e !important;
	font-weight: 600;
}

/* ── Payment expand button & row ─────────── */
.snmg-dash__expand-btn {
	background: none;
	border: 1px solid #ddd;
	border-radius: 4px;
	width: 28px;
	height: 28px;
	cursor: pointer;
	font-size: 10px;
	line-height: 1;
	color: #666;
	transition: all 0.2s;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.snmg-dash__expand-btn:hover {
	background: #f0f0f0;
	border-color: #bbb;
	color: #333;
}
.snmg-dash__expand-btn--open {
	background: #e8f4fd;
	border-color: #0a6eb1;
	color: #0a6eb1;
}
.snmg-dash__expand-row > td {
	padding: 0 !important;
	background: #f8f9fa;
	border-left: 3px solid #0a6eb1;
}
.snmg-dash__expand-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.snmg-dash__expand-table th {
	background: #eef1f3;
	padding: 8px 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #666;
	border-bottom: 1px solid #ddd;
}
.snmg-dash__expand-table td {
	padding: 7px 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}
.snmg-dash__expand-table tbody tr:last-child td {
	border-bottom: none;
}
.snmg-dash__expand-subtotal td {
	background: #f0f2f4;
	border-top: 1px solid #ddd;
}

/* ── Stopped subscription rows ──────────── */
.snmg-dash__row--stopped {
	opacity: 0.55;
}

/* ── Badges ──────────────────────────────── */
.snmg-dash__badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}
.snmg-dash__badge--success   { background: #d4edda; color: #155724; }
.snmg-dash__badge--warning   { background: #fff3cd; color: #856404; }
.snmg-dash__badge--info      { background: #d1ecf1; color: #0c5460; }
.snmg-dash__badge--danger    { background: #f8d7da; color: #721c24; }
.snmg-dash__badge--secondary { background: #e2e3e5; color: #383d41; }
.snmg-dash__badge--stopped   { background: #dc3232; color: #fff; font-size: 10px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }

/* ── Section titles ──────────────────────── */
.snmg-dash__section-title {
	font-size: 16px;
	font-weight: 600;
	margin: 24px 0 12px;
	color: #1d2327;
}
.snmg-dash__count { font-weight: 400; color: #646970; }

/* ── Period form ─────────────────────────── */
.snmg-dash__period-form {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}
.snmg-dash__period-form label { font-size: 14px; }
.snmg-dash__period-form input[type="month"] {
	padding: 6px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}

/* ── Total bar ───────────────────────────── */
.snmg-dash__total {
	background: #f0f6fc;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 10px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #2271b1;
	margin-bottom: 16px;
}

/* ── Buttons ─────────────────────────────── */
.snmg-dash__btn {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid #2271b1;
	border-radius: 4px;
	background: #2271b1;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
}
.snmg-dash__btn:hover { background: #135e96; }
.snmg-dash__btn--small { padding: 4px 10px; font-size: 12px; }

/* ── Upload form ─────────────────────────── */
.snmg-dash__upload-form {
	display: flex;
	align-items: center;
	gap: 6px;
}
.snmg-dash__file-input {
	font-size: 12px;
	max-width: 160px;
}

/* ── Invoice Type Form ─────────────────── */
.snmg-dash__invoice-form {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 140px;
}
.snmg-dash__radio-label {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.snmg-dash__radio-label input[type="radio"] {
	margin: 0;
	accent-color: #2271b1;
}
.snmg-dash__invoice-number-wrap {
	margin-top: 2px;
}
.snmg-dash__invoice-number {
	width: 100%;
	padding: 4px 8px;
	font-size: 13px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-sizing: border-box;
}
.snmg-dash__invoice-number:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}
.snmg-dash__text-sm {
	font-size: 12px;
	color: #757575;
}

.snmg-dash__empty {
	color: #646970;
	font-style: italic;
	padding: 20px 0;
}

/* ── Table horizontal scroll wrapper ──── */
.snmg-dash__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 24px;
}
.snmg-dash__table-wrap .snmg-dash__table {
	margin-bottom: 0;
	min-width: 700px;
}

/* ── Period filter bar ──────────────────── */
.snmg-dash__period-bar {
	margin-bottom: 20px;
}
.snmg-dash__period-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}
.snmg-dash__period-btn {
	display: inline-block;
	padding: 7px 16px;
	border: 1px solid #c3c4c7;
	border-radius: 20px;
	background: #fff;
	color: #50575e;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: all .2s;
	line-height: 1.4;
}
.snmg-dash__period-btn:hover {
	border-color: #2271b1;
	color: #2271b1;
	background: #f0f6fc;
}
.snmg-dash__period-btn--active,
.snmg-dash__period-btn--active:hover {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

/* Custom range form */
.snmg-dash__period-custom {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	padding: 12px 16px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
}
.snmg-dash__period-custom label {
	font-size: 13px;
	color: #50575e;
	font-weight: 500;
}
.snmg-dash__input-month {
	padding: 6px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 13px;
}

/* ── Total bar supplement ───────────────── */
.snmg-dash__total-count {
	font-weight: 400;
	font-size: 13px;
	color: #50575e;
	margin-left: 4px;
}

/* ── Email cells ────────────────────────── */
.snmg-dash__cell-email {
	font-size: 12px;
	color: #646970;
	word-break: break-all;
	max-width: 200px;
}

/* ── Coupon code tag ────────────────────── */
.snmg-dash__code {
	display: inline-block;
	padding: 1px 6px;
	background: #f0f6fc;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	font-family: Menlo, Consolas, monospace;
	font-size: 11.5px;
	color: #2271b1;
	white-space: nowrap;
}

/* ── Indent for sub-partner rows ────────── */
.snmg-dash__cell-indent {
	padding-left: 28px !important;
}

/* ── Copy Code Button ───────────────────── */
.snmg-dash__copy-code {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	background: #f0f6fc;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	transition: all .2s;
	margin: 2px 0;
}
.snmg-dash__copy-code:hover {
	border-color: #2271b1;
	background: #e8f0fe;
}
.snmg-dash__copy-code code {
	font-family: Menlo, Consolas, monospace;
	font-size: 12px;
	color: #2271b1;
	background: none;
	padding: 0;
	border: none;
}
.snmg-dash__copy-code svg {
	color: #646970;
	flex-shrink: 0;
}
.snmg-dash__copy-code--copied {
	border-color: #00a32a;
	background: #edfaef;
}
.snmg-dash__copy-code--copied code { color: #00a32a; }
.snmg-dash__copy-code--copied svg { color: #00a32a; }

/* ── Chart ───────────────────────────────── */
.snmg-dash__chart-wrap {
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 24px;
}
.snmg-dash__chart {
	width: 100%;
	height: auto;
}

/* ── Info Card (horizontal bar) ─────────── */
.snmg-dash__info-card {
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 24px;
}
.snmg-dash__info-card--horizontal .snmg-dash__info-title {
	display: none;
}
.snmg-dash__info-list {
	margin: 0;
}
.snmg-dash__info-list--horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 0 28px;
	align-items: center;
}
.snmg-dash__info-item {
	display: flex;
	align-items: center;
	gap: 6px;
}
.snmg-dash__info-item dt {
	font-size: 12px;
	color: #646970;
	margin: 0;
	white-space: nowrap;
}
.snmg-dash__info-item dd {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: #1d2327;
}
.snmg-dash__coupon-discount {
	font-size: 11px;
	color: #646970;
	font-weight: 400;
	margin-left: 2px;
}

/* ── Responsive ──────────────────────────── */
@media screen and (max-width: 768px) {
	.snmg-dash__cards { grid-template-columns: repeat(3, 1fr); }
}
@media screen and (max-width: 480px) {
	.snmg-dash__cards { grid-template-columns: repeat(2, 1fr); }
	.snmg-dash__info-list--horizontal { flex-direction: column; gap: 8px 0; align-items: flex-start; }
	.snmg-dash__table { font-size: 13px; }
	.snmg-dash__table th, .snmg-dash__table td { padding: 8px 10px; }
	.snmg-dash__period-presets { gap: 4px; }
	.snmg-dash__period-btn { padding: 5px 12px; font-size: 12px; }
	.snmg-dash__period-custom { padding: 10px 12px; gap: 6px; }
}
