/**
 * Sell BTC by Hayyat Apps — admin styles (Stripe-inspired).
 * Scoped under .happs-sbtc-admin and the plugin body classes so nothing leaks
 * into the rest of wp-admin.
 */

/* White canvas for every plugin screen. */
body[class*="_page_happs-sbtc"] #wpcontent,
body.toplevel_page_happs-sbtc #wpcontent,
body[class*="_page_happs-sbtc"] #wpbody-content,
body.toplevel_page_happs-sbtc #wpbody-content { background: #ffffff; }

.happs-sbtc-admin {
	--sbtc-brand: #635bff;
	--sbtc-brand-2: #4b45c6;
	--sbtc-ink: #0a2540;
	--sbtc-muted: #697386;
	--sbtc-line: #e3e8ee;
	--sbtc-soft: #f6f8fb;
	--sbtc-ok: #1a9d63;
	--sbtc-warn: #bb7714;
	--sbtc-err: #cd3d64;
	--sbtc-shadow: 0 1px 2px rgba(10,37,64,.06), 0 4px 12px rgba(10,37,64,.05);
	--sbtc-radius: 12px;

	max-width: 1180px;
	margin: 18px 20px 40px 2px;
	color: var(--sbtc-ink);
	font-size: 14px;
	-webkit-font-smoothing: antialiased;
}

/* ---- header ---- */
.happs-sbtc-admin .happs-sbtc-topbar { margin: 0 0 22px; }
.happs-sbtc-admin .happs-sbtc-topbar-head { display: flex; align-items: center; gap: 12px; }
.happs-sbtc-admin .happs-sbtc-logo {
	width: 40px; height: 40px; border-radius: 9px; flex: 0 0 auto; object-fit: contain; display: block;
}
.happs-sbtc-admin .happs-sbtc-topbar-titles { min-width: 0; }
.happs-sbtc-admin .happs-sbtc-topbar h1 {
	font-size: 24px; font-weight: 700; color: var(--sbtc-ink); margin: 0; padding: 0; line-height: 1.2;
}
.happs-sbtc-admin .happs-sbtc-subtitle { margin: 6px 0 0; color: var(--sbtc-muted); font-size: 13.5px; }

/* ---- tabs ---- */
.happs-sbtc-admin .happs-sbtc-tabs {
	display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 22px;
	border-bottom: 1px solid var(--sbtc-line); padding-bottom: 0;
}
.happs-sbtc-admin .happs-sbtc-tab {
	display: inline-block; padding: 9px 14px; text-decoration: none; font-weight: 600; font-size: 13.5px;
	color: var(--sbtc-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.happs-sbtc-admin .happs-sbtc-tab:hover { color: var(--sbtc-ink); }
.happs-sbtc-admin .happs-sbtc-tab.is-active { color: var(--sbtc-brand); border-bottom-color: var(--sbtc-brand); }

/* ---- cards / stat tiles ---- */
.happs-sbtc-admin .happs-sbtc-cards { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 22px; }
.happs-sbtc-admin .happs-sbtc-card {
	flex: 1 1 170px; min-width: 150px; background: #fff; border: 1px solid var(--sbtc-line);
	border-radius: var(--sbtc-radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
	box-shadow: var(--sbtc-shadow);
}
.happs-sbtc-admin .happs-sbtc-card.is-ok { box-shadow: var(--sbtc-shadow), inset 3px 0 0 var(--sbtc-ok); }
.happs-sbtc-admin .happs-sbtc-card.is-warn { box-shadow: var(--sbtc-shadow), inset 3px 0 0 var(--sbtc-warn); }
.happs-sbtc-admin .happs-sbtc-card-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--sbtc-muted); font-weight: 600; }
.happs-sbtc-admin .happs-sbtc-card-value { font-size: 22px; font-weight: 700; color: var(--sbtc-ink); }

/* ---- panels / forms ---- */
.happs-sbtc-admin .happs-sbtc-form,
.happs-sbtc-admin .happs-sbtc-panel {
	background: #fff; border: 1px solid var(--sbtc-line); border-radius: var(--sbtc-radius);
	padding: 20px 22px; margin: 0 0 16px; box-shadow: var(--sbtc-shadow);
}
.happs-sbtc-admin .happs-sbtc-h2 { margin: 26px 0 12px; font-size: 16px; font-weight: 700; color: var(--sbtc-ink); }

.happs-sbtc-admin .happs-sbtc-note {
	background: #fff; border: 1px solid var(--sbtc-line); border-radius: var(--sbtc-radius);
	padding: 14px 18px; margin: 0 0 16px; box-shadow: var(--sbtc-shadow);
}
.happs-sbtc-admin .happs-sbtc-note-warn { background: #fff9ec; border-color: #f0d8a8; }

/* ---- inputs ---- */
.happs-sbtc-admin input[type="text"],
.happs-sbtc-admin input[type="email"],
.happs-sbtc-admin input[type="number"],
.happs-sbtc-admin input[type="url"],
.happs-sbtc-admin input[type="search"],
.happs-sbtc-admin input[type="date"],
.happs-sbtc-admin select,
.happs-sbtc-admin textarea {
	border: 1px solid var(--sbtc-line); border-radius: 8px; padding: 8px 11px; background: #fff;
	color: var(--sbtc-ink); font-size: 14px; box-shadow: 0 1px 1px rgba(10,37,64,.04); min-height: 36px;
	transition: border-color .15s, box-shadow .15s; max-width: 100%;
}
.happs-sbtc-admin textarea { min-height: 72px; line-height: 1.5; }
/* Restore a dropdown arrow (the solid background above hides WP's native one). */
.happs-sbtc-admin select {
	-webkit-appearance: none; -moz-appearance: none; appearance: none;
	padding-right: 30px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23697386' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
}
.happs-sbtc-admin input:focus,
.happs-sbtc-admin select:focus,
.happs-sbtc-admin textarea:focus {
	border-color: var(--sbtc-brand); box-shadow: 0 0 0 3px rgba(99,91,255,.18); outline: 0;
}
.happs-sbtc-admin label { font-size: 13.5px; }
.happs-sbtc-admin .description { color: var(--sbtc-muted); font-size: 12.5px; }

/* ---- buttons ---- */
.happs-sbtc-admin .button,
.happs-sbtc-admin .happs-sbtc-btn {
	border-radius: 8px; border: 1px solid var(--sbtc-line); background: #fff; color: var(--sbtc-ink);
	font-weight: 600; font-size: 13.5px; padding: 7px 14px; height: auto; line-height: 1.5;
	box-shadow: 0 1px 1px rgba(10,37,64,.04); transition: background .15s, border-color .15s, box-shadow .15s; cursor: pointer;
}
.happs-sbtc-admin .button:hover { background: var(--sbtc-soft); border-color: #d5dbe4; color: var(--sbtc-ink); }
.happs-sbtc-admin .button-primary,
.happs-sbtc-admin .happs-sbtc-btn-primary {
	background: var(--sbtc-brand); border-color: var(--sbtc-brand); color: #fff;
	box-shadow: 0 1px 2px rgba(99,91,255,.5);
}
.happs-sbtc-admin .button-primary:hover,
.happs-sbtc-admin .happs-sbtc-btn-primary:hover { background: var(--sbtc-brand-2); border-color: var(--sbtc-brand-2); color: #fff; }
.happs-sbtc-admin .button:focus { box-shadow: 0 0 0 3px rgba(99,91,255,.2); outline: 0; }

/* ---- tables ---- */
.happs-sbtc-admin .happs-sbtc-table {
	width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
	border: 1px solid var(--sbtc-line); border-radius: var(--sbtc-radius); box-shadow: var(--sbtc-shadow);
}
.happs-sbtc-admin .happs-sbtc-table thead th:first-child { border-top-left-radius: var(--sbtc-radius); }
.happs-sbtc-admin .happs-sbtc-table thead th:last-child { border-top-right-radius: var(--sbtc-radius); }
.happs-sbtc-admin .happs-sbtc-scroll .happs-sbtc-table thead th:first-child,
.happs-sbtc-admin .happs-sbtc-scroll .happs-sbtc-table thead th:last-child { border-radius: 0; }
.happs-sbtc-admin .happs-sbtc-table th,
.happs-sbtc-admin .happs-sbtc-table td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--sbtc-line); font-size: 13.5px; vertical-align: middle; }
.happs-sbtc-admin .happs-sbtc-table thead th {
	background: var(--sbtc-soft); font-weight: 600; color: var(--sbtc-muted); text-transform: uppercase;
	font-size: 11.5px; letter-spacing: .03em;
	/* Sticky header: stays visible while scrolling the table / page. */
	position: sticky; top: 32px; z-index: 3;
}
/* Inside a bounded scroll box the header sticks to the box, not the page. */
.happs-sbtc-admin .happs-sbtc-scroll .happs-sbtc-table thead th { top: 0; }
@media screen and (max-width: 782px) {
	.happs-sbtc-admin .happs-sbtc-table thead th { top: 46px; }
	.happs-sbtc-admin .happs-sbtc-scroll .happs-sbtc-table thead th { top: 0; }
}
.happs-sbtc-admin .happs-sbtc-table tbody tr:last-child td { border-bottom: 0; }
.happs-sbtc-admin .happs-sbtc-table tbody tr:hover { background: #fafbfd; }
.happs-sbtc-admin .happs-sbtc-table a { color: var(--sbtc-brand); text-decoration: none; }
.happs-sbtc-admin .happs-sbtc-table a:hover { text-decoration: underline; }

.happs-sbtc-admin .happs-sbtc-compare td:nth-child(2), .happs-sbtc-admin .happs-sbtc-compare td:nth-child(3),
.happs-sbtc-admin .happs-sbtc-compare th:nth-child(2), .happs-sbtc-admin .happs-sbtc-compare th:nth-child(3) { text-align: center; width: 120px; }
.happs-sbtc-admin .happs-sbtc-yes { color: var(--sbtc-ok); font-weight: 700; }
.happs-sbtc-admin .happs-sbtc-no { color: #c7ced8; }

/* ---- fee display options ---- */
.happs-sbtc-admin .happs-sbtc-feesub { margin-left: 26px; padding-left: 12px; border-left: 2px solid var(--sbtc-line); }
.happs-sbtc-admin .happs-sbtc-opt { margin: 9px 0; transition: opacity .15s; }
.happs-sbtc-admin .happs-sbtc-opt-indent { margin-left: 26px; }

/* ---- currencies bulk actions ---- */
.happs-sbtc-admin .happs-sbtc-bulk-form { margin: 0 0 8px; }
.happs-sbtc-admin .happs-sbtc-bulkbar {
	display: flex; align-items: center; gap: 10px; background: var(--sbtc-brand); color: #fff;
	border-radius: 8px; padding: 6px 12px; margin: 0 0 10px; box-shadow: var(--sbtc-shadow); flex-wrap: wrap;
}
.happs-sbtc-admin .happs-sbtc-bulk-count-wrap { font-size: 12.5px; white-space: nowrap; }
.happs-sbtc-admin .happs-sbtc-bulk-count { font-weight: 700; }
.happs-sbtc-admin .happs-sbtc-bulkbar .happs-sbtc-bulk-select {
	width: 210px; max-width: 100%; min-height: 32px; height: auto; padding: 6px 30px 6px 12px; border-radius: 7px;
	border: 0; background-color: #fff; color: var(--sbtc-ink); font-weight: 600; font-size: 13px; line-height: 1.4;
	background-position: right 10px center; text-overflow: ellipsis; vertical-align: middle;
}
.happs-sbtc-admin .happs-sbtc-bulkbar .button { height: auto; min-height: 32px; }
.happs-sbtc-admin .happs-sbtc-bulkbar .button {
	background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; min-height: 30px; height: 30px; padding: 3px 14px; line-height: 1;
}
.happs-sbtc-admin .happs-sbtc-bulkbar .button:hover { background: rgba(255,255,255,.28); color: #fff; }
.happs-sbtc-admin .happs-sbtc-cb-cell { text-align: center; width: 42px; }
.happs-sbtc-admin .happs-sbtc-cb, .happs-sbtc-admin .happs-sbtc-cb-all { cursor: pointer; margin: 0; }

/* ---- status badge ---- */
.happs-sbtc-admin .happs-sbtc-badge {
	display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eef1f6; color: #43506b;
	font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ---- filter bar ---- */
.happs-sbtc-admin .happs-sbtc-filterbar {
	display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: #fff; border: 1px solid var(--sbtc-line);
	border-radius: var(--sbtc-radius); padding: 14px 16px; margin: 0 0 16px; box-shadow: var(--sbtc-shadow);
}
.happs-sbtc-admin .happs-sbtc-filterbar label { font-size: 11.5px; color: var(--sbtc-muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.happs-sbtc-admin .happs-sbtc-del { color: var(--sbtc-err); }

/* ---- description box ---- */
.happs-sbtc-admin .happs-sbtc-desc {
	background: #eef1fe; border: 1px solid #d6dcfb; color: #2f3a63; border-radius: 10px;
	padding: 12px 16px; margin: 0 0 16px; font-size: 13px; line-height: 1.55; max-width: 900px;
}

/* ---- help tooltip ---- */
.happs-sbtc-admin .happs-sbtc-tip {
	display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
	border-radius: 50%; background: #d7dce6; color: #43506b; font-size: 11px; font-weight: 700;
	cursor: help; position: relative; margin-left: 5px; vertical-align: middle; line-height: 1;
}
.happs-sbtc-admin .happs-sbtc-tip::after {
	content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
	width: 240px; background: #0a2540; color: #fff; padding: 9px 11px; border-radius: 8px; font-size: 12px;
	font-weight: 400; line-height: 1.45; text-align: left; opacity: 0; visibility: hidden; transition: opacity .15s;
	z-index: 60; box-shadow: 0 8px 22px rgba(10,37,64,.28); pointer-events: none; white-space: normal;
}
.happs-sbtc-admin .happs-sbtc-tip::before {
	content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
	border: 6px solid transparent; border-top-color: #0a2540; opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 61;
}
.happs-sbtc-admin .happs-sbtc-tip:hover::after, .happs-sbtc-admin .happs-sbtc-tip:focus::after,
.happs-sbtc-admin .happs-sbtc-tip:hover::before, .happs-sbtc-admin .happs-sbtc-tip:focus::before { opacity: 1; visibility: visible; }

/* ---- scrollable tables ---- */
.happs-sbtc-admin .happs-sbtc-scroll { max-height: 420px; overflow: auto; border-radius: var(--sbtc-radius); border: 1px solid var(--sbtc-line); margin-bottom: 8px; }
.happs-sbtc-admin .happs-sbtc-scroll .happs-sbtc-table { border: 0; border-radius: 0; box-shadow: none; }

/* ---- shortcode descriptions + cmc type ---- */
.happs-sbtc-admin .happs-sbtc-sc { align-items: flex-start; }
.happs-sbtc-admin .happs-sbtc-sc-info { flex: 1 1 auto; }
.happs-sbtc-admin .happs-sbtc-sc-desc { margin: 6px 0 0; color: var(--sbtc-muted); font-size: 12px; line-height: 1.45; }
.happs-sbtc-admin .happs-sbtc-cmc-bar #happs-sbtc-cmc-type { flex: 0 0 auto; }

/* ---- add-currency: 2-col fields + CMC search ---- */
.happs-sbtc-admin .happs-sbtc-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; }
.happs-sbtc-admin .happs-sbtc-2col > p { margin: 8px 0; }
.happs-sbtc-admin .happs-sbtc-2col input,
.happs-sbtc-admin .happs-sbtc-2col select { width: 100%; }
.happs-sbtc-admin .happs-sbtc-checks { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0 4px; }
@media (max-width: 640px) { .happs-sbtc-admin .happs-sbtc-2col { grid-template-columns: 1fr; } }

.happs-sbtc-admin .happs-sbtc-cmc-search { max-width: 640px; margin: 0 auto 18px; }
.happs-sbtc-admin .happs-sbtc-cmc-bar { display: flex; gap: 8px; }
.happs-sbtc-admin .happs-sbtc-cmc-bar select { flex: 0 0 auto; }
.happs-sbtc-admin .happs-sbtc-cmc-bar input { flex: 1 1 auto; }
.happs-sbtc-admin .happs-sbtc-cmc-results {
	margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid var(--sbtc-line);
	display: none; max-height: 320px; overflow-y: auto;
}
.happs-sbtc-admin .happs-sbtc-cmc-results.is-open { display: block; }
.happs-sbtc-admin .happs-sbtc-cmc-item {
	display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
	border-bottom: 1px solid var(--sbtc-line); background: #fff;
}
.happs-sbtc-admin .happs-sbtc-cmc-item:last-child { border-bottom: 0; }
.happs-sbtc-admin .happs-sbtc-cmc-item:hover { background: var(--sbtc-soft); }
.happs-sbtc-admin .happs-sbtc-cmc-item img { width: 24px; height: 24px; border-radius: 50%; }
.happs-sbtc-admin .happs-sbtc-cmc-item b { font-weight: 700; }
.happs-sbtc-admin .happs-sbtc-cmc-item span { color: var(--sbtc-muted); }
.happs-sbtc-admin .happs-sbtc-cmc-item .cmcid { margin-left: auto; font-size: 11.5px; color: var(--sbtc-muted); }
.happs-sbtc-admin .happs-sbtc-cmc-empty { padding: 12px; color: var(--sbtc-muted); text-align: center; }

/* ---- shortcode chips ---- */
.happs-sbtc-admin .happs-sbtc-shortcodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.happs-sbtc-admin .happs-sbtc-sc {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--sbtc-soft);
	border: 1px solid var(--sbtc-line); border-radius: 10px; padding: 10px 12px;
}
.happs-sbtc-admin .happs-sbtc-sc code { background: transparent; color: var(--sbtc-ink); font-size: 12.5px; padding: 0; }
.happs-sbtc-admin .happs-sbtc-sc small { display: block; color: var(--sbtc-muted); font-weight: 400; margin-bottom: 3px; }
.happs-sbtc-admin .happs-sbtc-copy { flex: 0 0 auto; }

/* ---- pagination ---- */
.happs-sbtc-admin .happs-sbtc-pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.happs-sbtc-admin .happs-sbtc-pagination a.is-current { background: var(--sbtc-brand); border-color: var(--sbtc-brand); color: #fff; }

/* ---- modal ---- */
.happs-sbtc-modal-backdrop {
	position: fixed; inset: 0; background: rgba(10,37,64,.45); z-index: 100000; display: none;
	align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto;
}
.happs-sbtc-modal-backdrop.is-open { display: flex; }
.happs-sbtc-modal {
	background: #fff; border-radius: 14px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(10,37,64,.3);
	overflow: hidden; animation: happs-sbtc-pop .16s ease-out;
}
@keyframes happs-sbtc-pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.happs-sbtc-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--sbtc-line); }
.happs-sbtc-modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.happs-sbtc-modal-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--sbtc-muted); padding: 4px 8px; }
.happs-sbtc-modal-close:hover { color: var(--sbtc-ink); }
.happs-sbtc-modal-body { padding: 20px; max-height: 72vh; overflow: auto; }
.happs-sbtc-modal-body .happs-sbtc-table { box-shadow: none; }
.happs-sbtc-spin { display: inline-block; width: 18px; height: 18px; border: 2px solid #d7dce4; border-top-color: var(--sbtc-brand); border-radius: 50%; animation: happs-sbtc-rot .7s linear infinite; }
@keyframes happs-sbtc-rot { to { transform: rotate(360deg); } }
.happs-sbtc-loading-row { padding: 30px; text-align: center; color: var(--sbtc-muted); }

/* ---- responsive ---- */
@media (max-width: 782px) {
	.happs-sbtc-admin { margin: 10px; }
	.happs-sbtc-admin .happs-sbtc-cards { flex-direction: column; }
	.happs-sbtc-admin .happs-sbtc-table { display: block; overflow-x: auto; }
}
